summaryrefslogtreecommitdiff
path: root/src/qdoc/doc.cpp
diff options
context:
space:
mode:
authorMartin Smith <martin.smith@qt.io>2017-11-09 14:15:45 +0100
committerMartin Smith <martin.smith@qt.io>2017-11-15 11:34:03 +0000
commitfee092c54b906fa4d06ef1f2867b6735081f8b4c (patch)
tree53bfe8a45ace3e45bcf301c51128a0fcd6507c52 /src/qdoc/doc.cpp
parent20ebbeb2a69dbe646a0d8dea347bab4a6adf1701 (diff)
downloadqttools-fee092c54b906fa4d06ef1f2867b6735081f8b4c.tar.gz
qdoc: Add optional since clause to \value command
This update adds the capability to include a since clause in a \value command. Without the since clause, a \value command might look like this: \value QtInfoMsg A message generated by the qInfo() function. The same command with a since clause would look like this: \value [since 5.5] QtInfoMsg A message generated by the qInfo() function. The since clause must be encosed in square brackets and must appear before the value name. Task-number: QTBUG-40782 Change-Id: If6cbb831c6f355eabcb0ddfdc284d2c9453f6245 Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Diffstat (limited to 'src/qdoc/doc.cpp')
-rw-r--r--src/qdoc/doc.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/qdoc/doc.cpp b/src/qdoc/doc.cpp
index 5f9ca669a..3708963ab 100644
--- a/src/qdoc/doc.cpp
+++ b/src/qdoc/doc.cpp
@@ -1329,7 +1329,12 @@ void DocParser::parse(const QString& source,
case CMD_VALUE:
leaveValue();
if (openedLists.top().style() == OpenedList::Value) {
+ QString p2;
p1 = getArgument();
+ if (p1.startsWith(QLatin1String("[since ")) && p1.endsWith(QLatin1String("]"))) {
+ p2 = p1.mid(7, p1.length() - 8);
+ p1 = getArgument();
+ }
if (!priv->enumItemList.contains(p1))
priv->enumItemList.append(p1);
@@ -1337,6 +1342,11 @@ void DocParser::parse(const QString& source,
append(Atom::ListTagLeft, ATOM_LIST_VALUE);
append(Atom::String, p1);
append(Atom::ListTagRight, ATOM_LIST_VALUE);
+ if (!p2.isEmpty()) {
+ append(Atom::SinceTagLeft, ATOM_LIST_VALUE);
+ append(Atom::String, p2);
+ append(Atom::SinceTagRight, ATOM_LIST_VALUE);
+ }
append(Atom::ListItemLeft, ATOM_LIST_VALUE);
skipSpacesOrOneEndl();