diff options
author | Laszlo Agocs <[email protected]> | 2014-08-22 16:45:59 +0200 |
---|---|---|
committer | Laszlo Agocs <[email protected]> | 2014-08-25 17:40:18 +0200 |
commit | 86886566410cf7cc4587b3fbb851b3615067cca4 (patch) | |
tree | 9113c8bc6aadf40bc88d0822a4549455eee8e100 /examples/opengl/qopenglwidget/mainwindow.cpp | |
parent | 0ce707d1d5ac420d9f2639ab82d0ccf9bca02f98 (diff) |
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 <[email protected]>
Diffstat (limited to 'examples/opengl/qopenglwidget/mainwindow.cpp')
-rw-r--r-- | examples/opengl/qopenglwidget/mainwindow.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/examples/opengl/qopenglwidget/mainwindow.cpp b/examples/opengl/qopenglwidget/mainwindow.cpp index 152ce8601be..7645c75d8cd 100644 --- a/examples/opengl/qopenglwidget/mainwindow.cpp +++ b/examples/opengl/qopenglwidget/mainwindow.cpp @@ -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); |