11using namespace Qt::StringLiterals;
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
37
38
39
40
41
42
43
47 m_implicitlyGenerated(
false),
51 m_overloadFlag(
false),
52 m_primaryOverloadFlag(
false),
58 m_explicitlyDefaulted(
false),
60 m_hiddenFriend(
false),
71
72
73
74
75
76
77
78
79
83 m_implicitlyGenerated(
false),
87 m_overloadFlag(
false),
88 m_primaryOverloadFlag(
false),
94 m_explicitlyDefaulted(
false),
96 m_hiddenFriend(
false),
104 if (!
isCppNode() && name.startsWith(
"__"))
109
110
111
121
122
123
126 switch (m_virtualness) {
128 return QLatin1String(
"virtual");
130 return QLatin1String(
"pure");
135 return QLatin1String(
"non");
139
140
141
142
143
144
147 if (value == QLatin1String(
"pure")) {
150 parent()->setAbstract(
true);
189
190
191
192
193
216 return Genus::DontCare;
220
221
222
227 return metanessMap_[value];
231
232
233
238 return topicMetanessMap_[topic];
242
243
244
250 for (
auto *property : m_associatedProperties) {
251 if (property->isInAPI())
259
260
261
262
265 m_overloadNumber = number;
266 m_overloadFlag = (number > 0);
270
271
272
273
274
275
276
279
280
281
282
285 switch (m_metaness) {
293 return "QML signal handler";
302
303
304
307 switch (m_metaness) {
315 return "constructor";
317 return "copy-constructor";
319 return "move-constructor";
323 return "macrowithparams";
325 return "macrowithoutparams";
329 return "copy-assign";
331 return "move-assign";
335 return "qmlsignalhandler";
344
345
346
347
351 m_associatedProperties.append(p);
355
356
357
358
359
360
361
362
363
364
367 if (m_associatedProperties.isEmpty())
369 if (m_associatedProperties.size() == 1)
370 return m_associatedProperties[0];
372 auto it =
std::find_if(
373 m_associatedProperties.cbegin(), m_associatedProperties.cend(),
375 return name().startsWith(p->name());
377 if (it != m_associatedProperties.cend())
383 return *
std::min_element(
384 m_associatedProperties.cbegin(), m_associatedProperties.cend(),
389
390
391
392
393
400
401
404
405
406
407
408
409
410
411
412
413
414
415
416
417
420 QStringList elements;
422 if (options & Node::SignatureTemplateParams && templateDecl())
423 elements << (*templateDecl()).to_qstring();
424 if (options & Node::SignatureReturnType)
425 elements << m_returnType.first;
426 elements.removeAll(QString());
428 if (!isMacroWithoutParams()) {
429 elements << name() + QLatin1Char(
'(')
430 + m_parameters.signature(options & Node::SignatureDefaultValues)
434 elements << QStringLiteral(
"const");
436 elements << QStringLiteral(
"&");
438 elements << QStringLiteral(
"&&");
443 return elements.join(QLatin1Char(
' '));
447
448
449
450
451
452
453
454
480 for (qsizetype i = 0; i < param_count; ++i) {
481 if (
int type_comp = QString::compare(p1.at(i).type(), p2.at(i).type());
494 return (*t1).to_std_string().compare((*t2).to_std_string());
500
501
502
503
504
505
506
507
508
509
510
511
512
516 if (name().startsWith(QLatin1String(
"qt_")) || name().startsWith(QLatin1String(
"_q_"))
517 || name() == QLatin1String(
"metaObject") || name() == QLatin1String(
"tr")
518 || name() == QLatin1String(
"trUtf8") || name() == QLatin1String(
"d_func")) {
522 if (s.contains(QLatin1String(
"enum_type")) && s.contains(QLatin1String(
"operator|")))
529
530
531
534
535
536
537
538
539
542 if (m_returnType.second.has_value())
543 return m_returnType.second.value();
544 return m_returnType.first;
548
549
550
553 auto it =
std::find_if_not(m_associatedProperties.begin(), m_associatedProperties.end(),
556 if (!m_associatedProperties.isEmpty() && it == m_associatedProperties.end())
563
564
565
566
578 docSource = u"Destroys the instance of \\notranslate %1."_s.arg(className);
580 docSource += u" This destructor is virtual."_s;
582 docSource = u"Default-constructs an instance of \\notranslate %1."_s.arg(className);
584 docSource = u"Copy-constructs an instance of \\notranslate %1."_s.arg(className);
586 docSource = u"Move-constructs an instance of \\notranslate %1."_s.arg(className);
589 const QString other = (!params.isEmpty() && !params.at(0).name().isEmpty())
590 ? params.at(0).name()
592 docSource = isCAssign()
593 ? u"Copy-assigns \\a %1 to this \\notranslate %2 instance."_s.arg(other, className)
594 : u"Move-assigns \\a %1 to this \\notranslate %2 instance."_s.arg(other, className);
597 if (docSource.isEmpty())
600 if (isDeletedAsWritten())
601 docSource += u" This function is deleted."_s;
603 static const QSet<QString> noMetaCommands;
604 static const QSet<QString> noTopics;
void addChild(Node *child)
Adds the child to this node's child list and sets the child's parent pointer to this Aggregate.
void markAutoGenerated()
Marks this documentation as auto-generated by QDoc.
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.
Node * clone(Aggregate *parent) override
Clone this node on the heap and make the clone a child of parent.
bool isDeprecated() const override
\reimp
void autoGenerateSmfDoc(const QString &className)
void addAssociatedProperty(PropertyNode *property)
Adds the "associated" property p to this function node.
bool isSpecialMemberFunction() const
static Genus getGenus(Metaness metaness)
Determines the Genus value for this FunctionNode given the Metaness value metaness.
FunctionNode(Aggregate *parent, const QString &name)
Construct a function node for a C++ function.
bool isAttached() const override
Returns true if the QML property or QML method node is marked as attached.
bool isDeletedAsWritten() const
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.
bool isExplicitlyDefaulted() const
virtual Status status() const override
Returns the status of the function, taking the status of any associated properties into account.
Parameters & parameters()
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 QMap< QString, Metaness > topicMetanessMap_
static QMap< QString, Metaness > metanessMap_
static void buildMetanessMap()
Metaness
Specifies the kind of function a FunctionNode represents.
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 Location & location() const
If this node's definition location is empty, this function returns this node's declaration location.
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...
void setDoc(const Doc &doc, bool replace=false)
Sets this Node's Doc to doc.
bool hasDoc() const
Returns true if this node is documented, or it represents a documented node read from the index ('had...
void setParent(Aggregate *n)
Sets the node's parent pointer to n.
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.