From ca434d0c209c692441e775528e657a1ba9c4648d Mon Sep 17 00:00:00 2001 From: Hannah von Reth Date: Fri, 29 Apr 2016 12:42:37 +0200 Subject: Enable testStyleOptionInit for all styles and fix affected styles. Change-Id: I7cb759445342ecb58d5187ddd4a22e41fdea084a Reviewed-by: Marc Mutz --- tests/auto/widgets/styles/qstyle/tst_qstyle.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'tests/auto/widgets/styles') diff --git a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp index 46b6fcca82..361a7e7ed4 100644 --- a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp +++ b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp @@ -949,17 +949,14 @@ private: void tst_QStyle::testStyleOptionInit() { QStringList keys = QStyleFactory::keys(); - QVector styles; - styles.reserve(keys.size() + 1); - - styles << new QCommonStyle(); + keys.prepend(QString()); // QCommonStyle marker - Q_FOREACH (QStyle *style, styles) { + Q_FOREACH (const QString &key, keys) { + QStyle* style = key.isEmpty() ? new QCommonStyle : QStyleFactory::create(key); TestStyleOptionInitProxy testStyle; testStyle.setBaseStyle(style); testAllFunctions(style); QVERIFY(!testStyle.invalidOptionsDetected); - delete style; } } -- cgit v1.2.3