summaryrefslogtreecommitdiffstats
path: root/tools/qdoc3/cppcodemarker.cpp
diff options
context:
space:
mode:
authorMartin Smith <msmith@trolltech.com>2009-10-19 11:50:24 (GMT)
committerMartin Smith <msmith@trolltech.com>2009-10-19 11:51:53 (GMT)
commitf16fc0150fce1d78cc71c27c163baf45e8953aca (patch)
tree4ee6be62ef2c24cda3387ecb6815fb374b0b49a3 /tools/qdoc3/cppcodemarker.cpp
parent7a647e8c9efbbd46184bc4714159c82ae26be958 (diff)
downloadQt-f16fc0150fce1d78cc71c27c163baf45e8953aca.zip
Qt-f16fc0150fce1d78cc71c27c163baf45e8953aca.tar.gz
Qt-f16fc0150fce1d78cc71c27c163baf45e8953aca.tar.bz2
qdoc3: Added the \qmlattachedproperty command.
It works just like the \qmlproperty command, except that it puts the properties in a different section for attached properties.
Diffstat (limited to 'tools/qdoc3/cppcodemarker.cpp')
-rw-r--r--tools/qdoc3/cppcodemarker.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/tools/qdoc3/cppcodemarker.cpp b/tools/qdoc3/cppcodemarker.cpp
index ed3d150..36293f8 100644
--- a/tools/qdoc3/cppcodemarker.cpp
+++ b/tools/qdoc3/cppcodemarker.cpp
@@ -1112,6 +1112,10 @@ QList<Section> CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode,
"QML Properties",
"property",
"properties");
+ FastSection qmlattachedproperties(qmlClassNode,
+ "QML Attached Properties",
+ "property",
+ "properties");
FastSection qmlsignals(qmlClassNode,
"QML Signals",
"signal",
@@ -1128,7 +1132,11 @@ QList<Section> CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode,
NodeList::ConstIterator p = qpgn->childNodes().begin();
while (p != qpgn->childNodes().end()) {
if ((*p)->type() == Node::QmlProperty) {
- insert(qmlproperties,*p,style,Okay);
+ const QmlPropertyNode* pn = static_cast<const QmlPropertyNode*>(*p);
+ if (pn->isAttached())
+ insert(qmlattachedproperties,*p,style,Okay);
+ else
+ insert(qmlproperties,*p,style,Okay);
}
++p;
}
@@ -1142,17 +1150,23 @@ QList<Section> CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode,
++c;
}
append(sections,qmlproperties);
+ append(sections,qmlattachedproperties);
append(sections,qmlsignals);
append(sections,qmlmethods);
}
else if (style == Detailed) {
FastSection qmlproperties(qmlClassNode,"QML Property Documentation");
+ FastSection qmlattachedproperties(qmlClassNode,"QML Attached Property Documentation");
FastSection qmlsignals(qmlClassNode,"QML Signal Documentation");
FastSection qmlmethods(qmlClassNode,"QML Method Documentation");
NodeList::ConstIterator c = qmlClassNode->childNodes().begin();
while (c != qmlClassNode->childNodes().end()) {
if ((*c)->subType() == Node::QmlPropertyGroup) {
- insert(qmlproperties,*c,style,Okay);
+ const QmlPropGroupNode* pgn = static_cast<const QmlPropGroupNode*>(*c);
+ if (pgn->isAttached())
+ insert(qmlattachedproperties,*c,style,Okay);
+ else
+ insert(qmlproperties,*c,style,Okay);
}
else if ((*c)->type() == Node::QmlSignal) {
insert(qmlsignals,*c,style,Okay);
@@ -1163,6 +1177,7 @@ QList<Section> CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode,
++c;
}
append(sections,qmlproperties);
+ append(sections,qmlattachedproperties);
append(sections,qmlsignals);
append(sections,qmlmethods);
}