diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-04-27 15:29:08 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-05-02 13:05:55 +0000 |
commit | 3e4b7223f102c40372bd11c50ecc684597f4bf32 (patch) | |
tree | eaa5625922f2b6d775b5840c24e5c346109f40a9 /examples/widgets/mainwindows/mainwindow | |
parent | 01c12a5c1a7524b76f68f28f65e8195799a4841a (diff) |
Examples: Fix unused variable warnings by Clang
mainwindow.cpp(59,11): warning: unused variable 'ROWS' [-Wunused-const-variable]
const int ROWS = 2;
mainwindow.cpp(60,11): warning: unused variable 'COLUMNS' [-Wunused-const-variable]
const int COLUMNS = 3;
mainwindow.cpp(76,19): warning: unused variable 'message' [-Wunused-const-variable]
Task-number: QTBUG-60635
Change-Id: I97c31462ffa826da9baa32c33c0ff0140bf46dfc
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'examples/widgets/mainwindows/mainwindow')
-rw-r--r-- | examples/widgets/mainwindows/mainwindow/mainwindow.cpp | 12 | ||||
-rw-r--r-- | examples/widgets/mainwindows/mainwindow/mainwindow.h | 2 |
2 files changed, 14 insertions, 0 deletions
diff --git a/examples/widgets/mainwindows/mainwindow/mainwindow.cpp b/examples/widgets/mainwindows/mainwindow/mainwindow.cpp index b2c5ccc473..fe31207326 100644 --- a/examples/widgets/mainwindows/mainwindow/mainwindow.cpp +++ b/examples/widgets/mainwindows/mainwindow/mainwindow.cpp @@ -187,6 +187,13 @@ void MainWindow::setupMenuBar() #endif dockWidgetMenu = menuBar()->addMenu(tr("&Dock Widgets")); + + QMenu *aboutMenu = menuBar()->addMenu(tr("About")); + QAction *aboutAct = aboutMenu->addAction(tr("&About"), this, &MainWindow::about); + aboutAct->setStatusTip(tr("Show the application's About box")); + + QAction *aboutQtAct = aboutMenu->addAction(tr("About &Qt"), qApp, &QApplication::aboutQt); + aboutQtAct->setStatusTip(tr("Show the Qt library's About box")); } void MainWindow::setDockOptions() @@ -476,3 +483,8 @@ void MainWindow::destroyDockWidget(QAction *action) if (destroyDockWidgetMenu->isEmpty()) destroyDockWidgetMenu->setEnabled(false); } + +void MainWindow::about() +{ + QMessageBox::about(this, tr("About MainWindows"), message); +} diff --git a/examples/widgets/mainwindows/mainwindow/mainwindow.h b/examples/widgets/mainwindows/mainwindow/mainwindow.h index 9b1af6df80..a2c9d30ded 100644 --- a/examples/widgets/mainwindows/mainwindow/mainwindow.h +++ b/examples/widgets/mainwindows/mainwindow/mainwindow.h @@ -77,6 +77,8 @@ public slots: void createDockWidget(); void destroyDockWidget(QAction *action); + void about(); + private: void setupToolBar(); void setupMenuBar(); |