diff options
author | Topi Reinio <topi.reinio@qt.io> | 2021-04-30 13:06:42 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-04-30 15:47:31 +0000 |
commit | 6cbb4366ac8878f82628e129ececdec288d86cfc (patch) | |
tree | 337de7e7f60e3e6edc56cc30b343f7d0049bc804 | |
parent | 57b586f1af401ea052d7188671abbda8602983e7 (diff) | |
download | qttools-6cbb4366ac8878f82628e129ececdec288d86cfc.tar.gz |
qdoc: Omit descriptions of enum values marked with \omitvalue
For \omitvalue <enum_value>, omit also single-line descriptions that
immediately follow <enum_value> or appear on a new line following the
\omitvalue command.
Fixes: QTBUG-92386
Change-Id: Id8a70ff48102075d3b18442547773ae7f3eefefa
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 924ff5057d7c16bd63c59f9479933231a8b5558b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/qdoc/doc/qdoc-manual-markupcmds.qdoc | 8 | ||||
-rw-r--r-- | src/qdoc/doc/qdoc-manual-topiccmds.qdoc | 1 | ||||
-rw-r--r-- | src/qdoc/docparser.cpp | 4 | ||||
-rw-r--r-- | tests/auto/qdoc/generatedoutput/testdata/scopedenum/scopedenum.qdoc | 3 |
4 files changed, 11 insertions, 5 deletions
diff --git a/src/qdoc/doc/qdoc-manual-markupcmds.qdoc b/src/qdoc/doc/qdoc-manual-markupcmds.qdoc index 4532f7cda..ee5387673 100644 --- a/src/qdoc/doc/qdoc-manual-markupcmds.qdoc +++ b/src/qdoc/doc/qdoc-manual-markupcmds.qdoc @@ -2637,9 +2637,11 @@ The \\omitvalue command excludes a C++ enum item from the documentation. - The command's only argument is the name of the enum item that will - be omitted. See the \l {enum-command} {\\enum} documentation for - an example. + The command's only mandatory argument is the name of the enum item + that will be omitted. If the enum item is followed by a single-line + description, that is also omitted. + + See the \l {enum-command} {\\enum} documentation for an example. See also \l {enum-command} {\\enum} and \l {value-command} {\\value} \l {since-command}{\\since} diff --git a/src/qdoc/doc/qdoc-manual-topiccmds.qdoc b/src/qdoc/doc/qdoc-manual-topiccmds.qdoc index bc1dfd6e3..97befbe50 100644 --- a/src/qdoc/doc/qdoc-manual-topiccmds.qdoc +++ b/src/qdoc/doc/qdoc-manual-topiccmds.qdoc @@ -306,6 +306,7 @@ \omitvalue TopRight \omitvalue BottomLeft \omitvalue BottomRight + Bottom-right (omitted; not documented). * / \endcode diff --git a/src/qdoc/docparser.cpp b/src/qdoc/docparser.cpp index c0d713a18..14e4aff9e 100644 --- a/src/qdoc/docparser.cpp +++ b/src/qdoc/docparser.cpp @@ -817,6 +817,8 @@ void DocParser::parse(const QString &source, DocPrivate *docPrivate, m_private->enumItemList.append(p1); if (!m_private->omitEnumItemList.contains(p1)) m_private->omitEnumItemList.append(p1); + skipSpacesOrOneEndl(); + getRestOfLine(); break; case CMD_PRINTLINE: { leavePara(); @@ -2289,7 +2291,7 @@ void DocParser::skipSpacesOnLine() } /*! - Skips spaces and on EOL. + Skips spaces and one EOL. */ void DocParser::skipSpacesOrOneEndl() { diff --git a/tests/auto/qdoc/generatedoutput/testdata/scopedenum/scopedenum.qdoc b/tests/auto/qdoc/generatedoutput/testdata/scopedenum/scopedenum.qdoc index fdef9dd18..1b1363db4 100644 --- a/tests/auto/qdoc/generatedoutput/testdata/scopedenum/scopedenum.qdoc +++ b/tests/auto/qdoc/generatedoutput/testdata/scopedenum/scopedenum.qdoc @@ -39,8 +39,9 @@ \value This Something \value That Something else - \value All Everything \omitvalue OmittedValue + This decription is omitted + \value All Everything */ /*! |