PDA

View Full Version : QMainWindow with fixed area + Dockarea



trallallero
16th March 2012, 09:49
I have to create a GUI that handles QDockWidgets but only in a part of the Mainwindow.

As in the attached picture, there should be a fixed part on the left and a dock area on the right.
Like qtcreator GUI, as an example, that has a fixed toolbar on the left and other panels on the right.

How can I do that ?

Added after 39 minutes:

Ok, somehow I've solved but if someone has other ideas...

I've created a toolbar fixed on the left side of the mainwindow.
Then I've added a fixed size QDockWidget to the toolbar:
ui->toolBar->addWidget(m_FrameContainerGUI);

That's it, it was easy at the end.

mentalmushroom
16th March 2012, 10:16
take a look at void setAllowedAreas(Qt::DockWidgetAreas areas)

trallallero
16th March 2012, 10:25
Yes I know but if I do this:


m_FrameContainerGUI->setAllowedAreas(Qt::LeftDockWidgetArea);
m_FrameCreatorGUI->setAllowedAreas(Qt::LeftDockWidgetArea);

addDockWidget(Qt::LeftDockWidgetArea , m_FrameContainerGUI);
addDockWidget(Qt::LeftDockWidgetArea , m_FrameCreatorGUI);

the widgets are on the left side but vertically aligned (one over the other).
What I want to do is to put the first one on the left side and the second one on the left side but next to the first, not over (or under).