From de0db5ed1e7b5d08c2fe018d3ee2aa20d513d5c7 Mon Sep 17 00:00:00 2001 From: Martin Smith <martin.smith@qt.io> Date: Mon, 29 Jan 2018 14:56:57 +0100 Subject: [PATCH] qdoc: Delay ignoring of qt_xxx names until output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ignoreSymbol() function in class ClangVisitor was told to return true for every name that starts with "qt_". This was too aggressive, so the test is now done at output time. If a function name that starts with "qt_" has no documentation, qdoc does not warn with "No documentation for qt_..." because almost all such names are not to be documented. But they can be documented, so that's why the test is performed at the last moment. Change-Id: I2f322bed32dcae43336ead0735490560190d8095 Reviewed-by: Topi Reiniö <topi.reinio@qt.io> --- src/qdoc/clangcodeparser.cpp | 2 -- src/qdoc/generator.cpp | 11 ++++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/qdoc/clangcodeparser.cpp b/src/qdoc/clangcodeparser.cpp index ea4ffb18e..9cc3a7466 100644 --- a/src/qdoc/clangcodeparser.cpp +++ b/src/qdoc/clangcodeparser.cpp @@ -414,8 +414,6 @@ private: Returns true if the symbol should be ignored for the documentation. */ bool ignoredSymbol(const QString &symbolName) { - if (symbolName.startsWith(QLatin1String("qt_"))) - return true; if (symbolName == QLatin1String("QPrivateSignal")) return true; return false; diff --git a/src/qdoc/generator.cpp b/src/qdoc/generator.cpp index 760488bea..746b75b1f 100644 --- a/src/qdoc/generator.cpp +++ b/src/qdoc/generator.cpp @@ -838,15 +838,16 @@ void Generator::generateBody(const Node *node, CodeMarker *marker) else if (!node->isWrapper() && !quiet && !node->isReimplemented()) { bool report = true; /* - These are the member function names added by the macros - Q_OBJECT and Q_DECLARE_PRIVATE. Usually they are not - documented, but they can be documented, so this test - avoids reporting an error if they are not documented. + These are the member function names added by macros. + Usually they are not documented, but they can be + documented, so this test avoids reporting an error + if they are not documented. But maybe we should generate a standard text for each of them? */ - if (node->name() == QLatin1String("metaObject") || + if (node->name().startsWith(QLatin1String("qt_")) || + node->name() == QLatin1String("metaObject") || node->name() == QLatin1String("tr") || node->name() == QLatin1String("trUtf8") || node->name() == QLatin1String("d_func")) { -- GitLab