Qt 5.3.2: Form transitions C++



  • Hi,

    I need to slide on and off (like the iOS navigation controller) different .ui fullscreen forms, I've seen in QML the StackView but does something like that exist in the c++ API?

    Thanks,
    Michael



  • you could use QPropertyAnimation on the pos of the widget.
    this is an extract from an old widget I wrote

    	QParallelAnimationGroup* 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);
    


  • @VRonin Thanks!, this is what I ended up doing in the end, I just wondered if there was a nicer way like StackView.



Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.