I have a QTreeView
widget placed inside a QDockWidget
:
I want to set the properties of the QTreeView
, that it automatically fills the whole available client drawing area (similar as WinForms DockFill property).
How can this be achieved with the QT-Designer?
Note: I've been playing around with the QTreeView
s sizePolicy properties. If these are set to Expanding (as is the default) the accepted answer works out out of the box.
In Qt Designer, right-click the dock-widget, and then select Lay out -> Lay Out Vertically from the menu. Or you can just click on the dock-widget to select it, and then use the equivalent layout toolbar buttons.
If you want to maximise the space taken up by the tree-view, select the first child widget of the dock widget (it will probably be shown as dockWidgetContents in the Object Inspector pane). Then scroll down to the bottom of the Property Editor, and reset all the margins to zero.