zoukankan      html  css  js  c++  java
  • qt如何实现一个渐隐窗口呢(开启的时候他是从上往下渐渐显示)

    qt如何实现一个渐隐窗口呢?就是比如说开启的时候他是从上往下渐渐显示的,关闭的时候从下往上渐渐小时的
    http://stackoverflow.com/questions/19087822/how-to-make-qt-widgets-fade-in-or-fade-out

    Fade In Your Widget

    // w is your widget
    QGraphicsOpacityEffect *eff = new QGraphicsOpacityEffect(this);
    w->setGraphicsEffect(eff);
    QPropertyAnimation *a = new QPropertyAnimation(eff,"opacity");
    a->setDuration(350);
    a->setStartValue(0);
    a->setEndValue(1);
    a->setEasingCurve(QEasingCurve::InBack);
    a->start(QPropertyAnimation::DeleteWhenStopped);

    Fade Out Your Widget

    // w is your widget
    QGraphicsOpacityEffect *eff = new QGraphicsOpacityEffect(this);
    w->setGraphicsEffect(eff);
    QPropertyAnimation *a = new QPropertyAnimation(eff,"opacity");
    a->setDuration(350);
    a->setStartValue(1);
    a->setEndValue(0);
    a->setEasingCurve(QEasingCurve::OutBack);
    a->start(QPropertyAnimation::DeleteWhenStopped);
    connect(a,SIGNAL(finished()),this,SLOT(hideThisWidget()));
    // now implement a slot called hideThisWidget() to do
    // things like hide any background dimmer, etc.


  • 相关阅读:
    僵尸进程
    理论整理
    SQLServer相关概念
    存储过程
    我的简书地址
    swift pragma mark
    苹果iOS开发中如何直接跳转到App Store页面
    使用cocoadPod updating local specs repositories 卡主
    iOS 代码格式化插件Clang-Format
    iOS错误:AFNetworking Error Domain=NSURLErrorDomain Code=-999
  • 原文地址:https://www.cnblogs.com/findumars/p/6209676.html
Copyright © 2011-2022 走看看