summaryrefslogtreecommitdiffstats
path: root/tests/auto/qmainwindow
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qmainwindow')
-rw-r--r--tests/auto/qmainwindow/tst_qmainwindow.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/qmainwindow/tst_qmainwindow.cpp b/tests/auto/qmainwindow/tst_qmainwindow.cpp
index 5a69d9c..e427863 100644
--- a/tests/auto/qmainwindow/tst_qmainwindow.cpp
+++ b/tests/auto/qmainwindow/tst_qmainwindow.cpp
@@ -109,6 +109,7 @@ private slots:
void centralWidgetSize();
void dockWidgetSize();
void QTBUG2774_stylechange();
+ void toggleUnifiedTitleAndToolBarOnMac();
};
// Testing get/set functions
@@ -1747,6 +1748,24 @@ void tst_QMainWindow::QTBUG2774_stylechange()
}
}
+void tst_QMainWindow::toggleUnifiedTitleAndToolBarOnMac()
+{
+#ifdef Q_OS_MAC
+ QMainWindow mw;
+ QToolBar *tb = new QToolBar;
+ tb->addAction("Test");
+ mw.addToolBar(tb);
+ mw.setUnifiedTitleAndToolBarOnMac(true);
+ mw.show();
+ QRect frameGeometry = mw.frameGeometry();
+ mw.setUnifiedTitleAndToolBarOnMac(false);
+ QVERIFY(frameGeometry.topLeft() == mw.frameGeometry().topLeft());
+ mw.setUnifiedTitleAndToolBarOnMac(true);
+ QVERIFY(frameGeometry.topLeft() == mw.frameGeometry().topLeft());
+#else
+ QSKIP("Mac specific test", SkipAll);
+#endif
+}
QTEST_MAIN(tst_QMainWindow)