diff options
author | Topi Reinio <topi.reinio@qt.io> | 2021-11-26 14:58:04 +0100 |
---|---|---|
committer | Topi Reinio <topi.reinio@qt.io> | 2021-12-03 10:25:10 +0100 |
commit | 4a38f3be9c06c42690cf39e3f89c44f1c279fed3 (patch) | |
tree | 5e568159ffa17d747992dfb930c7ca46da7a2b45 /src/qdoc/cppcodeparser.cpp | |
parent | 61d6d6714ab1808df154b417484f994ff00711b1 (diff) | |
download | qttools-4a38f3be9c06c42690cf39e3f89c44f1c279fed3.tar.gz |
qdoc: Don't warn about \instantiates classes if -no-link-errors is set
The C++ class that a QML type \instantiates can be located in
another module. As -no-link-errors is set when testing documentation
builds of individual module without loading the .index files of any
dependencies, skip these warnings.
Clarify the potential causes of the warning in the documentation.
Fixes: QTBUG-98517
Change-Id: I3014541544269f81587fbfd2b13b6dcacf96731c
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'src/qdoc/cppcodeparser.cpp')
-rw-r--r-- | src/qdoc/cppcodeparser.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/qdoc/cppcodeparser.cpp b/src/qdoc/cppcodeparser.cpp index bf155c520..5314f3052 100644 --- a/src/qdoc/cppcodeparser.cpp +++ b/src/qdoc/cppcodeparser.cpp @@ -144,6 +144,8 @@ void CppCodeParser::initializeParser() m_exampleImageFilter = exampleImagePatterns.join(' '); else m_exampleImageFilter = "*.png"; + + m_showLinkErrors = !config.getBool(CONFIG_NOLINKERRORS); } /*! @@ -595,11 +597,16 @@ void CppCodeParser::processMetaCommand(const Doc &doc, const QString &command, ClassNode *classNode = m_qdb->findClassNode(arg.split("::")); if (classNode) node->setClassNode(classNode); - else + else if (m_showLinkErrors) { doc.location().warning( - QStringLiteral("C++ class %1 not found: \\instantiates %1").arg(arg)); - } else - doc.location().warning(QStringLiteral("\\instantiates is only allowed in \\qmltype")); + QStringLiteral("C++ class %2 not found: \\%1 %2") + .arg(command, arg)); + } + } else { + doc.location().warning( + QStringLiteral("\\%1 is only allowed in \\%2") + .arg(command, COMMAND_QMLTYPE)); + } } else if (command == COMMAND_DEFAULT) { if (!node->isQmlProperty()) { doc.location().warning(QStringLiteral("Ignored '\\%1', applies only to '\\%2'") |