PDA

View Full Version : resize tableview when resizing mainwindow



AlstomATS
11th September 2013, 15:30
I am new to gui development (long time embedded programmer) and am not experienced in the correct way to create a window. I have a summary window that has a central widget that contains a table view.
The columns of the QTableView resize to their contents and I have the size of the tableview such that it sizes to the initial width of the columns. If I update a row that makes the columns wider, the tableview expands to fit the columns but I get a scroll bar at the bottom. If I drag the corner of the main window I expected the tableview to expand thus eliminating the scroll bar but this does not happen. Is there an attribute or association I'm missing that prevents this kind of behavior? .
An alternative (and one which would be ideal) would be to automatically resize the entire main window and tableview to match whatever width the columns attain.

anda_skoa
12th September 2013, 09:43
Sounds like your central widget is missing a layout.

Check that you have a layout on your central widget, that all children have been added to that layout, and if you have any container widgets with grand children, then check that they have layouts as well.

Cheers,
_