Results 1 to 2 of 2

Thread: Mapping QPropertyAnimation on to QGraphicsView

  1. #1
    Join Date
    Jan 2010
    Posts
    95
    Thanks
    14
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Mapping QPropertyAnimation on to QGraphicsView

    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

    Qt Code:
    1. QPropertyAnimation *f1 = new QPropertyAnimation(wList.at(tindex), "opacity");
    2. f1->setDuration(1000);
    3. f1->setStartValue(1);
    4. f1->setEndValue(0);
    5.  
    6. QPropertyAnimation *f3 = new QPropertyAnimation(wList.at(index), "opacity");
    7. f3->setDuration(1000);
    8. f3->setStartValue(0);
    9. f3->setEndValue(1);
    10. QParallelAnimationGroup *group = new QParallelAnimationGroup;
    11. group->addAnimation(f1);
    12. group->addAnimation(f3);
    13. group->start();
    To copy to clipboard, switch view to plain text mode 
    where wList is a list containing QGraphicsProxyWidgets.

    Any pointers to help map the QParallelAnimationGroup to QGraphicsView.
    Thanks
    Last edited by wysota; 8th January 2010 at 21:56. Reason: Missing [code] tags

  2. #2
    Join Date
    Jan 2006
    Location
    Frankfurt
    Posts
    500
    Thanks
    1
    Thanked 52 Times in 52 Posts
    Platforms
    MacOS X Unix/X11

    Default Re: Mapping QPropertyAnimation on to QGraphicsView

    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.
    It's nice to be important but it's more important to be nice.

Similar Threads

  1. Replies: 8
    Last Post: 12th November 2009, 00:51
  2. Replies: 2
    Last Post: 11th November 2009, 08:03
  3. QGraphicsView Framework coordinate mapping problem
    By zgulser in forum Qt Programming
    Replies: 1
    Last Post: 14th September 2009, 12:30
  4. Mapping Question
    By rogerholmes in forum Qt Programming
    Replies: 0
    Last Post: 26th April 2009, 00:29
  5. mapping manager
    By sreedhar in forum Qt Programming
    Replies: 6
    Last Post: 16th February 2007, 13:48

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.