14
15
16
17
18
19
20
23
24
25
26
29 m_bases.append(RelatedClass(access, node));
34
35
36
39 m_derived.append(RelatedClass(access, node));
43
44
45
46
47
50 m_bases.append(RelatedClass(access, path));
54
55
56
59 Node *n = findNonfunctionChild(name, &Node::isProperty);
66 const QList<RelatedClass> &bases = baseClasses();
67 if (!bases.isEmpty()) {
68 for (
const RelatedClass &base : bases) {
69 ClassNode *cn = base.m_node;
71 pn = cn->findPropertyNode(name);
77 const QList<RelatedClass> &ignoredBases = ignoredBaseClasses();
78 if (!ignoredBases.isEmpty()) {
79 for (
const RelatedClass &base : ignoredBases) {
80 ClassNode *cn = base.m_node;
82 pn = cn->findPropertyNode(name);
93
94
95
96
97
98
99
100
101
104 for (
auto &bc : m_bases) {
105 ClassNode *cn = bc.m_node;
107 cn = QDocDatabase::qdocDB()->findClassNode(bc.m_path);
111 FunctionNode *result = cn->findFunctionChild(fn);
112 if (result !=
nullptr && !result->isInternal() && !result->isNonvirtual()
115 result = cn->findOverriddenFunction(fn);
116 if (result !=
nullptr && !result->isNonvirtual())
124
125
126
127
128
129
132 for (
auto &baseClass : m_bases) {
133 ClassNode *cn = baseClass.m_node;
135 cn = QDocDatabase::qdocDB()->findClassNode(baseClass.m_path);
136 baseClass.m_node = cn;
139 const NodeList &children = cn->childNodes();
140 for (
const auto &child : children) {
141 if (child->isProperty()) {
142 auto *pn =
static_cast<PropertyNode *>(child);
143 if (pn->name() == fn->name() || pn->hasAccessFunction(fn->name())) {
149 PropertyNode *result = cn->findOverriddenProperty(fn);
150 if (result !=
nullptr)
158
159
160
161
162
174
175
176
177
178
179
180
181
182void ClassNode::promotePublicBases(
const QList<RelatedClass> &bases)
184 if (!bases.isEmpty()) {
185 for (qsizetype i = bases.size() - 1; i >= 0; --i) {
190 if (bc->isPrivate() || bc->isInternal())
191 promotePublicBases(bc->baseClasses());
193 m_bases.append(bases.at(i));
200
201
202
203
208 QSet<ClassNode *> found;
211 while (i < m_bases.size()) {
214 bc = QDocDatabase::qdocDB()->findClassNode(m_bases.at(i).m_path);
217 || found.contains(bc))) {
220 m_ignoredBases.append(rc);
221 promotePublicBases(bc->baseClasses());
229 while (i < m_derived.size()) {
232 m_derived.removeAt(i);
233 const QList<RelatedClass> &dd = dc->derivedClasses();
234 for (qsizetype j = dd.size() - 1; j >= 0; --j)
235 m_derived.insert(i, dd.at(j));
243
246 for (
const auto &baseClass : std::as_const(baseClasses())) {
247 ClassNode *cn = baseClass.m_node;
249 Node *n = cn->findNonfunctionChild(pn->name(), &Node::isProperty);
251 auto *baseProperty =
static_cast<PropertyNode *>(n);
252 cn->resolvePropertyOverriddenFromPtrs(baseProperty);
253 pn->setOverriddenFrom(baseProperty);
255 cn->resolvePropertyOverriddenFromPtrs(pn);
261
262
263
269 return QLatin1String(
"(unnamed struct)");
271 return QLatin1String(
"(unnamed union)");
273 return QLatin1String(
"(unnamed class)");
278 return Node::plainName();
The ClassNode represents a C++ class.
PropertyNode * findPropertyNode(const QString &name)
Search the child list to find the property node with the specified name.
void addResolvedBaseClass(Access access, ClassNode *node)
Adds the base class node to this class's list of base classes.
PropertyNode * findOverriddenProperty(const FunctionNode *fn)
fn is an overriding function in this class or in a class derived from this class.
FunctionNode * findOverriddenFunction(const FunctionNode *fn)
fn is an overriding function in this class or in a class derived from this class.
QString plainName() const override
Returns the display name for this class node.
bool docMustBeGenerated() const override
Returns true if the class or struct represented by this class node must be documented.
void removePrivateAndInternalBases()
Remove private and internal bases classes from this class's list of base classes.
void resolvePropertyOverriddenFromPtrs(PropertyNode *pn)
void addDerivedClass(Access access, ClassNode *node)
Adds the derived class node to this class's list of derived classes.
void addUnresolvedBaseClass(Access access, const QStringList &path)
Add an unresolved base class to this class node's list of base classes.
This node is used to represent any kind of function being documented.
This class describes one instance of using the Q_PROPERTY macro.
This class provides exclusive access to the qdoc database, which consists of a forrest of trees and a...
static QDocDatabase * qdocDB()
Creates the singleton.
The Node class is the base class for all the nodes in QDoc's parse tree.
bool isDontDocument() const
Returns true if this node's status is DontDocument.
bool isPrivate() const
Returns true if this node's access is Private.
virtual bool isInternal() const
Returns true if the node's status is Internal, or if its parent is a class with Internal status.
NodeType nodeType() const override
Returns this node's type.
const Location & declLocation() const
Returns the Location where this node's declaration was seen.
bool hasDoc() const
Returns true if this node is documented, or it represents a documented node read from the index ('had...