8#include <QtCore/qdebug.h>
12QMultiMap<
const Node *, Node *> QmlTypeNode::s_inheritedBy;
15
16
17
18
19
28
29
30
33 s_inheritedBy.clear();
37
38
39
44 if (!s_inheritedBy.contains(base, sub))
45 s_inheritedBy.insert(base, sub);
49
50
54 if (s_inheritedBy.count(base) > 0) {
55 subs = s_inheritedBy.values(base);
60
61
62
63
68 result = m_qmlBaseNode->logicalModuleName() +
"::" + m_qmlBaseNode->name();
74
75
76
77
80 return (m_logicalModule ? m_logicalModule->logicalModuleName() : QString());
84
85
86
87
90 return (m_logicalModule ? m_logicalModule->logicalModuleVersion() : QString());
94
95
96
97
100 return (m_logicalModule ? m_logicalModule->logicalModuleIdentifier() : QString());
104
105
109 while (qtn !=
nullptr) {
118
119
120
121
122
125 if (m_qmlBaseNode || m_qmlBaseName.isEmpty())
128 auto *base =
static_cast<QmlTypeNode *>(previousSearches.value(m_qmlBaseName));
129 if (!previousSearches.contains(m_qmlBaseName)) {
130 for (
const auto &imp : std::as_const(m_importList)) {
131 base = QDocDatabase::qdocDB()->findQmlType(imp, m_qmlBaseName);
136 if (m_qmlBaseName.contains(
':'))
137 base = QDocDatabase::qdocDB()->findQmlType(m_qmlBaseName);
139 base = QDocDatabase::qdocDB()->findQmlType(QString(), m_qmlBaseName);
141 previousSearches.insert(m_qmlBaseName, base);
144 if (base && base !=
this) {
145 m_qmlBaseNode = base;
148 if (base->isIndexNode())
149 base->resolveInheritance(previousSearches);
NodeType
An unsigned char value that identifies an object as a particular subclass of Node.
virtual bool isInternal() const
Returns true if the node's status is Internal, or if its parent is a class with Internal status.
LinkType
An unsigned char value that probably should be moved out of the Node base class.
static void terminate()
Clear the static maps so that subsequent runs don't try to use contents from a previous run.
QString qmlFullBaseName() const override
If this QML type node has a base type node, return the fully qualified name of that QML type,...
QString logicalModuleIdentifier() const override
If the QML type's QML module pointer is set, return the QML module identifier from the QML module nod...
QmlTypeNode(Aggregate *parent, const QString &name, Node::NodeType type)
Constructs a Qml type.
bool inherits(Aggregate *type)
Returns true if this QML type inherits type.
QString logicalModuleVersion() const override
If the QML type's QML module pointer is set, return the QML module version from the QML module node.
void resolveInheritance(NodeMap &previousSearches)
Recursively resolves the base node for this QML type when only the name of the base type is known.
static void addInheritedBy(const Node *base, Node *sub)
Record the fact that QML class base is inherited by QML class sub.
QString logicalModuleName() const override
If the QML type's QML module pointer is set, return the QML module name from the QML module node.
static void subclasses(const Node *base, NodeList &subs)
Loads the list subs with the nodes of all the subclasses of base.
QmlTypeNode * qmlBaseNode() const override
If this Aggregate is a QmlTypeNode, this function returns a pointer to the QmlTypeNode that is its ba...
Combined button and popup list for selecting options.
QMap< QString, Node * > NodeMap