summaryrefslogtreecommitdiffstats
path: root/src/tools/qdoc/cppcodemarker.cpp
diff options
context:
space:
mode:
authorMartin Smith <martin.smith@digia.com>2013-07-10 13:47:47 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-07-11 13:36:37 +0200
commit2eb28f51ce4150fa03b2ddde8c39b502ae57d18a (patch)
treeed0d394872df0a14e9352b49f34552f317bdd647 /src/tools/qdoc/cppcodemarker.cpp
parentb06304e164ba47351fa292662c1e6383c081b5ca (diff)
qdoc: Implement better handling of QML property groups
The \qmlpropertygroup command is added, and qdoc is taught to generate better output for it. The format is, e.g.: \qmlpropertygroup QtQuick2::Item::anchors \qmlproperty AnchorLine QtQuick2::Item::anchors.top \qmlproperty AnchorLine QtQuick2::Item::anchors.bottom \qmlproperty AnchorLine QtQuick2::Item::anchors.left \qmlproperty AnchorLine QtQuick2::Item::anchors.right \qmlproperty AnchorLine QtQuick2::Item::anchors.horizontalCenter \qmlproperty AnchorLine QtQuick2::Item::anchors.verticalCenter \qmlproperty AnchorLine QtQuick2::Item::anchors.baseline \qmlproperty Item QtQuick2::Item::anchors.fill \qmlproperty Item QtQuick2::Item::anchors.centerIn \qmlproperty real QtQuick2::Item::anchors.margins \qmlproperty real QtQuick2::Item::anchors.topMargin \qmlproperty real QtQuick2::Item::anchors.bottomMargin \qmlproperty real QtQuick2::Item::anchors.leftMargin \qmlproperty real QtQuick2::Item::anchors.rightMargin \qmlproperty real QtQuick2::Item::anchors.horizontalCenterOffset \qmlproperty real QtQuick2::Item::anchors.verticalCenterOffset \qmlproperty real QtQuick2::Item::anchors.baselineOffset \qmlproperty bool QtQuick2::Item::anchors.alignWhenCentered Task-number: QTBUG-32341 Change-Id: I4b06a3a061b23680e663e8d4e82ac9863ffd4ecb Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Diffstat (limited to 'src/tools/qdoc/cppcodemarker.cpp')
-rw-r--r--src/tools/qdoc/cppcodemarker.cpp59
1 files changed, 9 insertions, 50 deletions
diff --git a/src/tools/qdoc/cppcodemarker.cpp b/src/tools/qdoc/cppcodemarker.cpp
index 75e49f288a..ad3c5cba47 100644
--- a/src/tools/qdoc/cppcodemarker.cpp
+++ b/src/tools/qdoc/cppcodemarker.cpp
@@ -1110,40 +1110,15 @@ QList<Section> CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode, Syno
while (qcn != 0) {
NodeList::ConstIterator c = qcn->childNodes().constBegin();
while (c != qcn->childNodes().constEnd()) {
- if ((*c)->subType() == Node::QmlPropertyGroup) {
- const QmlPropGroupNode* qpgn = static_cast<const QmlPropGroupNode*>(*c);
- NodeList::ConstIterator p = qpgn->childNodes().constBegin();
- while (p != qpgn->childNodes().constEnd()) {
- if ((*p)->type() == Node::QmlProperty) {
- const QmlPropertyNode* pn = static_cast<const QmlPropertyNode*>(*p);
- if (pn->isAttached())
- insert(qmlattachedproperties,*p,style,Okay);
- else
- insert(qmlproperties,*p,style,Okay);
- }
- ++p;
- }
+ if ((*c)->type() == Node::QmlPropertyGroup) {
+ insert(qmlproperties, *c, style, Okay);
}
else if ((*c)->type() == Node::QmlProperty) {
const QmlPropertyNode* pn = static_cast<const QmlPropertyNode*>(*c);
- if (pn->qmlPropNodes().isEmpty()) {
- if (pn->isAttached())
- insert(qmlattachedproperties,*c,style,Okay);
- else
- insert(qmlproperties,*c,style,Okay);
- }
+ if (pn->isAttached())
+ insert(qmlattachedproperties,*c,style,Okay);
else {
- NodeList::ConstIterator p = pn->qmlPropNodes().constBegin();
- while (p != pn->qmlPropNodes().constEnd()) {
- if ((*p)->type() == Node::QmlProperty) {
- const QmlPropertyNode* pn = static_cast<const QmlPropertyNode*>(*p);
- if (pn->isAttached())
- insert(qmlattachedproperties,*p,style,Okay);
- else
- insert(qmlproperties,*p,style,Okay);
- }
- ++p;
- }
+ insert(qmlproperties,*c,style,Okay);
}
}
else if ((*c)->type() == Node::QmlSignal) {
@@ -1196,24 +1171,8 @@ QList<Section> CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode, Syno
while (qcn != 0) {
NodeList::ConstIterator c = qcn->childNodes().constBegin();
while (c != qcn->childNodes().constEnd()) {
- if ((*c)->subType() == Node::QmlPropertyGroup) {
- bool attached = false;
- const QmlPropGroupNode* pgn = static_cast<const QmlPropGroupNode*>(*c);
- NodeList::ConstIterator C = pgn->childNodes().constBegin();
- while (C != pgn->childNodes().constEnd()) {
- if ((*C)->type() == Node::QmlProperty) {
- const QmlPropertyNode* pn = static_cast<const QmlPropertyNode*>(*C);
- if (pn->isAttached()) {
- attached = true;
- break;
- }
- }
- ++C;
- }
- if (attached)
- insert(qmlattachedproperties,*c,style,Okay);
- else
- insert(qmlproperties,*c,style,Okay);
+ if ((*c)->type() == Node::QmlPropertyGroup) {
+ insert(qmlproperties,*c,style,Okay);
}
else if ((*c)->type() == Node::QmlProperty) {
const QmlPropertyNode* pn = static_cast<const QmlPropertyNode*>(*c);
@@ -1278,8 +1237,8 @@ QList<Section> CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode, Syno
}
NodeList::ConstIterator c = current->childNodes().constBegin();
while (c != current->childNodes().constEnd()) {
- if ((*c)->subType() == Node::QmlPropertyGroup) {
- const QmlPropGroupNode* qpgn = static_cast<const QmlPropGroupNode*>(*c);
+ if ((*c)->type() == Node::QmlPropertyGroup) {
+ const QmlPropertyGroupNode* qpgn = static_cast<const QmlPropertyGroupNode*>(*c);
NodeList::ConstIterator p = qpgn->childNodes().constBegin();
while (p != qpgn->childNodes().constEnd()) {
if ((*p)->type() == Node::QmlProperty) {