summaryrefslogtreecommitdiffstats
path: root/tools/qdoc3/htmlgenerator.cpp
diff options
context:
space:
mode:
authorMartin Smith <msmith@trolltech.com>2010-02-18 12:47:38 (GMT)
committerMartin Smith <msmith@trolltech.com>2010-02-18 12:47:38 (GMT)
commit85628b1798ec4c98333c8f4529f5d5628f3f1bbb (patch)
tree0edeb41cd7b3c62730ad71db4fd113565845de58 /tools/qdoc3/htmlgenerator.cpp
parente0a674a5f5735e964d28af3d704757862f74e0b3 (diff)
downloadQt-85628b1798ec4c98333c8f4529f5d5628f3f1bbb.zip
Qt-85628b1798ec4c98333c8f4529f5d5628f3f1bbb.tar.gz
Qt-85628b1798ec4c98333c8f4529f5d5628f3f1bbb.tar.bz2
qdoc: Added "Inherited by" list to QML elements.
But the listed elements are not links yet, just plain text. Task: QTBUG-8153
Diffstat (limited to 'tools/qdoc3/htmlgenerator.cpp')
-rw-r--r--tools/qdoc3/htmlgenerator.cpp46
1 files changed, 46 insertions, 0 deletions
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index e341a03..01e79dd 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -1525,6 +1525,7 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker)
generateQmlInherits(qml_cn, marker);
generateQmlInstantiates(qml_cn, marker);
generateBrief(qml_cn, marker);
+ generateQmlInheritedBy(qml_cn, marker);
sections = marker->qmlSections(qml_cn,CodeMarker::Summary);
s = sections.begin();
while (s != sections.end()) {
@@ -4309,6 +4310,51 @@ void HtmlGenerator::generateQmlInherits(const QmlClassNode* cn,
}
/*!
+ Output the "Inherit by" list for the QML element,
+ if it is inherited by any other elements.
+ */
+void HtmlGenerator::generateQmlInheritedBy(const QmlClassNode* cn,
+ CodeMarker* marker)
+{
+ if (cn) {
+ QStringList subs;
+ QmlClassNode::subclasses(cn->name(),subs);
+ if (!subs.isEmpty()) {
+ subs.sort();
+ Text text;
+ text << Atom::ParaLeft << "Inherited by ";
+ for (int i = 0; i < subs.size(); ++i) {
+ text << subs.at(i);
+ text << separator(i, subs.size());
+ }
+ text << Atom::ParaRight;
+ generateText(text, cn, marker);
+ }
+#if 0
+ if (cn->links().contains(Node::InheritsLink)) {
+ QPair<QString,QString> linkPair;
+ linkPair = cn->links()[Node::InheritsLink];
+ QStringList strList(linkPair.first);
+ const Node* n = myTree->findNode(strList,Node::Fake);
+ if (n && n->subType() == Node::QmlClass) {
+ const QmlClassNode* qcn = static_cast<const QmlClassNode*>(n);
+ out() << "<p style=\"text-align: center\">";
+ Text text;
+ text << "[Inherits ";
+ text << Atom(Atom::LinkNode,CodeMarker::stringForNode(qcn));
+ text << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK);
+ text << Atom(Atom::String, linkPair.second);
+ text << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK);
+ text << "]";
+ generateText(text, cn, marker);
+ out() << "</p>";
+ }
+ }
+#endif
+ }
+}
+
+/*!
Output the "[Xxx instantiates the C++ class QmlGraphicsXxx]"
line for the QML element, if there should be one.