Results 1 to 2 of 2

Thread: QGraphicsItems and Animation

Threaded View

Previous Post Previous Post   Next Post Next Post
  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

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
  •  
Qt is a trademark of The Qt Company.