diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2020-09-25 12:39:17 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2020-09-25 23:57:59 +0200 |
commit | f0031c949ea6e5e6bc5dfb645e125e12192d425d (patch) | |
tree | ed76dd2ce06fdd63965b161d2a461c3a19cbd78a /tools/shared | |
parent | 8c8df9e02567f408a5b5516987459f9973d4d092 (diff) |
TypeDescriptionReader: Don't export C++ names as QML names
This is just wrong. The types are not visible in QML under their C++
names. Indeed, this way we reveal a number of places where we confuse
the names. Fix those in turn.
Furthermore, one of the tests was incorrect. The qmltypes files did not
contain an export entry for one of the types, and therefore the type was
formally anonymous in QML. However, we did access it via its C++ name.
Fix that by exporting the C++ name.
Change-Id: I8dd96334076b90fb174daf5b285d622f96495f56
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tools/shared')
-rw-r--r-- | tools/shared/scopetree.cpp | 2 | ||||
-rw-r--r-- | tools/shared/typedescriptionreader.cpp | 2 |
2 files changed, 1 insertions, 3 deletions
diff --git a/tools/shared/scopetree.cpp b/tools/shared/scopetree.cpp index 6cbabf4b51..4d02c67491 100644 --- a/tools/shared/scopetree.cpp +++ b/tools/shared/scopetree.cpp @@ -167,7 +167,7 @@ void ScopeTree::updateParentProperty(const ScopeTree::ConstPtr &scope) { auto it = m_properties.find(QLatin1String("parent")); if (it != m_properties.end() - && scope->internalName() != QLatin1String("Component") + && scope->baseTypeName() != QLatin1String("Component") && scope->internalName() != QLatin1String("program")) it->setType(scope); } diff --git a/tools/shared/typedescriptionreader.cpp b/tools/shared/typedescriptionreader.cpp index 717dbdf843..3691fa080c 100644 --- a/tools/shared/typedescriptionreader.cpp +++ b/tools/shared/typedescriptionreader.cpp @@ -257,8 +257,6 @@ void TypeDescriptionReader::readComponent(UiObjectDefinition *ast) return; } - // ### add implicit export into the package of c++ types - scope->addExport(scope->internalName(), QStringLiteral("<cpp>"), ComponentVersion()); m_objects->insert(scope->internalName(), scope); } |