summaryrefslogtreecommitdiffstats
path: root/src/tools/qdoc/helpprojectwriter.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/helpprojectwriter.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/helpprojectwriter.cpp')
-rw-r--r--src/tools/qdoc/helpprojectwriter.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/tools/qdoc/helpprojectwriter.cpp b/src/tools/qdoc/helpprojectwriter.cpp
index 0cdb2de776..9e67007eba 100644
--- a/src/tools/qdoc/helpprojectwriter.cpp
+++ b/src/tools/qdoc/helpprojectwriter.cpp
@@ -135,6 +135,7 @@ void HelpProjectWriter::readSelectors(SubProject &subproject, const QStringList
typeHash["qmlsignal"] = Node::QmlSignal;
typeHash["qmlsignalhandler"] = Node::QmlSignalHandler;
typeHash["qmlmethod"] = Node::QmlMethod;
+ typeHash["qmlpropertygroup"] = Node::QmlPropertyGroup;
QHash<QString, Node::SubType> subTypeHash;
subTypeHash["example"] = Node::Example;
@@ -145,7 +146,6 @@ void HelpProjectWriter::readSelectors(SubProject &subproject, const QStringList
subTypeHash["page"] = Node::Page;
subTypeHash["externalpage"] = Node::ExternalPage;
subTypeHash["qmlclass"] = Node::QmlClass;
- subTypeHash["qmlpropertygroup"] = Node::QmlPropertyGroup;
subTypeHash["qmlbasictype"] = Node::QmlBasicType;
QSet<Node::SubType> allSubTypes = QSet<Node::SubType>::fromList(subTypeHash.values());
@@ -435,21 +435,24 @@ void HelpProjectWriter::generateSections(HelpProject &project,
continue;
if (childNode->type() == Node::Document) {
+ childMap[static_cast<const DocNode *>(childNode)->fullTitle()] = childNode;
+ }
+ else if (childNode->type() == Node::QmlPropertyGroup) {
/*
Don't visit QML property group nodes,
but visit their children, which are all
QML property nodes.
+
+ This is probably not correct anymore,
+ because The Qml Property Group is an
+ actual documented thing.
*/
- if (childNode->subType() == Node::QmlPropertyGroup) {
- const InnerNode* inner = static_cast<const InnerNode*>(childNode);
- foreach (const Node* n, inner->childNodes()) {
- if (n->access() == Node::Private)
- continue;
- childMap[n->fullDocumentName()] = n;
- }
+ const InnerNode* inner = static_cast<const InnerNode*>(childNode);
+ foreach (const Node* n, inner->childNodes()) {
+ if (n->access() == Node::Private)
+ continue;
+ childMap[n->fullDocumentName()] = n;
}
- else
- childMap[static_cast<const DocNode *>(childNode)->fullTitle()] = childNode;
}
else {
// Store member status of children