12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
35
36
37
38
39
40
41
43 :
Node(NodeType::Function, parent, name),
45 m_implicitlyGenerated(
false),
49 m_overloadFlag(
false),
50 m_primaryOverloadFlag(
false),
56 m_explicitlyDefaulted(
false),
58 m_hiddenFriend(
false),
62 m_virtualness(NonVirtual),
69
70
71
72
73
74
75
76
77
81 m_implicitlyGenerated(
false),
85 m_overloadFlag(
false),
86 m_primaryOverloadFlag(
false),
92 m_explicitlyDefaulted(
false),
94 m_hiddenFriend(
false),
102 if (!
isCppNode() && name.startsWith(
"__"))
107
108
109
112 auto *fn =
new FunctionNode(*
this);
113 fn->setParent(
nullptr);
114 parent->addChild(fn);
119
120
121
124 switch (m_virtualness) {
126 return QLatin1String(
"virtual");
128 return QLatin1String(
"pure");
133 return QLatin1String(
"non");
137
138
139
140
141
142
145 if (value == QLatin1String(
"pure")) {
148 parent()->setAbstract(
true);
187
188
189
190
191
214 return Genus::DontCare;
218
219
220
225 return metanessMap_[value];
229
230
231
236 return topicMetanessMap_[topic];
240
241
242
248 for (
auto *property : m_associatedProperties) {
249 if (property->isInAPI())
257
258
259
260
263 m_overloadNumber = number;
264 m_overloadFlag = (number > 0);
268
269
270
271
272
273
274
277
278
279
280
283 switch (m_metaness) {
287 return "QML signal handler";
296
297
298
301 switch (m_metaness) {
309 return "constructor";
311 return "copy-constructor";
313 return "move-constructor";
317 return "macrowithparams";
319 return "macrowithoutparams";
323 return "copy-assign";
325 return "move-assign";
329 return "qmlsignalhandler";
338
339
340
341
344 m_associatedProperties.append(p);
348
349
350
351
352
353
354
355
356
357
360 if (m_associatedProperties.isEmpty())
362 if (m_associatedProperties.size() == 1)
363 return m_associatedProperties[0];
365 auto it =
std::find_if(
366 m_associatedProperties.cbegin(), m_associatedProperties.cend(),
368 return name().startsWith(p->name());
370 if (it != m_associatedProperties.cend())
376 return *
std::min_element(
377 m_associatedProperties.cbegin(), m_associatedProperties.cend(),
382
383
384
385
386
393
394
397
398
399
400
401
402
403
404
405
406
407
408
409
410
413 QStringList elements;
415 if (options & Node::SignatureTemplateParams && templateDecl())
416 elements << (*templateDecl()).to_qstring();
417 if (options & Node::SignatureReturnType)
418 elements << m_returnType.first;
419 elements.removeAll(QString());
421 if (!isMacroWithoutParams()) {
422 elements << name() + QLatin1Char(
'(')
423 + m_parameters.signature(options & Node::SignatureDefaultValues)
427 elements << QStringLiteral(
"const");
429 elements << QStringLiteral(
"&");
431 elements << QStringLiteral(
"&&");
436 return elements.join(QLatin1Char(
' '));
440
441
442
443
444
445
446
447
473 for (qsizetype i = 0; i < param_count; ++i) {
474 if (
int type_comp = QString::compare(p1.at(i).type(), p2.at(i).type());
487 return (*t1).to_std_string().compare((*t2).to_std_string());
493
494
495
496
497
498
499
500
501
502
503
504
505
509 if (name().startsWith(QLatin1String(
"qt_")) || name() == QLatin1String(
"metaObject")
510 || name() == QLatin1String(
"tr") || name() == QLatin1String(
"trUtf8")
511 || name() == QLatin1String(
"d_func")) {
515 if (s.contains(QLatin1String(
"enum_type")) && s.contains(QLatin1String(
"operator|")))
522
523
524
527
528
529
530
531
532
535 if (m_returnType.second.has_value())
536 return m_returnType.second.value();
537 return m_returnType.first;
541
542
543
546 auto it =
std::find_if_not(m_associatedProperties.begin(), m_associatedProperties.end(),
549 if (!m_associatedProperties.isEmpty() && it == m_associatedProperties.end())
This node is used to represent any kind of function being documented.
QString metanessString() const
Returns a string representing the Metaness enum value for this function.
QString kindString() const
Returns a string representing the kind of function this Function node represents, which depends on th...
FunctionNode(Metaness type, Aggregate *parent, const QString &name, bool attached=false)
Construct a function node for a QML method or signal, specified by ther Metaness value type.
const Parameters & parameters() const
bool isInAPI() const override
Extends the base implementation to test whether an associated enum is in the API.
bool isDeprecated() const override
\reimp
static Genus getGenus(Metaness metaness)
Determines the Genus value for this FunctionNode given the Metaness value metaness.
bool isAttached() const override
Returns true if the QML property or QML method node is marked as attached.
void setOverloadNumber(signed short number)
Sets the function node's overload number to number.
bool isIgnored() const
In some cases, it is ok for a public function to be not documented.
friend int compare(const FunctionNode *f1, const FunctionNode *f2)
Compares FunctionNode f1 with f2, assumed to have identical names.
QString returnTypeString() const
Returns the type of the function as a string.
virtual Status status() const override
Returns the status of the function, taking the status of any associated properties into account.
void setVirtualness(const QString &value)
Sets the function node's virtualness value based on the value of string value, which is the value of ...
const PropertyNode * primaryAssociatedProperty() const
Returns the primary associated property, if this is an access function for one or more properties.
QString virtualness() const
Returns this function's virtualness value as a string for use as an attribute value in index files.
This class describes one instance of using the Q_PROPERTY macro.
Status
Specifies the status of the QQmlIncubator.
static void buildTopicMetanessMap()
static void buildMetanessMap()
static QMap< QString, FunctionNode::Metaness > metanessMap_
static QMap< QString, FunctionNode::Metaness > topicMetanessMap_
Combined button and popup list for selecting options.
The Node class is the base class for all the nodes in QDoc's parse tree.
virtual Status status() const
Returns the node's status value.
Aggregate * parent() const
Returns the node's parent pointer.
virtual bool isDeprecated() const
Returns true if this node's status is Deprecated.
const std::optional< RelaxedTemplateDeclaration > & templateDecl() const
virtual bool isInAPI() const
Returns true if this node is considered to be part of the API as per the InclusionPolicy retrieved fr...
bool hasDoc() const
Returns true if this node is documented, or it represents a documented node read from the index ('had...
bool isCppNode() const
Returns true if this node's Genus value is CPP.
virtual void setStatus(Status t)
Sets the node's status to t.
A class for parsing and managing a function parameter list.