diff options
author | Liang Qi <liang.qi@qt.io> | 2019-07-26 14:35:05 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2019-07-26 17:05:34 +0200 |
commit | d526a72c44cf3ed8d53c8d2b1c08dc5e7f1afe61 (patch) | |
tree | 63095d57f307bb9b90ab90e5dde98ae23e539c46 /src/qml/qml/qqmlimport.cpp | |
parent | cbe445dd915760d81a467b5285bacd208e44e365 (diff) | |
parent | aeec2f94c376c9a0e84bbbb3be4652384c7da113 (diff) |
Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
src/quick/handlers/qquickpointerdevicehandler.cpp
src/quick/scenegraph/qsgdefaultglyphnode.cpp
src/quick/scenegraph/qsgdefaultglyphnode_p.cpp
src/quick/scenegraph/qsgdefaultglyphnode_p_p.h
tests/auto/qml/qjsengine/tst_qjsengine.cpp
Done-With: Jan Arve Sæther <jan-arve.saether@qt.io>
Done-With: Laszlo Agocs <laszlo.agocs@qt.io>
Change-Id: I35749152f8dce44b9af8d52b1283629879010f11
Diffstat (limited to 'src/qml/qml/qqmlimport.cpp')
-rw-r--r-- | src/qml/qml/qqmlimport.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp index f4cdb45aff..5102fb111c 100644 --- a/src/qml/qml/qqmlimport.cpp +++ b/src/qml/qml/qqmlimport.cpp @@ -395,9 +395,18 @@ void findCompositeSingletons(const QQmlImportNamespace &set, QList<QQmlImports:: const QQmlDirComponents &components = import->qmlDirComponents; + const int importMajorVersion = import->majversion; + const int importMinorVersion = import->minversion; + auto shouldSkipSingleton = [importMajorVersion, importMinorVersion](int singletonMajorVersion, int singletonMinorVersion) -> bool { + return importMajorVersion != -1 && + (singletonMajorVersion > importMajorVersion || (singletonMajorVersion == importMajorVersion && singletonMinorVersion > importMinorVersion)); + }; + ConstIterator cend = components.constEnd(); for (ConstIterator cit = components.constBegin(); cit != cend; ++cit) { if (cit->singleton && excludeBaseUrl(import->url, cit->fileName, baseUrl.toString())) { + if (shouldSkipSingleton(cit->majorVersion, cit->minorVersion)) + continue; QQmlImports::CompositeSingletonReference ref; ref.typeName = cit->typeName; ref.prefix = set.prefix; @@ -408,7 +417,9 @@ void findCompositeSingletons(const QQmlImportNamespace &set, QList<QQmlImports:: } if (QQmlTypeModule *module = QQmlMetaType::typeModule(import->uri, import->majversion)) { - module->walkCompositeSingletons([&resultList, &set](const QQmlType &singleton) { + module->walkCompositeSingletons([&resultList, &set, &shouldSkipSingleton](const QQmlType &singleton) { + if (shouldSkipSingleton(singleton.majorVersion(), singleton.minorVersion())) + return; QQmlImports::CompositeSingletonReference ref; ref.typeName = singleton.elementName(); ref.prefix = set.prefix; |