summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/widgets/styles/qstyle/tst_qstyle.cpp')
-rw-r--r--tests/auto/widgets/styles/qstyle/tst_qstyle.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp
index bafebc0dc6..5925b764dd 100644
--- a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp
+++ b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp
@@ -882,17 +882,14 @@ private:
void tst_QStyle::testStyleOptionInit()
{
QStringList keys = QStyleFactory::keys();
- QVector<QStyle*> 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;
}
}