can someone explain why this statement does nothing?
ui.menuBar->setCornerWidget(ui.menuHelp, Qt::TopRightCorner);
menuBar
is a QMenuBar
and menuHelp
is QMenu
I still get all my QMenu's clustered on the Left Side of the window
can someone explain why this statement does nothing?
ui.menuBar->setCornerWidget(ui.menuHelp, Qt::TopRightCorner);
menuBar
is a QMenuBar
and menuHelp
is QMenu
I still get all my QMenu's clustered on the Left Side of the window
To add a menu to the right side of menu bar, you should add a new QMenuBar
containing the desired menu as the right corner widget using setCornerWidget
:
QMenuBar *bar = new QMenuBar(ui->menuBar);
QMenu *menuHelp = new QMenu("Help", bar);
bar->addMenu(menuHelp);
ui->menuBar->setCornerWidget(bar);