diff options
author | J-P Nurmi <jpnurmi@digia.com> | 2012-11-16 17:39:24 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-11-21 11:03:48 +0100 |
commit | 9bc49b0bca361646aac90cd00706588d3dcd66c9 (patch) | |
tree | f4de997044c6dd6d6bc0e5dc121851412aec4997 /tests/auto/widgets/styles | |
parent | f4a2352cd1efee9bbffe89e7d430b8be0cacc5bd (diff) |
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 <lars.knoll@digia.com>
Diffstat (limited to 'tests/auto/widgets/styles')
-rw-r--r-- | tests/auto/widgets/styles/qstyle/tst_qstyle.cpp | 16 | ||||
-rw-r--r-- | tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp | 3 |
2 files changed, 8 insertions, 11 deletions
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 <qmdiarea.h> #include <qscrollarea.h> -#ifndef Q_NO_STYLE_FUSION -#include <qfusionstyle.h> -#endif - #ifdef Q_OS_MAC #include <QMacStyle> #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 diff --git a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp index d5ac0c20a8..5f2c9a62b9 100644 --- a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp +++ b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp @@ -44,7 +44,6 @@ #include <QtTest/QtTest> #include <QtDebug> #include <QMetaObject> -#include <QFusionStyle> #include <private/qstylesheetstyle_p.h> @@ -1589,7 +1588,7 @@ class ChangeEventWidget : public QWidget static bool recurse = false; if (!recurse) { recurse = true; - QStyle *style = new QFusionStyle; + QStyle *style = QStyleFactory::create(QLatin1String("Fusion")); style->setParent(this); setStyle(style); recurse = false; |