summaryrefslogtreecommitdiffstats
path: root/examples/widgets
diff options
context:
space:
mode:
authorJake Petroules <jake.petroules@petroules.com>2014-05-08 00:51:49 -0400
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-05-21 21:07:58 +0200
commitf2891be00808c82f5069661d60d8727fe28774b7 (patch)
treeff5e9f626f36e1f9127978bd8e823d86889bb320 /examples/widgets
parenta97f96ca8e55efcf5e608fd1a77d1535422cb3f1 (diff)
Add a menu item to mainwindow example to toggle unified toolbars.
Change-Id: Id7d7433849565b1acfc690cf5e23e8105c6af993 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Diffstat (limited to 'examples/widgets')
-rw-r--r--examples/widgets/mainwindows/mainwindow/mainwindow.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/examples/widgets/mainwindows/mainwindow/mainwindow.cpp b/examples/widgets/mainwindows/mainwindow/mainwindow.cpp
index a0eb063647..0a29edee74 100644
--- a/examples/widgets/mainwindows/mainwindow/mainwindow.cpp
+++ b/examples/widgets/mainwindows/mainwindow/mainwindow.cpp
@@ -168,6 +168,15 @@ void MainWindow::setupMenuBar()
for (int i = 0; i < toolBars.count(); ++i)
toolBarMenu->addMenu(toolBars.at(i)->menu);
+#ifdef Q_OS_OSX
+ toolBarMenu->addSeparator();
+
+ action = toolBarMenu->addAction(tr("Unified"));
+ action->setCheckable(true);
+ action->setChecked(unifiedTitleAndToolBarOnMac());
+ connect(action, SIGNAL(toggled(bool)), this, SLOT(setUnifiedTitleAndToolBarOnMac(bool)));
+#endif
+
dockWidgetMenu = menuBar()->addMenu(tr("&Dock Widgets"));
}