Results 1 to 2 of 2

Thread: QPropertyAnimation dynamic end value is this possible?

  1. #1
    Join Date
    Jan 2011
    Posts
    6
    Thanks
    3
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60

    Default QPropertyAnimation dynamic end value is this possible?

    Hi

    I am trying to create a transition annimation between two custom widgets.

    I want the current widget to annimate out of the screen and be replaced by the incomming widget.

    what I don't understand is how I can create the end pos of my transition to be the current screen width, if I switch between landscape and portrait this value will change.

    currently in my QPropertyAnimation I have the end value hard coded, what i want to be able to do is set this to be the current screen width.

    Qt Code:
    1. AnimateOut->setStartValue(QPoint(0,0));
    2. AnimateOut->setEndValue(QPoint(360,0)); // really this end value should be the screen width
    To copy to clipboard, switch view to plain text mode 

    is it possible do this dynamically or is there another way to do this?

    thanks in advance

    Guus Davidson

  2. #2
    Join Date
    Feb 2007
    Location
    Karlsruhe, Germany
    Posts
    469
    Thanks
    17
    Thanked 90 Times in 88 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QPropertyAnimation dynamic end value is this possible?

    Hi!

    Is your question how to query the current screen width and pass it to setEndValue once or do you want to cover the case that the user turns the screen while your animation is running?

    If the former, have a look at QDesktopWidget. If the later you could restart your animation in QDesktopWidget's resize event.

    http://www.qtcentre.org/threads/3018...351#post141351

    HIH

    Joh

  3. The following user says thank you to JohannesMunk for this useful post:

    GuusDavidson (14th March 2011)

Similar Threads

  1. QPropertyAnimation and animation speed
    By themk in forum Qt Programming
    Replies: 0
    Last Post: 13th October 2010, 00:05
  2. QPropertyAnimation and QStackedLayout:functionality.
    By savaliya_ambani in forum Qt for Embedded and Mobile
    Replies: 11
    Last Post: 24th September 2010, 08:33
  3. Using QPropertyAnimation with QGraphicsPixmapItem
    By Luc4 in forum Qt Programming
    Replies: 8
    Last Post: 29th March 2010, 09:47
  4. Replies: 1
    Last Post: 8th January 2010, 12:21
  5. Replies: 2
    Last Post: 11th November 2009, 08:03

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.