From 214521bf8dbf477949373fc2fbbf3ebe5dc1de37 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Thu, 14 Jul 2022 14:44:45 +0200 Subject: qdoc: Introduce \modulestate command This command can be used in \module or \qmlmodule topic to describe a module state other than \preliminary or \deprecated. A typical use case is to mark modules in tech. preview: /*! \module QFoo \modulestate Techical Preview ... */ This information is displayed on the module page itself, as well as on the navigation bar of the module's member reference pages. Introduce a new function, QDocDatabase::getModuleNode() that retrieves the associated module node for any other Node instance. Use this in HtmlGenerator::generateNavigation() and also in Tree::resolveSince() to avoid code duplication. Fixes: QTBUG-104591 Change-Id: Ifd85e769f6df6f06ed9938da4f9981b22a56e19e Reviewed-by: Luca Di Sera --- src/qdoc/cppcodeparser.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/qdoc/cppcodeparser.cpp') diff --git a/src/qdoc/cppcodeparser.cpp b/src/qdoc/cppcodeparser.cpp index 6c1959503..a4a6c53fd 100644 --- a/src/qdoc/cppcodeparser.cpp +++ b/src/qdoc/cppcodeparser.cpp @@ -672,6 +672,15 @@ void CppCodeParser::processMetaCommand(const Doc &doc, const QString &command, doc.location().warning( QStringLiteral("Command '\\%1' is only meaningful in '\\module'.") .arg(COMMAND_QTCMAKEPACKAGE)); + } else if (command == COMMAND_MODULESTATE ) { + if (!node->isModule() && !node->isQmlModule()) { + doc.location().warning( + QStringLiteral( + "Command '\\%1' is only meaningful in '\\module' and '\\qmlmodule'.") + .arg(COMMAND_MODULESTATE)); + } else { + static_cast(node)->setState(arg); + } } else if (command == COMMAND_NOAUTOLIST) { node->setNoAutoList(true); } -- cgit v1.2.1