From bc40f304deb0f79b79364d674aac2761c6dcf6c5 Mon Sep 17 00:00:00 2001 From: Karsten Heimrich Date: Mon, 15 Feb 2016 16:47:59 +0100 Subject: qdoc: Second try on Q_PROPERTY with default and final. This is just because someone decided to use a C++ keyword as property, normaly this should fail, and it will for others like e.g. explicit, friend etc... Change-Id: Ie7f5b295c849d41291adeb3ad89f56800b2b10dd Reviewed-by: Martin Smith Reviewed-by: Friedemann Kleint --- src/qdoc/cppcodeparser.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/qdoc/cppcodeparser.cpp') diff --git a/src/qdoc/cppcodeparser.cpp b/src/qdoc/cppcodeparser.cpp index 7a930e3ad..03b74b83e 100644 --- a/src/qdoc/cppcodeparser.cpp +++ b/src/qdoc/cppcodeparser.cpp @@ -1179,7 +1179,7 @@ bool CppCodeParser::matchTemplateHeader() return matchTemplateAngles(); } -bool CppCodeParser::matchDataType(CodeChunk *dataType, QString *var) +bool CppCodeParser::matchDataType(CodeChunk *dataType, QString *var, bool qProp) { /* This code is really hard to follow... sorry. The loop is there to match @@ -1305,6 +1305,10 @@ bool CppCodeParser::matchDataType(CodeChunk *dataType, QString *var) if (varComment.exactMatch(previousLexeme())) *var = varComment.cap(1); } + else if (qProp && (match(Tok_default) || match(Tok_final))) { + // Hack to make 'default' and 'final' work again in Q_PROPERTY + *var = previousLexeme(); + } } if (tok == Tok_LeftBracket) { @@ -2015,7 +2019,7 @@ bool CppCodeParser::matchProperty(Aggregate *parent) QString name; CodeChunk dataType; - if (!matchDataType(&dataType, &name)) + if (!matchDataType(&dataType, &name, true)) return false; PropertyNode *property = new PropertyNode(parent, name); -- cgit v1.2.1