Results 1 to 9 of 9

Thread: how to do rectItem growing animation from origin?

  1. #1
    Join Date
    May 2010
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    1

    Smile how to do rectItem growing animation from origin?

    hi,
    i created QGraphicsRectItem. i want the animation as this item should be gradually increase in size from its origin.
    i used the following api. but the item as well as moving from the origin.
    animation->setScaleAt(a,b,c);

    do you hav any solution by using only the QGraphics API's.?

    -ram

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Wiki edits
    5

    Default Re: how to do rectItem growing animation from origin?


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

    ramfacts (5th May 2010)

  4. #3
    Join Date
    May 2010
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    1

    Default Re: how to do rectItem growing animation from origin?

    Hi,
    thank you for the reply.
    but i want to grow the size of an item from origin to (x,y) without motion of item.

  5. #4
    Join Date
    May 2010
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    1

    Default Re: how to do rectItem growing animation from origin?

    HI Lykurg,
    I got that by QGraphicsItem::setTransformOriginPoint().
    thanks.
    ram

  6. #5
    Join Date
    Nov 2010
    Posts
    29
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: how to do rectItem growing animation from origin?

    i have got the same issue.
    i used function which you specified in the following way but it gives me no result.

    selectionItem->QGraphicsItem::setTransformOriginPoint (1000.0, 1000.0);

    could you please help me with this issue.

    thanks

  7. #6
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Wiki edits
    5

    Default Re: how to do rectItem growing animation from origin?

    What result do you expect and what do you get? And what is the size of selectionItem?

  8. #7
    Join Date
    Nov 2010
    Posts
    29
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: how to do rectItem growing animation from origin?

    expected result is to have zoomin effect i.e, selected item should grow from origin to (x,y) which in my case(100,100).

    result of this does not give zoomin effect. i.e, selected item does not grow in size.

    size of my selected item is this:

    RectItem *selectionItem = new RectItem(QRectF(-225, -225, 450, 450),Qt::white, pad);

    selectionItem->setTransformOriginPoint (100.0, 100.0);

    this is what i have done.

    expecting your review.
    Last edited by rashmi; 12th November 2010 at 12:22. Reason: updated contents

  9. #8
    Join Date
    Nov 2010
    Posts
    29
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: how to do rectItem growing animation from origin?

    hello all,

    RectItem *rect = new RectItem(iconRect, iconColor, this);
    rect->setTransformOriginPoint(50,50);

    this is wat im trying to do i order to grow animation for origin to x,y in my case 50,50 but i dont get expected output. could some one help me.

    qt-4.7
    target window is directfb

  10. #9
    Join Date
    Nov 2010
    Posts
    57
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default Re: how to do rectItem growing animation from origin?

    Quote Originally Posted by rashmi View Post
    expected result is to have zoomin effect i.e, selected item should grow from origin to (x,y) which in my case(100,100).

    result of this does not give zoomin effect. i.e, selected item does not grow in size.
    I'm no expert, but from what I gather transform should move you object from one point to another.
    setScale should allow your object to grow.

    If you look at QGraphicsItem::setScale ( qreal factor ) you will see that it says there that it will scale at 0,0 but if you want it to scale at another point you need to use setTransformOriginPoint()

Similar Threads

  1. View,Scene and RectItem
    By salmanmanekia in forum Newbie
    Replies: 2
    Last Post: 29th March 2010, 14:31
  2. Growing the contents of a scroll area.
    By spraff in forum Qt Programming
    Replies: 1
    Last Post: 2nd July 2009, 15:20
  3. Replies: 2
    Last Post: 24th January 2009, 08:11
  4. Rotating a rectangle about its origin
    By babu198649 in forum Newbie
    Replies: 5
    Last Post: 25th October 2008, 12:24
  5. problem with opengl, zooming, drawpixels, and origin
    By ntp in forum General Programming
    Replies: 0
    Last Post: 22nd February 2008, 21: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
  •  
Qt is a trademark of The Qt Company.