diff options
author | Paul Wicking <paul.wicking@qt.io> | 2024-02-08 14:26:24 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2024-02-08 16:59:00 +0000 |
commit | 02b8f03d53bfbb4f95c8c7685d1a568f11bcf563 (patch) | |
tree | e4e6aaeb4de14c2b5f64d31adeaa9b86c120324c | |
parent | 5d9586c11a0cedf01f01e367befd09eb5647fd4a (diff) |
QDoc: Don't change state when command doesn't apply
Ensure that state isn't changed if the requirements for
COMMAND_QTCMAKEPACKAGE are satisfied.
Pick-to: 6.6 6.5
Change-Id: I791c8e323dd430efcbeb448e76a27e2ffe305b3f
Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
(cherry picked from commit 68d77bfe9286f5c52679916ba1503424f3cd076b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/qdoc/qdoc/src/qdoc/cppcodeparser.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/qdoc/qdoc/src/qdoc/cppcodeparser.cpp b/src/qdoc/qdoc/src/qdoc/cppcodeparser.cpp index a8bb4a313..84d33d2fe 100644 --- a/src/qdoc/qdoc/src/qdoc/cppcodeparser.cpp +++ b/src/qdoc/qdoc/src/qdoc/cppcodeparser.cpp @@ -567,8 +567,9 @@ void CppCodeParser::processMetaCommand(const Doc &doc, const QString &command, "Command '\\%1' is only meaningful in '\\module' and '\\qmlmodule'.") .arg(COMMAND_QTVARIABLE)); } else if (command == COMMAND_QTCMAKEPACKAGE) { - node->setQtCMakeComponent(arg); - if (!node->isModule()) + if (node->isModule()) + node->setQtCMakeComponent(arg); + else doc.location().warning( QStringLiteral("Command '\\%1' is only meaningful in '\\module'.") .arg(COMMAND_QTCMAKEPACKAGE)); |