[Qt-interest] Resizing a window
Andre Somers
andre at familiesomers.nl
Wed Feb 10 10:54:40 CET 2010
Chris Bruner wrote:
> I'm trying to do something that I'm sure is simple but somehow escapes
> me. I've got a QGraphicsView inside a QFrame inside a QGridLayout inside
> a QVBoxLayout inside a QWidget inside a QMainWindow.
> I want to resize the window and have the QGraphicsView follow along.
> Instead what I see is the window resizing and the view staying the same
> and getting covered up.
>
> It looks to me like the widgets will resize themselves when the layout
> changes size,
> but I still can't get the layout/widget to change size as the window
> changes size. All that happens is the window cuts off the widget. What
> am I missing?
>
>
You are missing a QLayout managing the dimensions of your QGraphicsView
inside your QFrame, I think. Every widget that contains other widgets
should manage the layout of those other widgets in some way. Normally,
you'd use a QLayout derived class for that, but if you want, you can do
it manually too, of course.
André
More information about the Qt-interest-old
mailing list