Skip to content

Commit 2a9473c

Browse files
Fabien-BFabien-B
authored andcommitted
Insert map men u before Help menu
1 parent c679943 commit 2a9473c

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/widgets/map/mapwidget.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,13 @@ MapWidget::MapWidget(QWidget *parent) : Map2D(parent),
345345

346346
// Add menu to app menu bar.
347347
connect(pprzApp()->mainWindow(), &PprzMain::ready, this, [=](){
348-
pprzApp()->mainWindow()->menuBar()->addMenu(mapMenu);
348+
auto actions = pprzApp()->mainWindow()->menuBar()->actions();
349+
int index = actions.size()-1;
350+
if(index < 0) {
351+
pprzApp()->mainWindow()->menuBar()->addMenu(mapMenu);
352+
} else {
353+
pprzApp()->mainWindow()->menuBar()->insertMenu(actions[index], mapMenu);
354+
}
349355
});
350356
}
351357

0 commit comments

Comments
 (0)