Hello! I have a window formatted using a QFormLayout that contains a set of field/label pairs, a QTableView, and then a set of buttons in a QHBoxLayout. When the window resizes, I would like the QTableView to expand in both directions - vertically to show more rows, as well as horizontally to show hidden columns.

I have the QTableView set to horizontalHeader()->setStretchLastSection( True ); and setSizePolicy( QSizePolicy::Expanding,QSizePolicy::Expanding ); I get the horizontal resize behavior I want, but not the vertical resize behavior.

If I use a QHBoxLayout, a QVBoxLayout or no layout, the resizing in both directions works nicely. If I have just the QTableView in a QFormLayout, it doesn't expand vertically. Do I have to switch the window's top level layout manager to a QGridLayout and then manage the row height manually, or is there something I'm missing in QFormLayout that will do the trick? Or some other approach that's better when you have a window with a lot of different widget types?

Thanks in advance for any help!