QParallelAnimationGroup *group = new QParallelAnimationGroup; QPropertyAnimation *opacAnimCur = new QPropertyAnimation(currentWidget, "opacity", group); opacAnimCur->setDuration(mSwitchDuration); opacAnimCur->setEasingCurve(QEasingCurve::InExpo); opacAnimCur->setStartValue(1); opacAnimCur->setEndValue(0); QPropertyAnimation *opacAnimHid = new QPropertyAnimation(currentWidget, "opacity", group); opacAnimHid->setDuration(mSwitchDuration); opacAnimHid->setEasingCurve(QEasingCurve::InExpo); opacAnimHid->setStartValue(0); opacAnimHid->setEndValue(1);
... arrButton[i]->blockSignals(true); //you can still press this button, but it will not emit signals... connect(seqAnim,SIGNAL(finished()),this,SLOT(onAnimationFinished())); seqAnim->start(QAbstractAnimation::DeleteWhenStopped);...void onAnimationFinished(){for (int i(0); i < 12; i++) arrButton[i]->blockSignals(false);}