View Full Version : Question on QGraphicsProxyWidget and boundingRect

12th June 2010, 13:43

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?


14th June 2010, 13:29
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.