diff options
Diffstat (limited to 'src/qml/qml')
-rw-r--r-- | src/qml/qml/qqmlimport.cpp | 8 | ||||
-rw-r--r-- | src/qml/qml/qqmlimport_p.h | 1 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp index bc8be04f24..345b88b007 100644 --- a/src/qml/qml/qqmlimport.cpp +++ b/src/qml/qml/qqmlimport.cpp @@ -753,6 +753,7 @@ bool QQmlImportInstance::resolveType(QQmlTypeLoader *typeLoader, // importing version -1 means import ALL versions if ((majversion == -1) || + (implicitlyImported && c.internal) || // allow the implicit import of internal types (c.majorVersion == majversion && c.minorVersion <= minversion)) { // Is this better than the previous candidate? if ((candidate == end) || @@ -1510,12 +1511,15 @@ bool QQmlImportsPrivate::addFileImport(const QString& uri, const QString &prefix // ### For enum support, we are now adding the implicit import always (and earlier). Bail early // if the implicit import has already been explicitly added, otherwise we can run into issues - // with duplicate imports + // with duplicate imports. However remember that we attempted to add this as implicit import, to + // allow for the loading of internal types. if (isImplicitImport) { for (QList<QQmlImportInstance *>::const_iterator it = nameSpace->imports.constBegin(); it != nameSpace->imports.constEnd(); ++it) { - if ((*it)->uri == importUri) + if ((*it)->uri == importUri) { + (*it)->implicitlyImported = true; return true; + } } } diff --git a/src/qml/qml/qqmlimport_p.h b/src/qml/qml/qqmlimport_p.h index 0b4a0e6f80..a1911515d0 100644 --- a/src/qml/qml/qqmlimport_p.h +++ b/src/qml/qml/qqmlimport_p.h @@ -81,6 +81,7 @@ struct QQmlImportInstance int majversion; // the major version imported int minversion; // the minor version imported bool isLibrary; // true means that this is not a file import + bool implicitlyImported = false; QQmlDirComponents qmlDirComponents; // a copy of the components listed in the qmldir QQmlDirScripts qmlDirScripts; // a copy of the scripts in the qmldir |