diff options
-rw-r--r-- | src/qmlcompiler/qqmljsimporter.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/qmlcompiler/qqmljsimporter.cpp b/src/qmlcompiler/qqmljsimporter.cpp index 5b693f5c72..823c0e6f2c 100644 --- a/src/qmlcompiler/qqmljsimporter.cpp +++ b/src/qmlcompiler/qqmljsimporter.cpp @@ -209,6 +209,8 @@ void QQmlJSImporter::processImport( QQmlJSImporter::AvailableTypes *types, const QString &prefix) { + const QString anonPrefix = QStringLiteral("$anonymous$"); + if (!prefix.isEmpty()) types->qmlNames.insert(prefix, {}); // Empty type means "this is the prefix" @@ -221,6 +223,11 @@ void QQmlJSImporter::processImport( types->cppNames.insert(val->internalName(), val); const auto exports = val->exports(); + if (exports.isEmpty()) { + types->qmlNames.insert( + prefixedName(prefix, prefixedName(anonPrefix, val->internalName())), val); + } + for (const auto &valExport : exports) types->qmlNames.insert(prefixedName(prefix, valExport.type()), val); } |