QList<QPushButton*> btnList = ui->centralWidget->findChildren<QPushButton*>(); QList<QLineEdit*> lineList = ui->centralWidget->findChildren<QLineEdit*>(); for (auto i : btnList) qList.append(i); for (auto i : lineList) qList.append(i);
for (auto i : qList) { QGraphicsDropShadowEffect * shadow_effect = new QGraphicsDropShadowEffect(this); shadow_effect->setOffset(2, 2); shadow_effect->setColor(QColor(55, 55, 55)); shadow_effect->setBlurRadius(8);
QSequentialAnimationGroup *positionAnimationGroup = new QSequentialAnimationGroup(this); positionAnimationGroup->addAnimation(appearPositionAnimation); positionAnimationGroup->addPause(2000); // pScaleGroup->addAnimation(vanishPostionAnimation);
this->setWindowOpacity(0.0);
QPropertyAnimation* appearOpacityAnimation = new QPropertyAnimation(this, "windowOpacity"); appearOpacityAnimation->setDuration(1000); // will take 5 seconds appearOpacityAnimation->setEasingCurve(QEasingCurve::OutBack); // just demonstration, there are a lot of curves to choose appearOpacityAnimation->setStartValue(0.0); appearOpacityAnimation->setEndValue(1.0);
QPropertyAnimation* vanishOpacityAnimation = new QPropertyAnimation(this, "windowOpacity"); vanishOpacityAnimation->setDuration(1000); // will take 5 seconds vanishOpacityAnimation->setEasingCurve(QEasingCurve::Linear); // just demonstration, there are a lot of curves to choose vanishOpacityAnimation->setStartValue(1.0); vanishOpacityAnimation->setEndValue(0.0);
QSequentialAnimationGroup *opacityAnimationGroup = new QSequentialAnimationGroup(this); opacityAnimationGroup->addAnimation(appearOpacityAnimation); opacityAnimationGroup->addPause(2000); opacityAnimationGroup->addAnimation(vanishOpacityAnimation);