Use QMenuBar::addMenu in the qopenglwidget example

Like in all other places. This way the resulting QMenu is correctly
parented so it will show up at the proper position even on platforms
which do not have a way to position top-level windows.

Task-number: QTBUG-29025
Change-Id: I2aa6fe73699379029c44a3f379366a2133753190
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
This commit is contained in:
Laszlo Agocs 2014-08-22 16:45:59 +02:00
parent 0ce707d1d5
commit 8688656641

View File

@ -95,12 +95,9 @@ MainWindow::MainWindow()
groupBox->setLayout(m_layout);
QMenu *fileMenu = new QMenu("&File");
QMenu *helpMenu = new QMenu("&Help");
QMenu *showMenu = new QMenu("&Show");
menuBar()->addMenu(fileMenu);
menuBar()->addMenu(showMenu);
menuBar()->addMenu(helpMenu);
QMenu *fileMenu = menuBar()->addMenu("&File");
QMenu *showMenu = menuBar()->addMenu("&Show");
QMenu *helpMenu = menuBar()->addMenu("&Help");
QAction *exit = new QAction("E&xit", fileMenu);
QAction *aboutQt = new QAction("About Qt", helpMenu);
QAction *showLogo = new QAction("Show 3D Logo", showMenu);