Qt 设置窗体或控件渐变消失
生活随笔
收集整理的這篇文章主要介紹了
Qt 设置窗体或控件渐变消失
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1、主窗體漸變
QPropertyAnimation *animation =new QPropertyAnimation(this,"windowOpacity");animation->setDuration(500);animation->setStartValue(1);animation->setEndValue(0);animation->setEasingCurve(QEasingCurve::Linear);animation->start();connect(animation, SIGNAL(finished()), this, SLOT(showlogout()));2、子控件漸變
QGraphicsOpacityEffect *m_pGraphicsOpacityEffect =new QGraphicsOpacityEffect(ui->groupBox_login);m_pGraphicsOpacityEffect->setOpacity(1.0);ui->groupBox_login->setGraphicsEffect(m_pGraphicsOpacityEffect);QPropertyAnimation *animation =new QPropertyAnimation(m_pGraphicsOpacityEffect,"opacity",ui->groupBox_login);animation->setDuration(500);animation->setStartValue(1);animation->setEndValue(0);animation->setEasingCurve(QEasingCurve::Linear);animation->start();connect(animation, SIGNAL(finished()), this, SLOT(showlogout()));?
總結
以上是生活随笔為你收集整理的Qt 设置窗体或控件渐变消失的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 汇编语言程序设计技巧详解(附例题)
- 下一篇: DSS部署-完整版