setDuration(500); animation->setStartValue(1); animatio..._qpropertyanimation 颜色渐变">
赞
踩
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()));
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。