Results 1 to 3 of 3

Thread: animate items

  1. #1
    Join Date
    Oct 2009
    Location
    China
    Posts
    20
    Thanks
    15
    Qt products
    Qt4
    Platforms
    Windows

    Question animate items

    hello,
    there some items,but i want to animate the item, such as zooming the item with a timeline.because there is only item, no Object,I am at a loss what to do.
    I want to use QGraphicsItemAnimation ,but how to use it to enlarge one item with timeline.
    Thanks!
    Last edited by ensky_cy; 4th December 2009 at 01:47.

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: animate items

    Have a look at embedded dialog example in Qt demos.. under Demonstrations..
    I guess they also use a timeline..

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

    ensky_cy (4th December 2009)

  4. #3
    Join Date
    Oct 2009
    Location
    China
    Posts
    20
    Thanks
    15
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: animate items

    thanks.I use QGraphicsItemAnimate.
    however.
    Qt Code:
    1. for (int i = 0; i < 2000; ++i)
    2. {
    3. animation->setScaleAt(i/2000,1+4*(i/2000),1+4*(i/2000));
    4. }
    5. I cann't see the gradual change,although, timer = new QTimeLine(2000);
    6. timer->setFrameRange(0, 300);
    To copy to clipboard, switch view to plain text mode 
    "setScaleAt(i/2000,1+4*(i/2000),1+4*(i/2000))",this don't understand.

    (sorry,i don't know how to insert code)
    Last edited by wysota; 4th December 2009 at 09:24. Reason: missing [code] tags

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.