PDA

View Full Version : Mapping QPropertyAnimation on to QGraphicsView



volcano
6th January 2010, 05:05
Hi,

I'm working on an application which requires fade transition.
I managed to get the slide transition working using QGraphicsItemAnimation and could successfully map it to the QGraphicsView.

The problem I'm facing is to map QPropertyAnimation to QGraphicsView.
My fade transition is happening as follows


QPropertyAnimation *f1 = new QPropertyAnimation(wList.at(tindex), "opacity");
f1->setDuration(1000);
f1->setStartValue(1);
f1->setEndValue(0);

QPropertyAnimation *f3 = new QPropertyAnimation(wList.at(index), "opacity");
f3->setDuration(1000);
f3->setStartValue(0);
f3->setEndValue(1);
QParallelAnimationGroup *group = new QParallelAnimationGroup;
group->addAnimation(f1);
group->addAnimation(f3);
group->start();
where wList is a list containing QGraphicsProxyWidgets.

Any pointers to help map the QParallelAnimationGroup to QGraphicsView.
Thanks

axeljaeger
8th January 2010, 12:21
Use a QStateMachine. Define two states and set the appropriate properties of all object in the two states and then use QTimeLines as animators for all properties that need to fade.