Solved How to make the menuBar and toolBar on one line like VMWare....?
-
Just like the above pic, how I can make the same result in Qt?
-
Menu bar is a widget like any other so you can just add it to the toolbar:
QMenuBar* menuBar = new QMenuBar(); QToolBar* toolBar = new QToolBar(); toolBar->addWidget(menuBar);
Another way is to put them together in a horizontal layout:
QWidget* wrapper = new QWidget(); wrapper->setLayout(new QHBoxLayout()); wrapper->layout()->setContentsMargins(0,0,0,0); wrapper->layout()->addWidget(menubar); wrapper->layout()->addWidget(toolbar); yourMainWidget->layout()->setMenuBar(wrapper);
-
@Chris-Kawa Get it! Thanks a lot.