forked from qt-creator/qt-creator
QmlJS: Allow version in parent module
Task-number: QTCREATORBUG-16145 Change-Id: I5ddbbab1c808f422ebcec1502f9b50a9bf0babb6 Reviewed-by: Marco Benelli <marco.benelli@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
This commit is contained in:
@@ -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 there are cpp-based types for this package, use them too
|
||||||
if (valueOwner->cppQmlTypes().hasModule(packageName)) {
|
if (valueOwner->cppQmlTypes().hasModule(packageName)) {
|
||||||
importFound = true;
|
importFound = true;
|
||||||
|
Reference in New Issue
Block a user