Results 1 to 4 of 4

Thread: Rotating a QGraphicsProxyWidget

  1. #1
    Join Date
    Jan 2010
    Posts
    190
    Thanks
    18
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Rotating a QGraphicsProxyWidget

    Hi! I subclassed QGraphicsProxyWidget to create an item where I put a label. I need to resize this item and to rotate it. I can rotate and resize it correctly. But... how do I write the boundingRect() method so that I get the correct rect after resize and rotate? I really can't make the method return the correct rect after rotation...
    Thanks!

  2. #2
    Join Date
    Jan 2010
    Posts
    190
    Thanks
    18
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Rotating a QGraphicsProxyWidget

    In case anyone else need this, I found out it was necessary to use sceneBoundingRect(), which returns exactly what I wanted, i.e. the boundingRect after applying the transformations set for the item.

  3. #3
    Join Date
    Mar 2010
    Location
    Heredia, Costa Rica
    Posts
    257
    Thanks
    24
    Thanked 17 Times in 14 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Rotating a QGraphicsProxyWidget

    Hi,

    I'm trying to follow your advice on this but it is not clear to me how to do it.

    Can you post some bits of code?

    Many thanks,
    Carlos.

  4. #4
    Join Date
    Jan 2010
    Posts
    190
    Thanks
    18
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Rotating a QGraphicsProxyWidget

    There's no code to post as far as I can remember. You only have to override boundingRect() correctly and then you can call the method sceneBoundingRect() to get the bounding rect resulting after the transformations you applied.

Similar Threads

  1. Move QGraphicsProxyWidget
    By RThaden in forum Qt Programming
    Replies: 14
    Last Post: 17th September 2016, 14:01
  2. help positioning QGraphicsProxyWidget?
    By Scott Shiff in forum Qt Programming
    Replies: 1
    Last Post: 24th January 2010, 23:13
  3. QGraphicsItem or QGraphicsProxyWidget?
    By ttvo in forum Qt Programming
    Replies: 5
    Last Post: 30th August 2009, 23:13
  4. QGraphicsProxyWidget
    By QbelcorT in forum Qt Programming
    Replies: 0
    Last Post: 29th November 2008, 08:21
  5. problem with QGraphicsProxyWidget
    By dreamer in forum Qt Programming
    Replies: 5
    Last Post: 19th May 2008, 22:25

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.