PDA

View Full Version : DockWidget functionality



rexxster
21st July 2011, 02:04
Hello. I have a mainwindow, I want 3 dockwidget (dw1 dw2 & dw3)
I want dw3 to span entire bottom and dw1 & dw2 to split remainder of
window horizontally, what Dockarea do I set for dw1 & dw2? I dont use
any of the space for central widget. If dw1 is undocked, dw2 should fill
all space above dw3, and if dw2 is undocked, dw1 should remain same
size and uncovered centralwidget space should remain empty of other
widgets.

addDockWidget(Qt::BottomDockWidgetArea,dw3);
addDockWidget(Qt::???, dw1);
addDockWidget(Qt::???, dw2);;

AlexSudnik
21st July 2011, 09:29
I guess you've got to greate a top-level QMainWindow and a custom QWidget containing couple of QMainWindows . Once you have it , add your dockWidgets for each : with Qt::LeftDockWidgetArea and Qt::RightDockWidgetArea options for the one , and Qt::BottomDockWidgetArea for the other . Don't forget to place these mainWindows in the layout. Once you have this widget , set it as a central in the top-level QMainWindow.


main( ... )
{
..

QMainWindow mainWindow ;// main application window

CustomCentralWidget centralWindow ;// window containing all of the dockWidgets

mainWindow.setCentralWidget(centralWindow );

...
}