summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorJake Petroules <jake.petroules@petroules.com>2013-01-05 01:19:11 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-01-15 21:26:46 (GMT)
commitb744d9317153772d431e83aa306cea0faa0dc520 (patch)
treee05fadec65178038c3eb2fca79229a3c9e67926c /tests/auto
parentfbd769dea957d4ba548293d3b9db94350aafd77f (diff)
downloadQt-b744d9317153772d431e83aa306cea0faa0dc520.zip
Qt-b744d9317153772d431e83aa306cea0faa0dc520.tar.gz
Qt-b744d9317153772d431e83aa306cea0faa0dc520.tar.bz2
Use a UUID for the NSToolbar in unified title and toolbar.
When two NSToolbars in an application share the same identifier, Cocoa tries to synchronize their state (item position, view mode, etc.), and this behvavior interferes with and crashes Qt applications in certain cases when toggling the unified toolbar on and off. Therefore it is necessary to use a unique identifier for each native toolbar created. Does not affect Qt 5. This functionality has been removed and an equivalent will be provided by QtMacExtras which uses a completely different approach, though I7d5c8d58e45a504480a1ce67065add15cb35ad8f could be considered Qt 5's rough equivalent to this. Task-number: QTBUG-19207 Change-Id: I9030d56941d12a2c1f7a328337bf986f1b51eeb8 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qmainwindow/tst_qmainwindow.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/auto/qmainwindow/tst_qmainwindow.cpp b/tests/auto/qmainwindow/tst_qmainwindow.cpp
index 5e930a9..5943d0d 100644
--- a/tests/auto/qmainwindow/tst_qmainwindow.cpp
+++ b/tests/auto/qmainwindow/tst_qmainwindow.cpp
@@ -154,6 +154,7 @@ private slots:
void dockWidgetSize();
void QTBUG2774_stylechange();
void toggleUnifiedTitleAndToolBarOnMac();
+ void QTBUG19207_toggleUnifiedTitleAndToolBarOnMacMultipleWindows();
void QTBUG21378_animationFinished();
};
@@ -1857,6 +1858,32 @@ void tst_QMainWindow::toggleUnifiedTitleAndToolBarOnMac()
#endif
}
+void tst_QMainWindow::QTBUG19207_toggleUnifiedTitleAndToolBarOnMacMultipleWindows()
+{
+#ifdef Q_OS_MAC
+ QMainWindow mw;
+ QToolBar *tb = new QToolBar;
+ tb->addAction("Test");
+ mw.addToolBar(tb);
+ mw.setUnifiedTitleAndToolBarOnMac(true);
+ mw.show();
+
+ QMainWindow mw2;
+ QToolBar *tb2 = new QToolBar;
+ tb2->addAction("Test");
+ mw2.addToolBar(tb2);
+ mw2.setUnifiedTitleAndToolBarOnMac(true);
+ mw2.show();
+
+ // the third call should trigger an assertion failure in -[NSToolbar _itemAtIndex:]
+ mw.setUnifiedTitleAndToolBarOnMac(false);
+ mw.setUnifiedTitleAndToolBarOnMac(true);
+ mw.setUnifiedTitleAndToolBarOnMac(false);
+#else
+ QSKIP("Mac specific test", SkipAll);
+#endif
+}
+
void tst_QMainWindow::QTBUG21378_animationFinished()
{
QMainWindow w;