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));