Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How to fix the treeview on left hand side of main window.
Indrajeet last edited by
I have created a mainwindow.
In this main window i want to fit treeview so i created my own custom treeview.
Now by using QDockWidget i fitted that treeview on left side of mainwindow.
QDockWidget *dock = new QDockWidget(tr(""), this);
view = new QTreeView(dock);
Above code is working fine but when i maximise my mainwindow treeview is covering the complete central space of mainwindow.
I want treeview to remain same on left hand side.
How to fix this?
Blizzard last edited by
bq. Each widget returns a QSizePolicy that describes the horizontal and vertical resizing policy it prefers when being laid out. You can change this for a specific widget by changing its "QWidget::sizePolicy":http://qt-project.org/doc/qt-4.8/qwidget.html#sizePolicy-prop property. QSizePolicy contains two independent "QSizePolicy::Policy":http://qt-project.org/doc/qt-4.8/qsizepolicy.html#Policy-enum values and two stretch factors; one describes the widgets's horizontal size policy, and the other describes its vertical size policy. It also contains a flag to indicate whether the height and width of its preferred size are related.