summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@qt.io>2019-11-13 13:34:34 +0100
committerTopi Reinio <topi.reinio@qt.io>2019-11-14 01:16:09 +0100
commit2d17116ef67618a53fa1f48e6ef601fd3c5596da (patch)
tree94180ade7089005affe61d5385959ce24f0443b4
parent0dec9c48e3ad47dc7673399e9115b1ca083feb21 (diff)
qdoc: Ignore the 'enum' keyword when parsing a Q_PROPERTY type
QDoc's parsing of property types is slightly naive, in that it cannot parse a type that consists of multiple words. These are not common, but we do have a few instances of Q_PROPERTY(enum EnumName ...) in the Qt source. This commit allows QDoc to parse above properties by ignoring the string 'enum'. Fixes: QTBUG-80027 Change-Id: I3b01d463b081042dd27299c2121fafa3c99b98ce Reviewed-by: Paul Wicking <paul.wicking@qt.io>
-rw-r--r--src/qdoc/clangcodeparser.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/qdoc/clangcodeparser.cpp b/src/qdoc/clangcodeparser.cpp
index 475becf4d..5d95c9c7e 100644
--- a/src/qdoc/clangcodeparser.cpp
+++ b/src/qdoc/clangcodeparser.cpp
@@ -899,6 +899,8 @@ void ClangVisitor::parseProperty(const QString &spelling, const Location &loc)
QString signature = spelling.mid(lpIdx + 1, rpIdx - lpIdx - 1);
signature = signature.simplified();
QStringList part = signature.split(QChar(' '));
+ if (part.first() == QLatin1String("enum"))
+ part.takeFirst(); // QTBUG-80027
if (part.size() < 2)
return;
QString type = part.at(0);