diff options
author | Karsten Heimrich <karsten.heimrich@theqtcompany.com> | 2016-02-15 16:47:59 +0100 |
---|---|---|
committer | Karsten Heimrich <karsten.heimrich@theqtcompany.com> | 2016-02-15 15:58:24 +0000 |
commit | bc40f304deb0f79b79364d674aac2761c6dcf6c5 (patch) | |
tree | c65e7a43356934f31cb77e89c741e855d9bd27b4 /src/qdoc/cppcodeparser.cpp | |
parent | 00676a162d97f5e0c955cef0212449943764961d (diff) | |
download | qttools-bc40f304deb0f79b79364d674aac2761c6dcf6c5.tar.gz |
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 <martin.smith@theqtcompany.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Diffstat (limited to 'src/qdoc/cppcodeparser.cpp')
-rw-r--r-- | src/qdoc/cppcodeparser.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
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); |