Results 1 to 10 of 10

Thread: rotation of an animated QGraphicsItem

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Norway
    Posts
    124
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows
    Thanked 38 Times in 30 Posts

    Default Re: rotation of an animated QGraphicsItem

    That depends on the item - sometimes it's easier to replace one line than to rewrite all your coordinates ;-).
    Bitto / Andreas Aardal Hanssen - andreas dot aardal dot hanssen at nokia
    Nokia Software Manager, Qt Development

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    258
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android
    Thanks
    22
    Thanked 19 Times in 16 Posts

    Default Re: rotation of an animated QGraphicsItem

    what about QGraphicsSvgItem. It already implements boundingRect() which returns 0,0 as Point of origin for one Item I'm testing here. Can I also handle that doing a transformation? Redefining boundingRect seemingly isn't an option here ...

    Thanx in advance

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: rotation of an animated QGraphicsItem

    Quote Originally Posted by Bitto View Post
    That depends on the item - sometimes it's easier to replace one line than to rewrite all your coordinates ;-).
    You can always do the translation in the item's paint routine. Also a single line

  4. #4
    Join Date
    Jan 2006
    Location
    Norway
    Posts
    124
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows
    Thanked 38 Times in 30 Posts

    Default Re: rotation of an animated QGraphicsItem

    momesana, you can just use the translate-rotate-translate trick from above, it works for any item and you don't have to modify it / subclass it / change its bounding rect or painting.

    wysota, you'd have to translate the bounding rect, the shape, and the painter inside the paint() function. otherwise you'd get painting and collision artifacts.
    Bitto / Andreas Aardal Hanssen - andreas dot aardal dot hanssen at nokia
    Nokia Software Manager, Qt Development

  5. The following user says thank you to Bitto for this useful post:

    momesana (10th September 2007)

Similar Threads

  1. destruction of QGraphicsItem
    By killkolor in forum Qt Programming
    Replies: 2
    Last Post: 5th December 2009, 11:31

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.