diff options
author | Morten Johan Sørvig <morten.sorvig@qt.io> | 2018-06-04 10:45:14 +0200 |
---|---|---|
committer | Morten Johan Sørvig <morten.sorvig@qt.io> | 2018-06-04 10:45:14 +0200 |
commit | 3ca5f33c8b9c273f0169ec4c11417328f8071e97 (patch) | |
tree | 155da80482fb4593ca074f7a1bf9b22d031dba4a /src/qmltest/quicktest.cpp | |
parent | 5f4698c4e7952d64e78e3a06de5ac28d68415b19 (diff) | |
parent | b7a1bcd83a8f68185b617b860cef6f2d2d7c8d9b (diff) |
Merge remote-tracking branch 'gerrit/5.11' into wip/webassembly
Change-Id: I7556ac62fd8e1aeb99186c929f1225f02f9d2430
Diffstat (limited to 'src/qmltest/quicktest.cpp')
-rw-r--r-- | src/qmltest/quicktest.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/qmltest/quicktest.cpp b/src/qmltest/quicktest.cpp index a02a0a806d..8b9ff4c5cd 100644 --- a/src/qmltest/quicktest.cpp +++ b/src/qmltest/quicktest.cpp @@ -207,7 +207,11 @@ public: TestCaseCollector(const QFileInfo &fileInfo, QQmlEngine *engine) { - QQmlComponent component(engine, fileInfo.absoluteFilePath()); + QString path = fileInfo.absoluteFilePath(); + if (path.startsWith(QLatin1String(":/"))) + path.prepend(QLatin1String("qrc")); + + QQmlComponent component(engine, path); m_errors += component.errors(); if (component.isReady()) { @@ -534,7 +538,7 @@ int quick_test_main_with_setup(int argc, char **argv, const char *name, const ch QTestRootObject::instance()->init(); QString path = fi.absoluteFilePath(); if (path.startsWith(QLatin1String(":/"))) - view.setSource(QUrl(QLatin1String("qrc:") + path.midRef(2))); + view.setSource(QUrl(QLatin1String("qrc:") + path.midRef(1))); else view.setSource(QUrl::fromLocalFile(path)); |