How to make the dock widget occupy as much space as the central widget

Viewed 19

When I set my QDockWidget-based widget as a central widget in main window, it occupies all the space except for the space of another QDockWidget-based widget I attached on the right (see the drawing below). But I want my widgets to behave as dock widgets (be closable, draggable, etc). How do I force one of them to occupy as much space as a central widget does? I tried

setCentralWidget(NULL);
addDockWidget(Qt::LeftDockWidgetArea, pDockWidget1);
addDockWidget(Qt::RightDockWidgetArea, pDockWidget2);

But in this case the main window space is shared 50/50, neglecting the default size properties of the second widget.

enter image description here

0 Answers
Related