diff options
author | Liang Qi <liang.qi@qt.io> | 2018-05-15 15:32:04 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2018-05-15 15:32:04 +0200 |
commit | 6e5251dd3d7b21b67693a79d3470ec2ba80ba97e (patch) | |
tree | 9df6575fa02be4f47bc9a97dafad6ac71f02419f /src/qmltest/quicktest.cpp | |
parent | b159b766eb7974419c2f16a01a8d15221c352dbf (diff) | |
parent | 9ef0d2da99f4593d50c16912d00bef121bb76f9b (diff) |
Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
src/qml/qml/qqmltypeloader.cpp
Change-Id: If9874faf23e813b05ee4cf042133a528d73ba72a
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 75c06edb25..8d3f5ffb23 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)); |