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.


  • 相关阅读:
    docker-compose 命令不存在
    linux安装rabbitmq ssm集成rabbitmq
    tomcat参数错误 服务器400
    无限极分内 自联查询
    图片移入变大 点击图片切换 点击按钮显示图片
    js正则表达式基本书写
    随鼠标移动
    输入电话号码
    添加新句子
    窗口的弹出与关闭
  • 原文地址:https://www.cnblogs.com/findumars/p/6209676.html
Copyright © 2011-2022 走看看