aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlimport.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/qml/qqmlimport.cpp')
-rw-r--r--src/qml/qml/qqmlimport.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp
index 55c07ac35a..20da154673 100644
--- a/src/qml/qml/qqmlimport.cpp
+++ b/src/qml/qml/qqmlimport.cpp
@@ -1536,6 +1536,11 @@ void QQmlImportDatabase::addImportPath(const QString& path)
if (url.scheme() == QLatin1String("file")) {
cPath = QQmlFile::urlToLocalFileOrQrc(url);
+ } else if (path.startsWith(QLatin1Char(':'))) {
+ // qrc directory, e.g. :/foo
+ // need to convert to a qrc url, e.g. qrc:/foo
+ cPath = QStringLiteral("qrc") + path;
+ cPath.replace(Backslash, Slash);
} else if (url.isRelative() ||
(url.scheme().length() == 1 && QFile::exists(path)) ) { // windows path
QDir dir = QDir(path);