PDA

View Full Version : QGraphicsItems and Animation



dennis81
5th October 2011, 13:02
Hello community,

I am using Qt 4.7.4 and want to animate some QGraphicsitems.
How can I prevent that QPropertyAnimation animates my items children (textItemName and textItemType ) ?


QPropertyAnimation* anim = new QPropertyAnimation(this, "scale");
anim->setDuration(300);
anim->setStartValue(1.1);
anim->setEndValue(1.0);
anim->setEasingCurve(QEasingCurve::OutElastic);
connect(anim, SIGNAL(finished()), this, SLOT(animationFinished()));
textItemName->setFlag(QGraphicsItem::ItemIgnoresTransformations, true);
textItemType->setFlag(QGraphicsItem::ItemIgnoresTransformations, true);
anim->start(QAbstractAnimation::DeleteWhenStopped);


QPropertyAnimation ignores my QGraphicsItem::ItemIgnoresTransformations flag :-(

wysota
7th October 2011, 21:19
What are textItemName and textItemType? How are they related to "this"?