From 7caaab5262bb3b56d542f59dd4a5dd68ebbc94fc Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Fri, 23 Nov 2012 15:58:15 +0100 Subject: tst_QFormLayout: use QProxyStyle instead of QWindowsStyle QWindowsStyle is soon to become an internal class. Change-Id: Ie28d4ea074938b17827aa803a2298f881946f7e5 Reviewed-by: Caroline Chao --- tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'tests/auto/widgets') diff --git a/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp b/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp index ade2140b62..3aa0ea03f4 100644 --- a/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp +++ b/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp @@ -44,13 +44,12 @@ #include #include #include -#include +#include #include #include #include #include -#include #include #include @@ -268,11 +267,11 @@ void tst_QFormLayout::wrapping() delete w; } -class CustomLayoutStyle : public QWindowsStyle +class CustomLayoutStyle : public QProxyStyle { Q_OBJECT public: - CustomLayoutStyle() + CustomLayoutStyle() : QProxyStyle(QStyleFactory::create("windows")) { hspacing = 5; vspacing = 10; @@ -297,7 +296,7 @@ int CustomLayoutStyle::pixelMetric(PixelMetric metric, const QStyleOption * opti default: break; } - return QWindowsStyle::pixelMetric(metric, option, widget); + return QProxyStyle::pixelMetric(metric, option, widget); } void tst_QFormLayout::spacing() @@ -411,7 +410,7 @@ void tst_QFormLayout::setFormStyle() QVERIFY(layout.rowWrapPolicy() == QFormLayout::DontWrapRows); #endif - widget.setStyle(new QWindowsStyle()); + widget.setStyle(QStyleFactory::create("windows")); QVERIFY(layout.labelAlignment() == Qt::AlignLeft); QVERIFY(layout.formAlignment() == (Qt::AlignLeft | Qt::AlignTop)); -- cgit v1.2.3