summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDavid Faure <david.faure@kdab.com>2016-06-18 15:21:24 +0200
committerDavid Faure <david.faure@kdab.com>2016-07-06 17:20:28 +0000
commit0ea4a2cd207540c6936c6cf16bc5b371d6bcd09d (patch)
treece738f1f7cd0696229d0454b64891ed27b19b0d0 /tests
parent535f520685c2af471fd5d8d83da95f4321f171bb (diff)
downloadqtquickcontrols-0ea4a2cd207540c6936c6cf16bc5b371d6bcd09d.tar.gz
Find custom styles stored in qrc.
The unittest was showing that it was looking in <CURRENTDIR>/qrc:/qt-project.org/imports/QtQuick/Controls/Styles which makes no sense. In addition, the code was only listing the directory where the default style is found. When the custom style is elsewhere, it needs to be looked up in addition. Change-Id: I93eddab73672c575cd92037e1d0b366cf17540ef Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/customcontrolsstyle/style.qrc3
-rw-r--r--tests/auto/customcontrolsstyle/tst_customcontrolsstyle.cpp1
2 files changed, 4 insertions, 0 deletions
diff --git a/tests/auto/customcontrolsstyle/style.qrc b/tests/auto/customcontrolsstyle/style.qrc
index 37cfbbd7..c04782ba 100644
--- a/tests/auto/customcontrolsstyle/style.qrc
+++ b/tests/auto/customcontrolsstyle/style.qrc
@@ -2,4 +2,7 @@
<qresource prefix="/">
<file>Style/ButtonStyle.qml</file>
</qresource>
+ <qresource prefix="/qt-project.org/imports/QtQuick/Controls/Styles/ResourceStyle">
+ <file alias="ButtonStyle.qml">Style/ButtonStyle.qml</file>
+ </qresource>
</RCC>
diff --git a/tests/auto/customcontrolsstyle/tst_customcontrolsstyle.cpp b/tests/auto/customcontrolsstyle/tst_customcontrolsstyle.cpp
index ebd60d1e..99e8240e 100644
--- a/tests/auto/customcontrolsstyle/tst_customcontrolsstyle.cpp
+++ b/tests/auto/customcontrolsstyle/tst_customcontrolsstyle.cpp
@@ -61,6 +61,7 @@ void tst_customcontrolsstyle::style_data()
QTest::newRow("NonExistentStyle") << QString::fromLatin1("NonExistentStyle") << QString::fromLatin1("Base");
QTest::newRow("CustomFileSystemStyle") << directory() + QString::fromLatin1("/Style") << QString::fromLatin1("Style");
+ QTest::newRow("BuiltinQrcStyle") << QString::fromLatin1("ResourceStyle") << QString::fromLatin1("ResourceStyle"); // from :/qt-project.org/imports/QtQuick/Controls/Styles
QTest::newRow("CustomQrcStyle") << QString::fromLatin1(":/Style") << QString::fromLatin1("Style");
}