2f35879649
Examples in Qt's codebase must be tagged with specific categories such that Qt Creator can group them thematically. This can be done by way of using the `\meta category` construct in QDoc. At the same time, we want the generated documentation to group the examples by the same logic as in Qt Creator. Hence, QDoc was modified to implicitly add a group for each category that is used in a `meta category` invocation. By design, QDoc exposes ways to list groups to users, but no way to list the \meta command invocations. Letting QDoc implicitly add a group for categories passed to the \meta command as a side-effect, therefore breaks with the principle of least surprise and the single responsibility principle. An alternative solution makes use of QDoc's existing support for code generation through macros. This patch introduces the macro `\examplecategory` as a global macro throughout Qt to achieve the same effect as the aforementioned change to QDoc. The macro takes an argument enclosed in curly braces. This argument is the example category name. It's used as meta information in the manifest files consumed by Qt Creator, and added as the category group name for the QDoc side at the same time. The introduction of this macro allows reverting the change to QDoc itself, while maintaining feature parity for both Qt Creator and the generated content. Task-number: QTBUG-111891 Pick-to: 6.5 Change-Id: I311b98168253b45ac456ff3c1824db3d835191a9 Reviewed-by: Luca Di Sera <luca.disera@qt.io> |
||
---|---|---|
.. | ||
externalsites | ||
includes | ||
includes-online | ||
snippets/code | ||
template | ||
compat.qdocconf | ||
config.qdocconf | ||
externalsites.qdocconf | ||
fileextensions.qdocconf | ||
html-config.qdocconf | ||
html-footer-online.qdocconf | ||
html-footer.qdocconf | ||
html-header-offline.qdocconf | ||
html-header-online.qdocconf | ||
htmltabs.qdocconf | ||
macros-online.qdocconf | ||
macros.qdocconf | ||
manifest-meta.qdocconf | ||
qt-cpp-defines.qdocconf | ||
qt-html-templates-offline-simple.qdocconf | ||
qt-html-templates-offline.qdocconf | ||
qt-html-templates-online.qdocconf | ||
qt-module-defaults-offline.qdocconf | ||
qt-module-defaults-online-commercial.qdocconf | ||
qt-module-defaults-online.qdocconf | ||
qt-module-defaults.qdocconf |