Commit cbc5f22b authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlJS: Allow version in parent module



Task-number: QTCREATORBUG-16145
Change-Id: I5ddbbab1c808f422ebcec1502f9b50a9bf0babb6
Reviewed-by: default avatarMarco Benelli <marco.benelli@qt.io>
Reviewed-by: Eike Ziller's avatarEike Ziller <eike.ziller@qt.io>
Reviewed-by: default avatarAlessandro Portale <alessandro.portale@theqtcompany.com>
parent 482bbec1
......@@ -410,6 +410,24 @@ Import LinkPrivate::importNonFile(Document::Ptr doc, const ImportInfo &importInf
}
}
//The version number can be located higher in the path: qml/QtQuick.Controls.2/Material
if (!importFound) {
foreach (const QString &importPath, importPaths) {
QStringList splittedList = packagePath.split(QLatin1String("/"));
const QString last = splittedList.last();
splittedList.removeLast();
QString libraryPath = QString::fromLatin1("%1/%2.%3/%4").arg(importPath,
splittedList.join(QLatin1String("/")),
QString::number(version.majorVersion()),
last);
if (importLibrary(doc, libraryPath, &import, importPath)) {
importFound = true;
break;
}
}
}
// if there are cpp-based types for this package, use them too
if (valueOwner->cppQmlTypes().hasModule(packageName)) {
importFound = true;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment