PDA

View Full Version : the default width of QDockWidget



weixj2003ld
9th September 2011, 02:48
In QMainWindow,I create three QDockWidget,and add them with the following code:


addDockWidget(Qt::LeftDockWidgetArea, treeDock);
addDockWidget(Qt::RightDockWidgetArea, viewDock1);
addDockWidget(Qt::RightDockWidgetArea, viewDock2);

Now I have two questions:
1. how to set the default size of treeDock? for its default size is half of the mainwindow,and it is too wide.
2.viewDock1 and viewDock2 aligned vertically? how to let them align horizonally?

Thanks.

weixj2003ld
10th September 2011, 16:18
any one help me?

ChrisW67
11th September 2011, 10:31
1. From the QDockWidget docs:


Custom size hints, minimum and maximum sizes and size policies should be implemented in the child widget. QDockWidget will respect them, adjusting its own constraints to include the frame and title.

If your dock widget content has a layout then the size constraint set on the layout will dictate some or all of these values.

2. See dockNestingEnabled