PDA

View Full Version : multiple toolbars overlap



bittuthegr8
1st October 2010, 10:40
i want to make an interface with two toolbars
the first is not movable but the second is
the problem is that when i set the size policy the first toolbar is covered by the second

this is the code i am using



player_toolbar = addToolBar(tr("Player"));
player_toolbar->setMovable(false);
player_toolbar->addWidget(new Spacer());
player_toolbar->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed);

main_toolbar = addToolBar(tr("Main"));
main_toolbar->setMovable(false);


spacer is just a widget with setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Minimum);

each toolbar should get its own horizontal space

bittuthegr8
2nd October 2010, 07:58
never mind. i read through the documentation and found
QMainWindow::addToolBarBreak ( Qt::ToolBarArea area = Qt::TopToolBarArea );
http://doc.trolltech.com/4.7/qmainwindow.html#addToolBarBreak