5#ifndef QQMLTCVISITOR_P_H
6#define QQMLTCVISITOR_P_H
19#include <private/qtqmlcompilerglobal_p.h>
21#include <QtCore/qspan.h>
22#include <QtCore/qstring.h>
23#include <QtCore/qstringlist.h>
24#include <QtCore/qlist.h>
26#include <QtQml/private/qqmlirbuilder_p.h>
27#include <private/qqmljsimportvisitor_p.h>
28#include <private/qqmljslogger_p.h>
32using namespace Qt::StringLiterals;
34Q_DECLARE_LOGGING_CATEGORY(lcQmltcCompiler)
43 void findCppIncludes();
44 void postVisitResolve(
const QHash<QQmlJSScope::ConstPtr, QList<QQmlJSMetaPropertyBinding>>
45 &qmlIrOrderedBindings);
47 void checkNamesAndTypes(
const QQmlJSScope::ConstPtr &type);
48 QString filePath(
const QQmlJSScope::ConstPtr &scope)
const;
50 QString sourceDirectoryPath(
const QString &path)
const;
55 Visitor(QQmlJSImporter *importer, QQmlJSLogger *logger,
56 const QString &implicitImportDirectory,
57 const QStringList &qmldirFiles = QStringList());
59 bool visit(QQmlJS::AST::UiObjectDefinition *)
override;
60 void endVisit(QQmlJS::AST::UiObjectDefinition *)
override;
62 bool visit(QQmlJS::AST::UiObjectBinding *)
override;
63 void endVisit(QQmlJS::AST::UiObjectBinding *)
override;
65 bool visit(QQmlJS::AST::UiScriptBinding *)
override;
67 bool visit(QQmlJS::AST::UiPublicMember *)
override;
69 bool visit(QQmlJS::AST::UiInlineComponent *)
override;
71 void endVisit(QQmlJS::AST::UiProgram *)
override;
76 return m_qmlTypesWithQmlBases.value(inlinedComponentName);
82 Q_ASSERT(type->scopeType() == QQmlSA::ScopeType::QMLScope);
83 return m_creationIndices.value(type, -1);
88 return m_inlineComponentTypeCount.value(inlineComponent);
93 Q_ASSERT(type->scopeType() == QQmlSA::ScopeType::QMLScope);
94 return m_syntheticTypeIndices.value(type, -1);
99 Q_ASSERT(type->scopeType() == QQmlSA::ScopeType::QMLScope);
100 Q_ASSERT(m_qmlIrObjectIndices.contains(type));
101 return m_qmlIrObjectIndices.value(type, -1);
105
106
107
111 Q_ASSERT(!m_typesWithId.contains(type) || m_typesWithId[type] != -1);
112 return m_typesWithId.value(type, -1);
116
117
121
122
123
124
125
126
127
129 pureQmlTypes(
const InlineComponentOrDocumentRootName &inlineComponent)
const
131 return m_pureQmlTypes[inlineComponent];
135
136
137
140 return m_inlineComponentNames;
145 return m_inlineComponents.value(inlineComponentName);
149
150
151
154 return m_typesWithDeferredBindings.contains(type);
167
168
169
175
176
177
178
181
182
183
184
187
188
189
190
191
192
195
196
197
198
199
qsizetype creationIndex(const QQmlJSScope::ConstPtr &type) const
QHash< QQmlJSScope::ConstPtr, qsizetype > m_qmlIrObjectIndices
void endVisit(QQmlJS::AST::UiObjectDefinition *) override
QList< QQmlJSScope::ConstPtr > pureQmlTypes(const InlineComponentOrDocumentRootName &inlineComponent) const
QQmlJSScope::ConstPtr inlineComponent(const InlineComponentOrDocumentRootName &inlineComponentName) const
QStringList m_qmlTypeNames
qsizetype typeCount(const InlineComponentOrDocumentRootName &inlineComponent) const
QList< QQmlJSScope::ConstPtr > qmlTypes() const
QHash< QQmlJSScope::ConstPtr, qsizetype > m_creationIndices
QList< QQmlJSScope::ConstPtr > qmlTypesWithQmlBases(const InlineComponentOrDocumentRootName &inlinedComponentName) const
QHash< InlineComponentOrDocumentRootName, QQmlJSScope::Ptr > m_inlineComponents
QList< QQmlJSScope::ConstPtr > allQmlTypes() const
Visitor(QQmlJSImporter *importer, QQmlJSLogger *logger, const QString &implicitImportDirectory, const QStringList &qmldirFiles=QStringList())
qsizetype qmlComponentIndex(const QQmlJSScope::ConstPtr &type) const
QSet< QString > m_cppIncludes
qsizetype qmlIrObjectIndex(const QQmlJSScope::ConstPtr &type) const
bool visit(QQmlJS::AST::UiObjectDefinition *) override
bool hasDeferredBindings(const QQmlJSScope::ConstPtr &type) const
QList< InlineComponentOrDocumentRootName > inlineComponentNames() const
QHash< QQmlJSScope::ConstPtr, int > m_typesWithId
QList< InlineComponentOrDocumentRootName > m_inlineComponentNames
int runtimeId(const QQmlJSScope::ConstPtr &type) const
QHash< InlineComponentOrDocumentRootName, qsizetype > m_inlineComponentTypeCount
bool hasSeenCustomParsers() const
QHash< QString, int > m_qmlTypeNameCounts
bool checkCustomParser(const QQmlJSScope::ConstPtr &scope) override
QSet< QQmlJSScope::ConstPtr > m_typesWithDeferredBindings
QHash< QQmlJSScope::ConstPtr, qsizetype > m_syntheticTypeIndices
QSet< QString > cppIncludeFiles() const
QSpan< const QmltcLoggingCategoryOverride > categoryOverrides()