diff options
author | Michael Brasser <mbrasser@ford.com> | 2019-06-17 13:57:40 -0500 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2019-09-09 11:16:06 +0200 |
commit | 8cfd5fde29e5a6469d164bcc29eb3d0a0aa191cf (patch) | |
tree | 6acef682338dc42e8a5257c84f6a8d0284bec2f0 /src/qml/qml/qqmlmetatype.cpp | |
parent | 6156013d741685a7332827bc84ec1f1fe46e79d1 (diff) |
Also check the non-file-imported type on QQmlMetaType::typeForUrl
There is no reason why we wouldn't want to find those. Failure to do so
leads to duplicate creation of singleton objects.
Fixes: QTBUG-76514
Change-Id: If2fdfbd933229518136ae0d19474bbaebfbb8cff
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Diffstat (limited to 'src/qml/qml/qqmlmetatype.cpp')
-rw-r--r-- | src/qml/qml/qqmlmetatype.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/qml/qml/qqmlmetatype.cpp b/src/qml/qml/qqmlmetatype.cpp index 2c641d3845..c2674b402a 100644 --- a/src/qml/qml/qqmlmetatype.cpp +++ b/src/qml/qml/qqmlmetatype.cpp @@ -739,9 +739,16 @@ QQmlType QQmlMetaType::typeForUrl(const QString &urlString, const QUrl url = QQmlTypeLoader::normalize(QUrl(urlString)); QQmlMetaTypeDataPtr data; - QQmlType ret(data->urlToType.value(url)); - if (ret.isValid() && ret.sourceUrl() == url) - return ret; + { + QQmlType ret(data->urlToType.value(url)); + if (ret.isValid() && ret.sourceUrl() == url) + return ret; + } + { + QQmlType ret(data->urlToNonFileImportType.value(url)); + if (ret.isValid() && ret.sourceUrl() == url) + return ret; + } const int dot = qualifiedType.indexOf(QLatin1Char('.')); const QString typeName = dot < 0 |