summaryrefslogtreecommitdiffstats
path: root/tools/qdoc3
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2009-10-09 04:25:22 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2009-10-09 04:25:22 (GMT)
commit04511e3dbbcdf40489852babbf4753e0f744c26f (patch)
treecff71281999fd7385a06fb941762e64171cc4bd9 /tools/qdoc3
parentf21c1f444de012c38207ed93db8c3470cf197631 (diff)
downloadQt-04511e3dbbcdf40489852babbf4753e0f744c26f.zip
Qt-04511e3dbbcdf40489852babbf4753e0f744c26f.tar.gz
Qt-04511e3dbbcdf40489852babbf4753e0f744c26f.tar.bz2
Improve qdoc generated QML documentation.
Diffstat (limited to 'tools/qdoc3')
-rw-r--r--tools/qdoc3/config.h4
-rw-r--r--tools/qdoc3/cppcodemarker.cpp12
-rw-r--r--tools/qdoc3/doc.cpp4
-rw-r--r--tools/qdoc3/helpprojectwriter.cpp12
-rw-r--r--tools/qdoc3/node.cpp4
-rw-r--r--tools/qdoc3/node.h2
-rw-r--r--tools/qdoc3/test/qml.qdocconf5
7 files changed, 33 insertions, 10 deletions
diff --git a/tools/qdoc3/config.h b/tools/qdoc3/config.h
index 07cdb59..725129a 100644
--- a/tools/qdoc3/config.h
+++ b/tools/qdoc3/config.h
@@ -162,6 +162,10 @@ class Config
#define CONFIG_FILEEXTENSIONS "fileextensions"
+#ifdef QDOC_QML
+#define CONFIG_QMLONLY "qmlonly"
+#endif
+
QT_END_NAMESPACE
#endif
diff --git a/tools/qdoc3/cppcodemarker.cpp b/tools/qdoc3/cppcodemarker.cpp
index ed3d150..1062f9c 100644
--- a/tools/qdoc3/cppcodemarker.cpp
+++ b/tools/qdoc3/cppcodemarker.cpp
@@ -1109,15 +1109,15 @@ QList<Section> CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode,
if (qmlClassNode) {
if (style == Summary) {
FastSection qmlproperties(qmlClassNode,
- "QML Properties",
+ "Properties",
"property",
"properties");
FastSection qmlsignals(qmlClassNode,
- "QML Signals",
+ "Signals",
"signal",
"signals");
FastSection qmlmethods(qmlClassNode,
- "QML Methods",
+ "Methods",
"method",
"methods");
@@ -1146,9 +1146,9 @@ QList<Section> CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode,
append(sections,qmlmethods);
}
else if (style == Detailed) {
- FastSection qmlproperties(qmlClassNode,"QML Property Documentation");
- FastSection qmlsignals(qmlClassNode,"QML Signal Documentation");
- FastSection qmlmethods(qmlClassNode,"QML Method Documentation");
+ FastSection qmlproperties(qmlClassNode, "Property Documentation");
+ FastSection qmlsignals(qmlClassNode,"Signal Documentation");
+ FastSection qmlmethods(qmlClassNode,"Method Documentation");
NodeList::ConstIterator c = qmlClassNode->childNodes().begin();
while (c != qmlClassNode->childNodes().end()) {
if ((*c)->subType() == Node::QmlPropertyGroup) {
diff --git a/tools/qdoc3/doc.cpp b/tools/qdoc3/doc.cpp
index 748390f..f4931b8 100644
--- a/tools/qdoc3/doc.cpp
+++ b/tools/qdoc3/doc.cpp
@@ -2841,6 +2841,10 @@ void Doc::initialize(const Config& config)
DocParser::sourceDirs = config.getStringList(CONFIG_SOURCEDIRS);
DocParser::quoting = config.getBool(CONFIG_QUOTINGINFORMATION);
+#ifdef QDOC_QML
+ QmlClassNode::qmlOnly = config.getBool(CONFIG_QMLONLY);
+#endif
+
QStringMap reverseAliasMap;
QSet<QString> commands = config.subVars(CONFIG_ALIAS);
diff --git a/tools/qdoc3/helpprojectwriter.cpp b/tools/qdoc3/helpprojectwriter.cpp
index 4973387..52f54c0 100644
--- a/tools/qdoc3/helpprojectwriter.cpp
+++ b/tools/qdoc3/helpprojectwriter.cpp
@@ -187,8 +187,16 @@ QStringList HelpProjectWriter::keywordDetails(const Node *node) const
details << node->parent()->name()+"::"+node->name();
} else if (node->type() == Node::Fake) {
const FakeNode *fake = static_cast<const FakeNode *>(node);
- details << fake->fullTitle();
- details << fake->fullTitle();
+#ifdef QDOC_QML
+ if (fake->subType() == Node::QmlClass) {
+ details << (QmlClassNode::qmlOnly ? fake->name() : fake->fullTitle());
+ details << "QML." + fake->name();
+ } else
+#endif
+ {
+ details << fake->fullTitle();
+ details << fake->fullTitle();
+ }
} else {
details << node->name();
details << node->name();
diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp
index d547d20..42b73d9 100644
--- a/tools/qdoc3/node.cpp
+++ b/tools/qdoc3/node.cpp
@@ -1057,6 +1057,8 @@ bool TargetNode::isInnerNode() const
}
#ifdef QDOC_QML
+bool QmlClassNode::qmlOnly = false;
+
/*!
Constructor for the Qml class node.
*/
@@ -1065,7 +1067,7 @@ QmlClassNode::QmlClassNode(InnerNode *parent,
const ClassNode* cn)
: FakeNode(parent, name, QmlClass), cnode(cn)
{
- setTitle("QML " + name + " Element Reference");
+ setTitle((qmlOnly ? "" : "QML ") + name + " Element Reference");
}
/*!
diff --git a/tools/qdoc3/node.h b/tools/qdoc3/node.h
index 09f38d2..dfe882c 100644
--- a/tools/qdoc3/node.h
+++ b/tools/qdoc3/node.h
@@ -364,6 +364,8 @@ class QmlClassNode : public FakeNode
const ClassNode* classNode() const { return cnode; }
virtual QString fileBase() const;
+ static bool qmlOnly;
+
private:
const ClassNode* cnode;
};
diff --git a/tools/qdoc3/test/qml.qdocconf b/tools/qdoc3/test/qml.qdocconf
index 3a7d76a..3b5d8dc 100644
--- a/tools/qdoc3/test/qml.qdocconf
+++ b/tools/qdoc3/test/qml.qdocconf
@@ -7,6 +7,7 @@ include(qt-defines.qdocconf)
project = Qml
description = Qml Reference Documentation
url = http://doc.qtsoftware.com/4.6
+qmlonly = true
edition.Console.modules = QtCore QtDBus QtNetwork QtScript QtSql QtXml \
QtXmlPatterns QtTest
@@ -72,6 +73,8 @@ HTML.postheader = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0
"<td width=\"1\">&nbsp;&nbsp;</td>" \
"<td class=\"postheader\" valign=\"center\" align=\"left\">" \
"<a href=\"qmlreference.html\">" \
- "<font color=\"#004faf\">Home</font></a>" \
+ "<font color=\"#004faf\">Home</font></a>&nbsp;&middot;" \
+ " <a href=\"qmlelements.html\">" \
+ "<font color=\"#004faf\">Elements</font></a>" \
"</td>\n" \
"</tr></table>"