diff options
Diffstat (limited to 'tools/qdoc3/cppcodeparser.cpp')
-rw-r--r-- | tools/qdoc3/cppcodeparser.cpp | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/tools/qdoc3/cppcodeparser.cpp b/tools/qdoc3/cppcodeparser.cpp index fce2553..595756a 100644 --- a/tools/qdoc3/cppcodeparser.cpp +++ b/tools/qdoc3/cppcodeparser.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** @@ -863,10 +863,12 @@ Node *CppCodeParser::processTopicCommandGroup(const Doc& doc, } if (qmlPropGroup) { const ClassNode *correspondingClass = static_cast<const QmlClassNode*>(qmlPropGroup->parent())->classNode(); - PropertyNode *correspondingProperty = 0; - if (correspondingClass) - correspondingProperty = static_cast<PropertyNode*>((Node*)correspondingClass->findNode(property, Node::Property)); QmlPropertyNode *qmlPropNode = new QmlPropertyNode(qmlPropGroup,property,type,attached); + + const PropertyNode *correspondingProperty = 0; + if (correspondingClass) { + correspondingProperty = qmlPropNode->correspondingProperty(tre); + } if (correspondingProperty) { bool writableList = type.startsWith("list") && correspondingProperty->dataType().endsWith('*'); qmlPropNode->setWritable(writableList || correspondingProperty->isWritable()); @@ -1829,7 +1831,7 @@ bool CppCodeParser::matchProperty(InnerNode *parent) QString key = previousLexeme(); QString value; - if (match(Tok_Ident)) { + if (match(Tok_Ident) || match(Tok_Number)) { value = previousLexeme(); } else if (match(Tok_LeftParen)) { @@ -1872,8 +1874,15 @@ bool CppCodeParser::matchProperty(InnerNode *parent) tre->addPropertyFunction(property, value, PropertyNode::Resetter); else if (key == "NOTIFY") { tre->addPropertyFunction(property, value, PropertyNode::Notifier); - } - else if (key == "SCRIPTABLE") { + } else if (key == "REVISION") { + int revision; + bool ok; + revision = value.toInt(&ok); + if (ok) + property->setRevision(revision); + else + parent->doc().location().warning(tr("Invalid revision number: %1").arg(value)); + } else if (key == "SCRIPTABLE") { QString v = value.toLower(); if (v == "true") property->setScriptable(true); @@ -1884,7 +1893,7 @@ bool CppCodeParser::matchProperty(InnerNode *parent) property->setRuntimeScrFunc(value); } } - else if (key == "COSTANT") + else if (key == "CONSTANT") property->setConstant(); else if (key == "FINAL") property->setFinal(); |