From 04511e3dbbcdf40489852babbf4753e0f744c26f Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Fri, 9 Oct 2009 14:25:22 +1000 Subject: Improve qdoc generated QML documentation. --- doc/src/declarative/elements.qdoc | 2 +- tools/qdoc3/config.h | 4 ++++ tools/qdoc3/cppcodemarker.cpp | 12 ++++++------ tools/qdoc3/doc.cpp | 4 ++++ tools/qdoc3/helpprojectwriter.cpp | 12 ++++++++++-- tools/qdoc3/node.cpp | 4 +++- tools/qdoc3/node.h | 2 ++ tools/qdoc3/test/qml.qdocconf | 5 ++++- 8 files changed, 34 insertions(+), 11 deletions(-) diff --git a/doc/src/declarative/elements.qdoc b/doc/src/declarative/elements.qdoc index cb30a6e..98c4ee1 100644 --- a/doc/src/declarative/elements.qdoc +++ b/doc/src/declarative/elements.qdoc @@ -40,7 +40,7 @@ ****************************************************************************/ /*! -\page elements.html +\page qmlelements.html \target elements \title QML Elements 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
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
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 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(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 = "  " \ "\n" \ "
" \ "" \ - "Home" \ + "Home ·" \ + " " \ + "Elements" \ "
" -- cgit v0.12