summaryrefslogtreecommitdiffstats
path: root/examples/widgets/mainwindows/mainwindow
diff options
context:
space:
mode:
Diffstat (limited to 'examples/widgets/mainwindows/mainwindow')
-rw-r--r--examples/widgets/mainwindows/mainwindow/mainwindow.cpp12
-rw-r--r--examples/widgets/mainwindows/mainwindow/mainwindow.h2
2 files changed, 14 insertions, 0 deletions
diff --git a/examples/widgets/mainwindows/mainwindow/mainwindow.cpp b/examples/widgets/mainwindows/mainwindow/mainwindow.cpp
index 931bee2d31..4ba180f312 100644
--- a/examples/widgets/mainwindows/mainwindow/mainwindow.cpp
+++ b/examples/widgets/mainwindows/mainwindow/mainwindow.cpp
@@ -188,6 +188,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()
@@ -477,3 +484,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();