[Qt-interest] Child Inherit Size of Parent

Sean Harmer sean.harmer at maps-technology.com
Mon Nov 1 09:24:20 CET 2010


Hi,

On Sunday 31 October 2010 21:29:22 velociraptor Genjix wrote:
> That won't work because when you add a layout, it resizes the content to
> fit. I mean placing the TextBox *ON TOP* of the QGraphicsView :), not
> besides it (shrinking the QGraphicsView).

Well for a start you never mentioned that you were using QGraphicsView. In 
fact you specifically said "widget". 

Secondly, you can still use a QGraphicsLayout subclass. In this case set the 
layout on a parent QGraphicsWidget rather than a QWidget.

This will *NOT* rescale your content but will only alter the size of your 
QGraphicsWidget. I do this all of the time so I know that it works.

If you can still not get this to work please post a small *compilable* example 
that shows the problem and we can help to modify it to make it work.

Cheers,

Sean



More information about the Qt-interest-old mailing list