Results 1 to 2 of 2

Thread: QGraphicsItems and Animation

  1. #1
    Join Date
    Sep 2011
    Location
    Mannheim, Germany
    Posts
    22
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QGraphicsItems and Animation

    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 ) ?

    Qt Code:
    1. QPropertyAnimation* anim = new QPropertyAnimation(this, "scale");
    2. anim->setDuration(300);
    3. anim->setStartValue(1.1);
    4. anim->setEndValue(1.0);
    5. anim->setEasingCurve(QEasingCurve::OutElastic);
    6. connect(anim, SIGNAL(finished()), this, SLOT(animationFinished()));
    7. textItemName->setFlag(QGraphicsItem::ItemIgnoresTransformations,true);
    8. textItemType->setFlag(QGraphicsItem::ItemIgnoresTransformations,true);
    9. anim->start(QAbstractAnimation::DeleteWhenStopped);
    To copy to clipboard, switch view to plain text mode 


    QPropertyAnimation ignores my QGraphicsItem::ItemIgnoresTransformations flag :-(
    Last edited by wysota; 7th October 2011 at 21:18. Reason: missing [code] tags

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QGraphicsItems and Animation

    What are textItemName and textItemType? How are they related to "this"?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Interacting QGraphicsItems together
    By sean.reynolds in forum Qt Programming
    Replies: 2
    Last Post: 16th April 2011, 09:35
  2. Replies: 2
    Last Post: 8th December 2010, 10:51
  3. Questions about QGraphicsItems
    By NoRulez in forum Qt Programming
    Replies: 6
    Last Post: 8th May 2008, 19:01
  4. Problems with QGraphicsItems
    By JonathanForQT4 in forum Qt Programming
    Replies: 5
    Last Post: 26th April 2007, 08:25
  5. QGraphicsItems on top of each other?
    By Morea in forum Qt Programming
    Replies: 2
    Last Post: 18th November 2006, 20:23

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.