summaryrefslogtreecommitdiffstats
path: root/tests/auto/customcontrolsstyle/tst_customcontrolsstyle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/customcontrolsstyle/tst_customcontrolsstyle.cpp')
-rw-r--r--tests/auto/customcontrolsstyle/tst_customcontrolsstyle.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/auto/customcontrolsstyle/tst_customcontrolsstyle.cpp b/tests/auto/customcontrolsstyle/tst_customcontrolsstyle.cpp
index 8405c98ba..67aeb5869 100644
--- a/tests/auto/customcontrolsstyle/tst_customcontrolsstyle.cpp
+++ b/tests/auto/customcontrolsstyle/tst_customcontrolsstyle.cpp
@@ -110,7 +110,12 @@ void tst_customcontrolsstyle::style()
void tst_customcontrolsstyle::changeStyle()
{
qputenv("QT_QUICK_CONTROLS_1_STYLE", "Base");
- qputenv("QML2_IMPORT_PATH", QFile::encodeName(directory()));
+ QByteArray importPath = qgetenv("QML2_IMPORT_PATH");
+ if (importPath.isEmpty())
+ importPath = QFile::encodeName(directory());
+ else
+ importPath.prepend(QFile::encodeName(directory()) + QDir::listSeparator().toLatin1());
+ qputenv("QML2_IMPORT_PATH", importPath);
QQmlEngine engine;