tst_QApplication: Make sure the native style is being used
authorGabriel de Dietrich <gabriel.dietrich-de@nokia.com>
Wed, 10 Oct 2012 10:46:37 +0000 (12:46 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Wed, 10 Oct 2012 11:03:00 +0000 (13:03 +0200)
The tst_QApplication::args() auto-test sets the style to windows style
but there is no way to reset the style back to the native one. This
makes tst_QApplication::focusChanged() fail on Mac in some cases,
since not all the styles respond the same way to tab vs. strong
focus changes.

Change-Id: I91e39c1dd0fad4d90f3a13ab50a5e9758922ac28
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp

index 2250fe3..2a3a3a1 100644 (file)
@@ -516,6 +516,8 @@ void tst_QApplication::args()
     QCOMPARE( argv_out, args_out );
 
     delete [] argv;
+    // Make sure we switch back to native style.
+    QApplicationPrivate::styleOverride = QString();
 }
 
 void tst_QApplication::appName()