Results 1 to 3 of 3

Thread: Question about animation

  1. #1
    Join Date
    Nov 2007
    Location
    Italy
    Posts
    691
    Thanks
    59
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Question about animation

    Hi to all,
    I'm reading the Animation Framework and I would try it in my application.
    I would animate the position of a little dialog that I show pressing a button.

    This is the code I tried:

    Qt Code:
    1. // executed on the released() signal of a button
    2. void WaveWidget::onShowInfoPanel()
    3. {
    4. if( !m_panel->isVisible() )
    5. {
    6. m_panel->setVisible(true);
    7. QPropertyAnimation animation(m_panel, "geometry");
    8. animation.setDuration(2000);
    9. animation.setStartValue(QRect(0, 0, 135, 240));//just an example
    10. animation.setEndValue(QRect(250, 250, 135, 240));//just an example
    11. animation.start();
    12. }
    13. else
    14. m_panel->setVisible(false);
    15. }
    To copy to clipboard, switch view to plain text mode 

    So I would give to the panel an animated effect but nothing happens when I show the panel. When I press the button the panes is shown without any special effect.

    Is my code incorrect?
    Regards
    Franco Amato

  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: Question about animation

    Yes, out of scope again.
    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.


  3. #3
    Join Date
    Nov 2007
    Location
    Italy
    Posts
    691
    Thanks
    59
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Question about animation

    Quote Originally Posted by wysota View Post
    Yes, out of scope again.
    Solved.
    Very amazing the effect
    Franco Amato

Similar Threads

  1. A question about animation...
    By lar0che in forum Newbie
    Replies: 4
    Last Post: 8th August 2010, 06:22
  2. Replies: 2
    Last Post: 1st April 2010, 10:43
  3. Animation in Qt
    By A.H.M. Mahfuzur Rahman in forum Qt Programming
    Replies: 3
    Last Post: 25th June 2009, 08:05
  4. Animation and QGraphics
    By PrimeCP in forum Qt Programming
    Replies: 2
    Last Post: 7th May 2009, 01:31
  5. Animation in Qt
    By yogesh884 in forum Qt Programming
    Replies: 3
    Last Post: 29th January 2009, 10:56

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.