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(Function, parent, name),
49 m_overloadFlag(
false),
58 m_virtualness(NonVirtual),
65
66
67
68
69
70
71
72
73
81 m_overloadFlag(
false),
94 if (!
isCppNode() && name.startsWith(
"__"))
99
100
101
104 auto *fn =
new FunctionNode(*
this);
105 fn->setParent(
nullptr);
106 parent->addChild(fn);
111
112
113
116 switch (m_virtualness) {
118 return QLatin1String(
"virtual");
120 return QLatin1String(
"pure");
125 return QLatin1String(
"non");
129
130
131
132
133
134
137 if (value == QLatin1String(
"pure")) {
140 parent()->setAbstract(
true);
179
180
181
182
183
210
211
212
217 return metanessMap_[value];
221
222
223
228 return topicMetanessMap_[topic];
232
233
234
235
238 m_overloadNumber = number;
239 m_overloadFlag = (number > 0);
243
244
245
246
247
248
249
252
253
254
255
258 switch (m_metaness) {
262 return "QML signal handler";
271
272
273
276 switch (m_metaness) {
284 return "constructor";
286 return "copy-constructor";
288 return "move-constructor";
292 return "macrowithparams";
294 return "macrowithoutparams";
298 return "copy-assign";
300 return "move-assign";
304 return "qmlsignalhandler";
313
314
315
316
319 m_associatedProperties.append(p);
323
324
325
326
327
328
329
330
331
332
335 if (m_associatedProperties.isEmpty())
337 if (m_associatedProperties.size() == 1)
338 return m_associatedProperties[0];
340 auto it = std::find_if(
341 m_associatedProperties.cbegin(), m_associatedProperties.cend(),
342 [
this](
const PropertyNode *p) {
343 return name().startsWith(p->name());
346 return it != m_associatedProperties.cend() ? *it : m_associatedProperties[0];
350
351
352
353
354
357 auto it = std::find_if_not(m_associatedProperties.begin(), m_associatedProperties.end(),
358 [](
const Node *p) ->
bool {
return p->isDeprecated(); });
360 if (!m_associatedProperties.isEmpty() && it == m_associatedProperties.end())
367
368
371
372
373
374
375
376
377
378
379
380
381
382
383
384
387 QStringList elements;
389 if (options & Node::SignatureTemplateParams && templateDecl())
390 elements << (*templateDecl()).to_qstring();
391 if (options & Node::SignatureReturnType)
392 elements << m_returnType.first;
393 elements.removeAll(QString());
395 if (!isMacroWithoutParams()) {
396 elements << name() + QLatin1Char(
'(')
397 + m_parameters.signature(options & Node::SignatureDefaultValues)
401 elements << QStringLiteral(
"const");
403 elements << QStringLiteral(
"&");
405 elements << QStringLiteral(
"&&");
410 return elements.join(QLatin1Char(
' '));
414
415
416
417
418
419
420
421
447 for (qsizetype i = 0; i < param_count; ++i) {
448 if (
int type_comp = QString::compare(p1.at(i).type(), p2.at(i).type());
461 return (*t1).to_std_string().compare((*t2).to_std_string());
467
468
469
470
471
472
473
474
475
476
477
478
479
483 if (name().startsWith(QLatin1String(
"qt_")) || name() == QLatin1String(
"metaObject")
484 || name() == QLatin1String(
"tr") || name() == QLatin1String(
"trUtf8")
485 || name() == QLatin1String(
"d_func")) {
489 if (s.contains(QLatin1String(
"enum_type")) && s.contains(QLatin1String(
"operator|")))
496
497
498
501
502
503
504
505
506
509 if (m_returnType.second.has_value())
510 return m_returnType.second.value();
511 return m_returnType.first;
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 isDeprecated() const override
\reimp
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.
static Genus getGenus(Metaness metaness)
Determines the Genus value for this FunctionNode given the Metaness value metaness.
QString returnTypeString() const
Returns the type of the function as a string.
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.
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
Genus
An unsigned char value that specifies whether the Node represents a C++ element, a QML element,...
bool hasDoc() const
Returns true if this node is documented, or it represents a documented node read from the index ('had...
LinkType
An unsigned char value that probably should be moved out of the Node base class.
bool isCppNode() const
Returns true if this node's Genus value is CPP.
void setStatus(Status t)
Sets the node's status to t.
A class for parsing and managing a function parameter list.
This class describes one instance of using the Q_PROPERTY macro.
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.