diff options
author | J-P Nurmi <jpnurmi@digia.com> | 2012-11-27 00:06:14 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-03-04 14:54:57 +0100 |
commit | 14dab5b2d7cb7b6b32d9672758c0f3b5d4ec3354 (patch) | |
tree | 8206805908b2c9da0edd6619845a0019cc5d95d2 /tests/auto/widgets/styles | |
parent | 4b7276b93f21e4b131c8840ca2f6c6bf4f003595 (diff) |
Add QProxyStyle(QString key) constructor for convenience
The QStyle implementations are becoming private, so the following
slightly verbose pattern seems to be now repeated a lot:
new QProxyStyle(QStyleFactory::create("windows"))
This change adds an alternative, more convenient constructor for
this particular use case:
new QProxyStyle("windows")
Change-Id: I97ded597a0fd3225a6354ebea0abb367237430af
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Diffstat (limited to 'tests/auto/widgets/styles')
-rw-r--r-- | tests/auto/widgets/styles/qstyle/tst_qstyle.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp index cf867194cc..a3670cccc2 100644 --- a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp +++ b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp @@ -234,7 +234,10 @@ void tst_QStyle::testProxyStyle() QVERIFY(proxyStyle->baseStyle()); qApp->setStyle(proxyStyle); - QProxyStyle doubleProxy(new QProxyStyle(QStyleFactory::create("Windows"))); + QProxyStyle* baseStyle = new QProxyStyle("Windows"); + QCOMPARE(baseStyle->baseStyle()->objectName(), style->objectName()); + + QProxyStyle doubleProxy(baseStyle); QVERIFY(testAllFunctions(&doubleProxy)); CustomProxy customStyle; @@ -775,7 +778,7 @@ void tst_QStyle::testDrawingShortcuts() class FrameTestStyle : public QProxyStyle { public: - FrameTestStyle() : QProxyStyle(QStyleFactory::create("Windows")) { } + FrameTestStyle() : QProxyStyle("Windows") { } int styleHint(StyleHint hint, const QStyleOption *opt, const QWidget *widget, QStyleHintReturn *returnData) const { if (hint == QStyle::SH_ScrollView_FrameOnlyAroundContents) return 1; |