From 68dec6461ec700e871f28c8672be1f28740910e5 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Tue, 30 Jun 2015 12:40:44 +0200 Subject: qdoc: Parsing of inline friends Some functions in qstring.h are marked with both friend and inline, and qdoc ignores them when it sees the friend keyword. Then, when qdoc finds the documentation for the functions in the cpp file, it reports an error that it can't associate the documentation with anything it saw in a .h file. This update corrects that problem. It also improves qdoc's parsing of other inline functions in other files. Change-Id: If94e403809af3ee3238eac0f2861b027197d6d3c Task-number: QTBUG-46531 Reviewed-by: Martin Smith --- src/tools/qdoc/cppcodeparser.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/tools/qdoc/cppcodeparser.h') diff --git a/src/tools/qdoc/cppcodeparser.h b/src/tools/qdoc/cppcodeparser.h index 31964699a20..4fb428fc725 100644 --- a/src/tools/qdoc/cppcodeparser.h +++ b/src/tools/qdoc/cppcodeparser.h @@ -51,6 +51,15 @@ class CppCodeParser : public CodeParser { Q_DECLARE_TR_FUNCTIONS(QDoc::CppCodeParser) + struct ParsedParameter { + bool qPrivateSignal_; + QString dataType_; + QString name_; + QString defaultValue_; + ParsedParameter() : qPrivateSignal_(false) { } + }; + typedef QList ParsedParameterList; + struct ExtraFuncData { Aggregate* root; // Used as the parent. Node::NodeType type; // The node type: Function, etc. @@ -116,7 +125,7 @@ protected: bool matchTemplateAngles(CodeChunk *type = 0); bool matchTemplateHeader(); bool matchDataType(CodeChunk *type, QString *var = 0); - bool matchParameter(FunctionNode *func); + bool matchParameter(ParsedParameterList& pplist); bool matchFunctionDecl(Aggregate *parent, QStringList *parentPathPtr, FunctionNode **funcPtr, @@ -149,6 +158,7 @@ protected: const QString &includeFile, const QString ¯oDef); void createExampleFileNodes(DocumentNode *dn); + int matchFunctionModifier(); protected: QMap nodeTypeMap; -- cgit v1.2.3