Results 1 to 2 of 2

Thread: Question on QGraphicsProxyWidget and boundingRect

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    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

    Question Question on QGraphicsProxyWidget and boundingRect

    Hi

    I'm embedding a widget into a scene with a proxy. But I have the following problem with the boundingRect.



    The black boxes in the image are added according to the bounding rectangle of the proxy item but the embedded widget is not centered inside inside the rectangle.

    How can I center the widget inside the bounding rectangle of the proxy item?

    Thanks,
    Carlos

  2. #2
    Join Date
    Jun 2010
    Posts
    31
    Thanks
    1
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Question on QGraphicsProxyWidget and boundingRect

    How exactly are you adding that proxy to the scene? Is it in the exact same manner as those black boxes, or is something different going on? There's a lot of things that could cause that kind of problem, like if you're using a layout that uses it's own padding or if you are trying to move the widget around using the wrong coordinate system. In either case, if you could provide us with a little bit of code I think it would allow us to give you more help.

Similar Threads

  1. Replies: 0
    Last Post: 6th December 2009, 04:33
  2. Why must I pad boundingRect() by 7 pixels
    By xenome in forum Qt Programming
    Replies: 3
    Last Post: 10th September 2009, 14:07
  3. boundingRect()?
    By aaron in forum Qt Programming
    Replies: 6
    Last Post: 21st April 2009, 09:43
  4. setRect vs boundingRect
    By zgulser in forum Qt Programming
    Replies: 5
    Last Post: 5th February 2009, 00:23
  5. QGraphicsItem -> boundingRect()
    By harakiri in forum Qt Programming
    Replies: 4
    Last Post: 6th March 2008, 15:02

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.