summaryrefslogtreecommitdiffstats
path: root/src/testlib/qtestcase.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/testlib/qtestcase.cpp')
-rw-r--r--src/testlib/qtestcase.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index 1fc5a36d66..1c13f8edc2 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -72,6 +72,9 @@
#if defined(HAVE_XCTEST)
#include <QtTest/private/qxctestlogger_p.h>
#endif
+#if defined Q_OS_MACOS
+#include <QtTest/private/qtestutil_macos_p.h>
+#endif
#include <numeric>
#include <algorithm>
@@ -1651,6 +1654,9 @@ int QTest::qExec(QObject *testObject, int argc, char **argv)
#if defined(Q_OS_MACX)
bool macNeedsActivate = qApp && (qstrcmp(qApp->metaObject()->className(), "QApplication") == 0);
IOPMAssertionID powerID;
+
+ // Don't restore saved window state for auto tests.
+ QTestPrivate::disableWindowRestore();
#endif
#ifndef QT_NO_EXCEPTIONS
try {