Qt 5.3.2: Form transitions C++
-
you could use QPropertyAnimation on the pos of the widget.
this is an extract from an old widget I wroteQParallelAnimationGroup* Animazioni=new QParallelAnimationGroup; QPropertyAnimation* AnimCurrent=new QPropertyAnimation(currentIcon,"pos",Displayer); AnimCurrent->setDuration(DurataAnimazione); AnimCurrent->setEasingCurve(QEasingCurve::Linear); AnimCurrent->setKeyValueAt(0.0,QPoint(0,0)); AnimCurrent->setKeyValueAt(1.0,QPoint(-Displayer->width()-10,0)); Animazioni->addAnimation(ANimationDuration); QPropertyAnimation* AnimNext=new QPropertyAnimation(NextIcon,"pos",Displayer); AnimNext->setDuration(ANimationDuration); AnimNext->setEasingCurve(QEasingCurve::Linear); AnimNext->setKeyValueAt(1.0,QPoint(0,0)); AnimNext->setKeyValueAt(0.0,QPoint(Displayer->width()+10,0)); Animazioni->addAnimation(AnimNext); connect(Animazioni,SIGNAL(finished()),this,SLOT(Successiva())); Animazioni->start(QAbstractAnimation::DeleteWhenStopped);