diff options
author | Andrei Golubev <andrei.golubev@qt.io> | 2022-03-15 12:08:49 +0100 |
---|---|---|
committer | Andrei Golubev <andrei.golubev@qt.io> | 2022-05-07 15:43:14 +0200 |
commit | 5eb29ab272eaea309410f3d4231d65c0522014c8 (patch) | |
tree | 8613f12e017ce901c476d8f3e681372cea64b7da /tools/qmltc | |
parent | bcf7a2d77db5a0c4e99603dfcbacfbef26f76376 (diff) |
QQmlJSImportVisitor: rename public qmlScopes() to qmlTypes()
QML types constitute a fraction of QML scopes. Since we only store QML
types internally, provide them publicly under "qmlTypes" name to avoid
potential confusion
Change-Id: I7fb348324d7e807fe4e3b9c9b6b6ae4cf1f331ed
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 618d9b713ab70a2b6a38ee05659e2add0337a1cb)
Diffstat (limited to 'tools/qmltc')
-rw-r--r-- | tools/qmltc/qmltccompiler.cpp | 8 | ||||
-rw-r--r-- | tools/qmltc/qmltcvisitor.h | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/tools/qmltc/qmltccompiler.cpp b/tools/qmltc/qmltccompiler.cpp index 6510a6d51d..33fffcad62 100644 --- a/tools/qmltc/qmltccompiler.cpp +++ b/tools/qmltc/qmltccompiler.cpp @@ -59,7 +59,7 @@ void QmltcCompiler::compile(const QmltcCompilerInfo &info) Q_ASSERT(!m_info.outputHFile.isEmpty()); Q_ASSERT(!m_info.resourcePath.isEmpty()); - const QList<QQmlJSScope::ConstPtr> types = m_visitor->qmlScopes(); + const QList<QQmlJSScope::ConstPtr> types = m_visitor->qmlTypes(); QList<QmltcType> compiledTypes; compiledTypes.reserve(types.size()); @@ -124,12 +124,12 @@ void QmltcCompiler::compileType(QmltcType ¤t, const QQmlJSScope::ConstPtr rootType->internalName()); current.typeCount = QmltcVariable { u"uint"_qs, u"q_qmltc_typeCount"_qs, QString() }; - Q_ASSERT(m_visitor->qmlScopes().size() > 0); - QList<QQmlJSScope::ConstPtr> typesWithBaseTypeCount = m_visitor->qmlScopesWithQmlBases(); + Q_ASSERT(m_visitor->qmlTypes().size() > 0); + QList<QQmlJSScope::ConstPtr> typesWithBaseTypeCount = m_visitor->qmlTypesWithQmlBases(); QStringList typeCountComponents; typeCountComponents.reserve(1 + typesWithBaseTypeCount.size()); // add this document's type counts minus document root - typeCountComponents << QString::number(m_visitor->qmlScopes().size() - 1); + typeCountComponents << QString::number(m_visitor->qmlTypes().size() - 1); for (const QQmlJSScope::ConstPtr &t : qAsConst(typesWithBaseTypeCount)) { if (t == type) { // t is this document's root typeCountComponents << t->baseTypeName() + u"::" + current.typeCount->name; diff --git a/tools/qmltc/qmltcvisitor.h b/tools/qmltc/qmltcvisitor.h index d69c84d3ca..e4b7974a05 100644 --- a/tools/qmltc/qmltcvisitor.h +++ b/tools/qmltc/qmltcvisitor.h @@ -60,7 +60,7 @@ public: // NB: overwrite result() method to return ConstPtr QQmlJSScope::ConstPtr result() const { return QQmlJSImportVisitor::result(); } - QList<QQmlJSScope::ConstPtr> qmlScopesWithQmlBases() const { return m_qmlTypesWithQmlBases; } + QList<QQmlJSScope::ConstPtr> qmlTypesWithQmlBases() const { return m_qmlTypesWithQmlBases; } QSet<QString> cppIncludeFiles() const { return m_cppIncludes; } protected: |