From 9bc49b0bca361646aac90cd00706588d3dcd66c9 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Fri, 16 Nov 2012 17:39:24 +0100 Subject: Made QFusionStyle internal We will take this opportynity to remove various QStyle specializations from the public API in Qt5. This gives us much more freedom, for example changing the inheritance hierarchy, pluginizing etc. without worrying about BC. => Use QStyleFactory and/or QProxyStyle instead of creating an instance or inheriting QFusionStyle directly. Change-Id: I37d8acb13b6fd328a9cd53c74df971428bbbe443 Reviewed-by: Lars Knoll --- tests/auto/widgets/styles/qstyle/tst_qstyle.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'tests/auto/widgets/styles/qstyle') diff --git a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp index e2a0f095a5..bec83e949c 100644 --- a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp +++ b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp @@ -71,10 +71,6 @@ #include #include -#ifndef Q_NO_STYLE_FUSION -#include -#endif - #ifdef Q_OS_MAC #include #endif @@ -372,9 +368,10 @@ bool tst_QStyle::testScrollBarSubControls(QStyle* style) #ifndef QT_NO_STYLE_FUSION void tst_QStyle::testFusionStyle() { - QFusionStyle fstyle; - QVERIFY(testAllFunctions(&fstyle)); - lineUpLayoutTest(&fstyle); + QStyle *fstyle = QStyleFactory::create("Fusion"); + QVERIFY(testAllFunctions(fstyle)); + lineUpLayoutTest(fstyle); + delete fstyle; } #endif @@ -649,14 +646,14 @@ void tst_QStyle::progressBarChangeStyle() //where changing the styles and deleting a progressbar would crash QWindowsStyle style1; - QFusionStyle style2; + QStyle *style2 = QStyleFactory::create("Fusion"); QProgressBar *progress=new QProgressBar; progress->setStyle(&style1); progress->show(); - progress->setStyle(&style2); + progress->setStyle(style2); QTest::qWait(100); delete progress; @@ -664,6 +661,7 @@ void tst_QStyle::progressBarChangeStyle() QTest::qWait(100); //before the correction, there would be a crash here + delete style2; } #endif -- cgit v1.2.3