From 86886566410cf7cc4587b3fbb851b3615067cca4 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Fri, 22 Aug 2014 16:45:59 +0200 Subject: 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 --- examples/opengl/qopenglwidget/mainwindow.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'examples') diff --git a/examples/opengl/qopenglwidget/mainwindow.cpp b/examples/opengl/qopenglwidget/mainwindow.cpp index 152ce8601b..7645c75d8c 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); -- cgit v1.2.3