2
votes

I have a QMainWindow with a QGridLayout on it, where the first row is toolbars (across all columns) and the second row has a text display area on the left (first column) and a QGLWidget on the right (second column). [Additional note...not sure if relevant: To get everything lined up the way I wanted, I had to use setMinimumSize on most of these.]

Anyway, when I maximize or otherwise try to make the main window larger, the QGLWidget becomes a tiny bit wider but does NOT grow vertically. How can I force it to grow with the window as it should? Is this probably linked to the widget itself, or the grid layout?

1
There isn't enough information to answer your question; it could be either the widget or the layout. Check that the GL widget's vertical size policy allows it to expand. Also check that the layout doesn't have excessive spacing or margins, that the tool bar doesn't have an excessively large minimum size or an expanding size policy, and that the row stretch and minimum row size properties on the layout are reasonable.RA.

1 Answers

2
votes

I've been searching trying to find out what the deal is with the QGLWidget and the resize policies. It doesn't seem to behave properly compared to other widgets. You can get it closer by implementing QSize minimumSizeHint() const; and QSize sizeHint() const; in your QGLWidget using class, and also do QWidget::setSizePolicy on it. As far as getting it to behave the same as other widgets, I'd really like to find an answer..