diff options
| author | Martin Smith <martin.smith@nokia.com> | 2012-04-11 12:50:22 +0200 |
|---|---|---|
| committer | Qt by Nokia <qt-info@nokia.com> | 2012-04-11 16:08:09 +0200 |
| commit | b1addf36c19748a29bd9f901579a23355b081fe9 (patch) | |
| tree | 1a8fd7924d593d744f9198d5173970825a8e44f6 /src/tools/qdoc/cppcodeparser.cpp | |
| parent | 3ddd768504f9f55c04bec9beb8eb9bac9a7e5edc (diff) | |
qdoc: Fixed to report read-only QML properties correctly
Now the default for a QML property is writable. If qdoc
can't detect the actual read-only status, writable is
assumed. There were some cases where qdoc could not
determine the actual read-only/writable status for a
QML property. In these cases, qdoc reported read-only
because the default was read-only, which was not optimal.
Change-Id: I55aeb2bedcde92a414f4d48a8d995e5e9dbca5da
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
Diffstat (limited to 'src/tools/qdoc/cppcodeparser.cpp')
| -rw-r--r-- | src/tools/qdoc/cppcodeparser.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/tools/qdoc/cppcodeparser.cpp b/src/tools/qdoc/cppcodeparser.cpp index b08c6f901c9..d0822fec1a2 100644 --- a/src/tools/qdoc/cppcodeparser.cpp +++ b/src/tools/qdoc/cppcodeparser.cpp @@ -937,7 +937,7 @@ Node *CppCodeParser::processTopicCommandGroup(const Doc& doc, if (splitQmlPropertyArg(doc,(*arg),type,module,element,property)) { QmlClassNode* qmlClass = tree_->findQmlClassNode(module,element); if (qmlClass) { - qmlPropGroup = new QmlPropGroupNode(qmlClass,property,attached); + qmlPropGroup = new QmlPropGroupNode(qmlClass,property); //,attached); } } if (qmlPropGroup) { @@ -950,7 +950,7 @@ Node *CppCodeParser::processTopicCommandGroup(const Doc& doc, } if (correspondingProperty) { bool writableList = type.startsWith("list") && correspondingProperty->dataType().endsWith('*'); - qmlPropNode->setWritable(writableList || correspondingProperty->isWritable()); + qmlPropNode->setReadOnly(!(writableList || correspondingProperty->isWritable())); } ++arg; while (arg != args.end()) { @@ -961,7 +961,7 @@ Node *CppCodeParser::processTopicCommandGroup(const Doc& doc, attached); if (correspondingProperty) { bool writableList = type.startsWith("list") && correspondingProperty->dataType().endsWith('*'); - qmlPropNode->setWritable(writableList || correspondingProperty->isWritable()); + qmlPropNode->setReadOnly(!(writableList || correspondingProperty->isWritable())); } } ++arg; @@ -1117,7 +1117,14 @@ void CppCodeParser::processOtherMetaCommand(const Doc& doc, } else if (node->type() == Node::Fake && node->subType() == Node::QmlPropertyGroup) { QmlPropGroupNode* qpgn = static_cast<QmlPropGroupNode*>(node); - qpgn->setDefault(); + NodeList::ConstIterator p = qpgn->childNodes().begin(); + while (p != qpgn->childNodes().end()) { + if ((*p)->type() == Node::QmlProperty) { + QmlPropertyNode* qpn = static_cast<QmlPropertyNode*>(*p); + qpn->setDefault(); + } + ++p; + } } } else if (command == COMMAND_QMLREADONLY) { @@ -1127,7 +1134,6 @@ void CppCodeParser::processOtherMetaCommand(const Doc& doc, } else if (node->type() == Node::Fake && node->subType() == Node::QmlPropertyGroup) { QmlPropGroupNode* qpgn = static_cast<QmlPropGroupNode*>(node); - qpgn->setReadOnly(1); NodeList::ConstIterator p = qpgn->childNodes().begin(); while (p != qpgn->childNodes().end()) { if ((*p)->type() == Node::QmlProperty) { |
