29#include <QtCore/qdebug.h>
30#include <QtCore/qmap.h>
34using namespace Qt::Literals::StringLiterals;
39
40
41
42static const QMap<QString, NodeType> s_nodeTypeMap{
62 Config &config = Config::instance();
67 if (!exampleFilePatterns.isEmpty())
68 m_exampleNameFilter = exampleFilePatterns.join(
' ');
70 m_exampleNameFilter =
"*.cpp *.h *.js *.xq *.svg *.xml *.ui";
76 if (!exampleImagePatterns.isEmpty())
77 m_exampleImageFilter = exampleImagePatterns.join(
' ');
79 m_exampleImageFilter =
"*.png";
85
86
94 }
else if (s_nodeTypeMap.contains(command)) {
96
97
98
99
100
101
102
103 NodeType type = s_nodeTypeMap[command];
104 QStringList words = arg.first.split(QLatin1Char(
' '));
107 Node *node =
nullptr;
110 idx = words.size() - 1;
111 path = words[idx].split(
"::");
113 node = database->findNodeByNameAndType(path, s_nodeTypeTestFuncMap[command]);
127 if (node ==
nullptr) {
130 QStringLiteral(
"Cannot find '%1' specified with '\\%2' in any header file")
131 .arg(arg.first, command));
145 setExampleFileLists(en);
167 QStringList blankSplit = arg.first.split(QLatin1Char(
' '));
169 cn->setLogicalModuleInfo(blankSplit);
184 qmid = args.first().first;
185 auto *qcn = database->findQmlTypeInPrimaryTree(qmid, arg.first);
188 if (!qcn && !qmid.isEmpty()) {
189 qcn = database->findQmlTypeInPrimaryTree(QString(), arg.first);
190 if (qcn && !qcn->logicalModuleName().isEmpty())
193 if (!qcn || qcn->nodeType() != nodeType)
196 database->addToQmlModule(qmid, qcn);
199 qcn->setSingleton(
true);
201 auto classNode = database->findClassNode(arg.first.split(u"::"_s));
202 if (classNode && classNode->isQmlSingleton())
203 qcn->setSingleton(
true);
207 return processQmlEnumTopic(doc.enumItemNames(), doc.location(), arg.first);
216
217
218
219
220
224 auto *aggregate = database->findQmlTypeInPrimaryTree(moduleName, name);
229 aggregate =
new QmlTypeNode(database->primaryTreeRoot(), name, NodeType::QmlType);
231 if (!moduleName.isEmpty())
232 database->addToQmlModule(moduleName, aggregate);
241 if (topics.isEmpty())
244 std::vector<TiedDocumentation> tied{};
246 auto firstTopicArgs =
253 auto *qmlType = findOrCreateQmlType((*firstTopicArgs).m_module, (*firstTopicArgs).m_qmltype, doc
.startLocation());
255 for (
const auto &topicCommand : topics) {
256 QString cmd = topicCommand.m_topic;
258 bool attached = cmd.contains(QLatin1String(
"attached"));
259 if (
auto qpa = QmlPropertyArguments::parse(topicCommand.m_args, doc.location(),
260 QmlPropertyArguments::ParsingOptions::RequireQualifiedPath)) {
261 if (qmlType != QDocDatabase::qdocDB()->findQmlTypeInPrimaryTree(qpa->m_module, qpa->m_qmltype)) {
262 doc.startLocation().warning(
264 "All properties in a group must belong to the same type: '%1'")
265 .arg(topicCommand.m_args));
268 QmlPropertyNode *existingProperty = qmlType->hasQmlProperty(qpa->m_name, attached);
269 if (existingProperty) {
270 processMetaCommands(doc, existingProperty);
271 if (!doc.body().isEmpty()) {
272 doc.startLocation().warning(
273 QStringLiteral(
"QML property documented multiple times: '%1'")
274 .arg(topicCommand.m_args), QStringLiteral(
"also seen here: %1")
275 .arg(existingProperty->location().toString()));
279 auto *qpn =
new QmlPropertyNode(qmlType, qpa->m_name, qpa->m_type, attached);
280 qpn->setIsList(qpa->m_isList);
281 qpn->setLocation(doc.startLocation());
282 qpn->setGenus(Genus::QML);
284 tied.emplace_back(TiedDocumentation{doc, qpn});
289 doc.startLocation().warning(
290 QStringLiteral(
"Command '\\%1'; not allowed with QML property commands")
299 if (sharedNodes.size() > 1) {
303 if (
auto dot = (*firstTopicArgs).m_name.indexOf(
'.'_L1); dot != -1)
304 group = (*firstTopicArgs).m_name.left(dot);
310 for (
const auto n : sharedNodes)
319
320
321
322
323
324
330 QString arg = argPair.first;
346 static_cast<
Aggregate *>(node)->setIncludeFile(arg);
352 if (!node->isClassNode())
353 doc.location().warning(
354 u"Found \\%1 command outside of \\%2 context."_s
358
359
360
361
362
363 processOverloadCommand(node, doc);
374 QStringLiteral(
"Cannot find base function for '\\%1' in %2()")
376 QStringLiteral(
"The function either doesn't exist in any "
377 "base class with the same signature or it "
378 "exists but isn't virtual."));
383 QStringLiteral(
"Ignored '\\%1' in %2").arg(
COMMAND_REIMP, node->name()));
392 doc.location().warning(
"Invalid '\\%1' not allowed in '\\%2'"_L1
396 CodeParser::setLink(node, Node::NextLink, arg);
398 CodeParser::setLink(node, Node::PreviousLink, arg);
400 CodeParser::setLink(node, Node::StartLink, arg);
402 if (node->name() == arg)
403 doc
.location().warning(QStringLiteral(
"%1 tries to inherit itself").arg(arg));
406 qmlType->setQmlBaseName(arg);
410 doc.location().report(
411 u"\\instantiates is deprecated and will be removed in a future version. Use \\nativetype instead."_s);
413 processQmlNativeTypeCommand(node, command, arg, doc
.location());
416 doc
.location().warning(QStringLiteral(
"Ignored '\\%1', applies only to '\\%2'")
418 }
else if (arg.isEmpty()) {
419 doc
.location().warning(QStringLiteral(
"Expected an argument for '\\%1' (maybe you meant '\\%2'?)")
431 doc.location().warning(
"Ignored '\\%1', applies only to '\\%2' and '\\%3'"_L1
435 if (!nativeEnum->resolve(argPair.first, argPair.second)) {
436 doc.location().warning(
"Failed to find C++ enumeration '%2' passed to \\%1"_L1
437 .arg(command, arg),
"Use \\value commands instead"_L1);
450 node->setDeprecated(argPair.second);
453 database->addToGroup(arg, node);
455 database->addToModule(arg, node);
467 const InclusionPolicy policy = Config::instance().createInclusionPolicy();
479 if (!node->setTitle(arg))
484 if (!node->setSubtitle(arg))
487 node->setQtVariable(arg);
491 "Command '\\%1' is only meaningful in '\\module' and '\\qmlmodule'.")
495 node->setCMakeComponent(arg);
498 QStringLiteral(
"Command '\\%1' is only meaningful in '\\module'.")
502 node->setCMakeTargetItem(QLatin1String(
"Qt6::") + arg);
505 QStringLiteral(
"Command '\\%1' is only meaningful in '\\module'.")
509 node->setCMakePackage(arg);
512 QStringLiteral(
"Command '\\%1' is only meaningful in '\\module'.")
516 node->setCMakeComponent(arg);
519 QStringLiteral(
"Command '\\%1' is only meaningful in '\\module'.")
523 node->setCMakeTargetItem(arg);
526 QStringLiteral(
"Command '\\%1' is only meaningful in '\\module'.")
532 "Command '\\%1' is only meaningful in '\\module' and '\\qmlmodule'.")
541 "Command '\\%1' is only meaningful in '\\module', '\\qmlmodule', `\\group` and `\\example`.")
571
572
573
574
575
576
577
581 loc.warning(u"Found \\%1 command outside of \\%2 context."_s.arg(
COMMAND_COMPARES,
586 if (
auto category = comparisonCategoryFromString(arg.toStdString());
587 category != ComparisonCategory::None) {
590 loc.warning(u"Invalid argument to \\%1 command: `%2`"_s.arg(
COMMAND_COMPARES, arg),
591 u"Valid arguments are `strong`, `weak`, `partial`, or `equality`."_s);
596
597
598
599
611 const auto &overloadArgs = doc.overloadList();
612 if (!overloadArgs.isEmpty()
613 && overloadArgs.first().first ==
"__qdoc_primary_overload__"_L1) {
634
635
636
637
638
641 std::vector<Node*> nodes_to_process{};
645 nodes_to_process.reserve(scn->count() + 1);
646 std::copy(scn->collective().cbegin(), scn->collective().cend(),
std::back_inserter(nodes_to_process));
659 nodes_to_process.push_back(node);
661 const QStringList metaCommandsUsed = doc.metaCommandsUsed().values();
662 for (
const auto &command : metaCommandsUsed) {
663 const ArgList args = doc.metaCommandArgs(command);
664 for (
const auto &arg : args) {
665 std::for_each(nodes_to_process.cbegin(), nodes_to_process.cend(), [
this, doc, command, arg](
auto node){
666 processMetaCommand(doc, command, arg, node);
673
674
675
676
677
678
680 const Location &location,
const QString &arg)
683 location.warning(u"Missing argument to \\%1 command."_s.arg(
COMMAND_QMLENUM));
694 auto *qmlType = findOrCreateQmlType((*parsedArgs).m_module, (*parsedArgs).m_qmltype, location);
696 auto *enumNode =
new QmlEnumNode(qmlType, (*parsedArgs).m_name);
697 enumNode->setLocation(location);
699 for (
const auto &item : enumItemNames)
700 enumNode->addItem(EnumItem(item, 0));
706
707
709 const QString &funcArg)
714 qsizetype leftParen = funcArg.indexOf(QChar(
'('));
716 funcName = funcArg.left(leftParen);
719 qsizetype firstBlank = funcName.indexOf(QChar(
' '));
720 if (firstBlank > 0) {
721 returnType = funcName.left(firstBlank);
722 funcName = funcName.right(funcName.size() - firstBlank - 1);
725 QStringList colonSplit(funcName.split(
"::"));
726 if (colonSplit.size() < 2) {
727 QString msg =
"Unrecognizable QML module/component qualifier for " + funcArg;
728 location.warning(msg.toLatin1().data());
733 if (colonSplit.size() > 2) {
734 moduleName = colonSplit[0];
735 elementName = colonSplit[1];
737 elementName = colonSplit[0];
739 funcName = colonSplit.last();
741 auto *aggregate = findOrCreateQmlType(moduleName, elementName, location);
744 QStringList leftParenSplit = funcArg.split(
'(');
745 if (leftParenSplit.size() > 1) {
746 QStringList rightParenSplit = leftParenSplit[1].split(
')');
747 if (!rightParenSplit.empty())
748 params = rightParenSplit[0];
752 bool attached = topic.contains(QLatin1String(
"attached"));
753 auto *fn =
new FunctionNode(metaness, aggregate, funcName, attached);
755 fn->setLocation(location);
756 fn->setReturnType(returnType);
757 fn->setParameters(params);
762
763
764
765
766
771 QStringList leftParenSplit = macroArg.split(
'(');
772 if (leftParenSplit.isEmpty())
776 QStringList blankSplit = leftParenSplit[0].split(
' ');
777 if (!blankSplit.empty()) {
778 macroName = blankSplit.last();
779 oldMacroNode = database->findMacroNode(macroName);
782 if (blankSplit.size() > 1) {
783 blankSplit.removeLast();
784 returnType = blankSplit.join(
' ');
787 if (leftParenSplit.size() > 1) {
788 params = QString(
"");
789 const QString &afterParen = leftParenSplit.at(1);
790 qsizetype rightParen = afterParen.indexOf(
')');
792 params = afterParen.left(rightParen);
795 while (i < macroName.size() && !macroName.at(i).isLetter())
798 returnType += QChar(
' ') + macroName.left(i);
799 macroName = macroName.mid(i);
806 macro->setLocation(location);
807 macro->setReturnType(returnType);
808 macro->setParameters(params);
809 if (oldMacroNode && macro->parent() == oldMacroNode
->parent()
810 && compare(macro, oldMacroNode) == 0) {
811 location.warning(QStringLiteral(
"\\macro %1 documented more than once")
812 .arg(macroArg), QStringLiteral(
"also seen here: %1")
813 .arg(oldMacroNode
->doc().location().toString()));
820 Config &config = Config::instance();
821 QString fullPath = config.getExampleProjectFile(en->name());
822 if (fullPath.isEmpty()) {
823 QString details = QLatin1String(
"Example directories: ")
826 QStringLiteral(
"Cannot find project file for example '%1'").arg(en->name()),
831 QDir exampleDir(QFileInfo(fullPath).dir());
835 QStringList exampleFiles = Config::getFilesHere(exampleDir.path(), m_exampleNameFilter,
836 Location(), excludeDirs, excludeFiles);
838 QSet<QString> excludeDocDirs(excludeDirs);
839 excludeDocDirs.insert(exampleDir.path() + QLatin1String(
"/doc/images"));
840 QStringList imageFiles = Config::getFilesHere(exampleDir.path(), m_exampleImageFilter,
841 Location(), excludeDocDirs, excludeFiles);
842 if (!exampleFiles.isEmpty()) {
846 const auto isGeneratedOrMainCpp = [&mainCpp](
const QString &fileName) {
847 if (fileName.endsWith(
"/main.cpp")) {
848 if (mainCpp.isEmpty())
852 return Utilities::isGeneratedFile(fileName);
856 std::remove_if(exampleFiles.begin(), exampleFiles.end(), isGeneratedOrMainCpp),
859 if (!mainCpp.isEmpty())
860 exampleFiles.append(mainCpp);
863 exampleFiles += Config::getFilesHere(exampleDir.path(),
864 QLatin1String(
"*.qrc *.pro *.qmlproject *.pyproject CMakeLists.txt qmldir"),
868 const qsizetype pathLen = exampleDir.path().size() - en->name().size();
869 for (
auto &file : exampleFiles)
870 file = file.mid(pathLen);
871 for (
auto &file : imageFiles)
872 file = file.mid(pathLen);
874 en->setFiles(exampleFiles, fullPath.mid(pathLen));
875 en->setImages(imageFiles);
879
880
881
889
890
891
897std::pair<std::vector<TiedDocumentation>, std::vector<FnMatchError>>
898CppCodeParser::processTopicArgs(
const UntiedDocumentation &untied)
900 const Doc &doc = untied.documentation;
902 if (doc.topicsUsed().isEmpty())
905 QDocDatabase *database = QDocDatabase::qdocDB();
907 const QString topic = doc.topicsUsed().first().m_topic;
909 std::vector<TiedDocumentation> tied{};
910 std::vector<FnMatchError> errors{};
912 if (isQMLPropertyTopic(topic)) {
913 auto tied_qml = processQmlProperties(untied);
914 tied.insert(tied.end(), tied_qml.begin(), tied_qml.end());
916 ArgList args = doc.metaCommandArgs(topic);
917 Node *node =
nullptr;
918 if (args.size() == 1) {
920 const InclusionPolicy policy = Config::instance().createInclusionPolicy();
921 if (InclusionFilter::processInternalDocs(policy) || !doc.isInternal()) {
922 auto result = fn_parser(doc.location(), args[0].first, args[0].second, untied.context);
923 if (
auto *error = std::get_if<FnMatchError>(&result))
924 errors.emplace_back(*error);
926 node = std::get<Node*>(result);
929 node = parseMacroArg(doc.location(), args[0].first);
930 }
else if (isQMLMethodTopic(topic)) {
931 node = parseOtherFuncArg(topic, doc.location(), args[0].first);
933 database->primaryTree()->addToDontDocumentMap(args[0].first);
935 node = processTopicCommand(doc, topic, args[0]);
937 if (node !=
nullptr) {
938 tied.emplace_back(TiedDocumentation{doc, node});
940 }
else if (args.size() > 1) {
941 QList<SharedCommentNode *> sharedCommentNodes;
942 for (
const auto &arg : std::as_const(args)) {
945 const InclusionPolicy policy = Config::instance().createInclusionPolicy();
946 if (InclusionFilter::processInternalDocs(policy) || !doc.isInternal()) {
947 auto result = fn_parser(doc.location(), arg.first, arg.second, untied.context);
948 if (
auto *error = std::get_if<FnMatchError>(&result))
949 errors.emplace_back(*error);
951 node = std::get<Node*>(result);
954 node = parseMacroArg(doc.location(), arg.first);
955 }
else if (isQMLMethodTopic(topic)) {
956 node = parseOtherFuncArg(topic, doc.location(), arg.first);
958 node = processTopicCommand(doc, topic, arg);
960 if (node !=
nullptr) {
962 for (SharedCommentNode *scn : sharedCommentNodes) {
963 if (scn->parent() == node->parent()) {
970 auto *scn =
new SharedCommentNode(node);
971 sharedCommentNodes.append(scn);
972 tied.emplace_back(TiedDocumentation{doc, scn});
976 for (
auto *scn : sharedCommentNodes) {
979 if (!scn->collective().isEmpty() && !scn->collective().first()->isFunction())
984 return std::make_pair(tied, errors);
988
989
990
993 if (n->physicalModuleName().isEmpty()) {
1005 n->setPhysicalModuleName(Generator::defaultModuleName());
1008 QStringLiteral(
"Documentation for %1 '%2' has no \\inmodule command; "
1009 "using project name by default: %3")
1011 n->physicalModuleName()));
1018 for (
auto [doc, node] : tied) {
1020 processMetaCommands(doc, node);
1021 checkModuleInclusion(node);
1022 if (node->isAggregate()) {
1023 auto *aggregate =
static_cast<Aggregate *>(node);
1025 if (!aggregate->includeFile()) {
1026 Aggregate *parent = aggregate;
1027 while (parent->physicalModuleName().isEmpty() && (parent->parent() !=
nullptr))
1028 parent = parent->parent();
1030 if (parent == aggregate)
1043 aggregate->setIncludeFile(aggregate->name());
1044 else if (aggregate->includeFile())
1045 aggregate->setIncludeFile(*parent->includeFile());
1051void CppCodeParser::processQmlNativeTypeCommand(
Node *node,
const QString &cmd,
const QString &arg,
const Location &location)
1056 QStringLiteral(
"Command '\\%1' is only meaningful in '\\%2'")
1064 auto classNode = database->findClassNode(arg.split(u"::"_s));
1067 if (m_showLinkErrors) {
1069 QStringLiteral(
"C++ class %2 not found: \\%1 %2")
1077 QStringLiteral(
"QML type %1 documented with %2 as its native type. Replacing %2 with %3")
1082 classNode->insertQmlNativeType(qmlNode);
1084 if (classNode->isQmlSingleton())
The ClassNode represents a C++ class.
static bool isWorthWarningAbout(const Doc &doc)
Test for whether a doc comment warrants warnings.
A class for holding the members of a collection of doc pages.
bool asBool() const
Returns this config variable as a boolean.
The Config class contains the configuration variables for controlling how qdoc produces documentation...
static bool generateExamples
const ExcludedPaths & getExcludedPaths()
std::vector< TiedDocumentation > processQmlProperties(const UntiedDocumentation &untied)
FunctionNode * parseOtherFuncArg(const QString &topic, const Location &location, const QString &funcArg)
Parse QML signal/method topic commands.
FunctionNode * parseMacroArg(const Location &location, const QString ¯oArg)
Parse the macro arguments in macroArg ad hoc, without using any actual parser.
void processMetaCommand(const Doc &doc, const QString &command, const ArgPair &argLocPair, Node *node)
Process the metacommand command in the context of the node associated with the topic command and the ...
CppCodeParser(FnCommandParser &&parser)
static bool isQMLMethodTopic(const QString &t)
returns true if t is {qmlsignal}, {qmlmethod}, {qmlattachedsignal}, or {qmlattachedmethod}...
void processMetaCommands(const std::vector< TiedDocumentation > &tied)
static bool isQMLPropertyTopic(const QString &t)
Returns true if t is {qmlproperty}, {qmlpropertygroup}, or {qmlattachedproperty}.
virtual Node * processTopicCommand(const Doc &doc, const QString &command, const ArgPair &arg)
Process the topic command found in the doc with argument arg.
void processMetaCommands(const Doc &doc, Node *node)
The topic command has been processed, and now doc and node are passed to this function to get the met...
const Location & location() const
Returns the starting location of a qdoc comment.
const Location & startLocation() const
Returns the starting location of a qdoc comment.
TopicList topicsUsed() const
Returns a reference to the list of topic commands used in the current qdoc comment.
The ExternalPageNode represents an external documentation page.
This node is used to represent any kind of function being documented.
void setReimpFlag()
Sets the function node's reimp flag to true, which means the {\reimp} command was used in the qdoc co...
const QString & overridesThis() const
void setPrimaryOverloadFlag()
static bool processInternalDocs(const InclusionPolicy &policy)
The Location class provides a way to mark a location in a file.
Location()
Constructs an empty location.
This class represents a C++ namespace.
Tree * tree() const override
Returns a pointer to the Tree that contains this NamespaceNode.
void markSeen()
Sets the data member that indicates that the {\namespace} command this NamespaceNode represents has b...
Interface implemented by Node subclasses that can refer to a C++ enum.
virtual NativeEnum * nativeEnum()=0
Encapsulates information about native (C++) enum values.
A PageNode is a Node that generates a documentation page.
void setNoAutoList(bool b)
Sets the no auto-list flag to b.
This class provides exclusive access to the qdoc database, which consists of a forrest of trees and a...
void addExampleNode(ExampleNode *n)
static QDocDatabase * qdocDB()
Creates the singleton.
NamespaceNode * primaryTreeRoot()
Returns a pointer to the root node of the primary tree.
ClassNode * classNode() override
If this is a QmlTypeNode, this function returns the pointer to the C++ ClassNode that this QML type r...
void setSingleton(bool singleton=true)
void setClassNode(ClassNode *cn) override
If this is a QmlTypeNode, this function sets the C++ class node to cn.
const QString & camelCaseModuleName() const
#define COMMAND_HEADERFILE
#define COMMAND_EXTERNALPAGE
#define COMMAND_QMLINHERITS
#define COMMAND_MODULESTATE
#define COMMAND_NONREENTRANT
#define COMMAND_QMLSIGNAL
#define COMMAND_DEPRECATED
#define COMMAND_QMLSINGLETONTYPE
#define COMMAND_PRELIMINARY
#define COMMAND_NAMESPACE
#define COMMAND_CMAKETARGETITEM
#define COMMAND_REENTRANT
#define COMMAND_QMLMODULE
#define COMMAND_QMLPROPERTY
#define COMMAND_STARTPAGE
#define COMMAND_QMLDEFAULT
#define COMMAND_QMLABSTRACT
#define COMMAND_QMLNATIVETYPE
#define COMMAND_QTVARIABLE
#define COMMAND_QTCMAKEPACKAGE
#define COMMAND_NOAUTOLIST
#define COMMAND_QMLATTACHEDPROPERTY
#define COMMAND_COMPARESWITH
#define COMMAND_QTCMAKETARGETITEM
#define COMMAND_INHEADERFILE
#define COMMAND_PREVIOUSPAGE
#define COMMAND_QMLBASICTYPE
#define COMMAND_THREADSAFE
#define COMMAND_QMLMETHOD
#define COMMAND_DONTDOCUMENT
#define COMMAND_CMAKECOMPONENT
#define COMMAND_QMLREADONLY
#define COMMAND_QMLENUMERATORSFROM
#define COMMAND_INPUBLICGROUP
#define COMMAND_QMLREQUIRED
#define COMMAND_QMLVALUETYPE
#define COMMAND_ATTRIBUTION
#define COMMAND_INQMLMODULE
#define COMMAND_QMLINSTANTIATES
#define COMMAND_TYPEALIAS
#define COMMAND_CMAKEPACKAGE
#define COMMAND_QMLATTACHEDMETHOD
#define COMMAND_QMLATTACHEDSIGNAL
#define CONFIG_FILEEXTENSIONS
#define CONFIG_EXAMPLEDIRS
#define CONFIG_NOLINKERRORS
#define CONFIG_IMAGEEXTENSIONS
static const QMap< QString, NodeTypeTestFunc > s_nodeTypeTestFuncMap
bool(Node::* NodeTypeTestFunc)() const
static void checkModuleInclusion(Node *n)
For each node that is part of C++ API and produces a documentation page, this function ensures that t...
QmlTypeNode * findOrCreateQmlType(const QString &moduleName, const QString &name, const Location &location)
Finds a QmlTypeNode name, under the specific moduleName, from the primary tree.
std::pair< QString, QString > ArgPair
This namespace holds QDoc-internal utility methods.
The Node class is the base class for all the nodes in QDoc's parse tree.
void markInternal()
Sets the node's access to Private and its status to Internal.
const Doc & doc() const
Returns a reference to the node's Doc data member.
bool isQmlNode() const
Returns true if this node's Genus value is QML.
void setAccess(Access t)
Sets the node's access type to t.
SharedCommentNode * sharedCommentNode()
bool isNamespace() const
Returns true if the node type is Namespace.
bool isTypedef() const
Returns true if the node type is Typedef.
bool isQmlType() const
Returns true if the node type is QmlType or QmlValueType.
bool isSharedCommentNode() const
Returns true if the node type is SharedComment.
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.
bool isStruct() const
Returns true if the node type is Struct.
virtual bool isTextPageNode() const
Returns true if the node is a PageNode but not an Aggregate.
Aggregate * parent() const
Returns the node's parent pointer.
bool isVariable() const
Returns true if the node type is Variable.
void setLocation(const Location &t)
Sets the node's declaration location, its definition location, or both, depending on the suffix of th...
virtual bool isAggregate() const
Returns true if this node is an aggregate, which means it inherits Aggregate and can therefore have c...
void setTemplateDecl(std::optional< RelaxedTemplateDeclaration > t)
virtual void markReadOnly(bool)
If this node is a QmlPropertyNode, then the property's read-only flag is set to flag.
void setComparisonCategory(const ComparisonCategory &category)
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
Access access() const
Returns the node's Access setting, which can be Public, Protected, or Private.
virtual void setWrapper()
If this node is a ClassNode or a QmlTypeNode, the node's wrapper flag data member is set to true.
bool isFunction(Genus g=Genus::DontCare) const
Returns true if this is a FunctionNode and its Genus is set to g.
virtual void markDefault()
If this node is a QmlPropertyNode, it is marked as the default property.
bool isProperty() const
Returns true if the node type is Property.
bool isTypeAlias() const
Returns true if the node type is Typedef.
bool isModule() const
Returns true if the node type is Module.
virtual void setAbstract(bool)
If this node is a ClassNode or a QmlTypeNode, the node's abstract flag data member is set to b.
virtual bool isInAPI() const
virtual bool isClassNode() const
Returns true if this is an instance of ClassNode.
void setStatus(Status t)
Sets the node's status to t.
virtual bool isCollectionNode() const
Returns true if this is an instance of CollectionNode.
void setThreadSafeness(ThreadSafeness t)
Sets the node's thread safeness to t.
bool isQmlModule() const
Returns true if the node type is QmlModule.
bool isExample() const
Returns true if the node type is Example.
bool isUnion() const
Returns true if the node type is Union.
bool isQmlProperty() const
Returns true if the node type is QmlProperty.
Helper class for parsing QML property arguments.
static std::optional< QmlPropertyArguments > parse(const QString &arg, const Location &loc, ParsingOptions opts=ParsingOptions::None)
Parses a QML property from the input string str, with parsing options opts.
ParsingOptions
\value None No options specified.
friend ParsingOptions operator|(ParsingOptions lhs, ParsingOptions rhs)