qdoc: Further changes to the QML specialization
authorMartin Smith <martin.smith@nokia.com>
Mon, 30 Apr 2012 11:30:12 +0000 (13:30 +0200)
committerQt by Nokia <qt-info@nokia.com>
Tue, 1 May 2012 05:10:25 +0000 (07:10 +0200)
Re-adding <qmlInherits>, <qmlInheritedBy>,
<qmlInstantiates>, and <qmlSince>. Also adding
<qmlAttached>.

Change-Id: Iebd70a37b083bc404ce621d0bb9d3090dbc1109e
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
src/tools/qdoc/ditaxmlgenerator.cpp
src/tools/qdoc/ditaxmlgenerator.h
src/tools/qdoc/node.h

index a19bf45..0c88cbc 100644 (file)
@@ -221,6 +221,7 @@ QString DitaXmlGenerator::ditaTags[] =
     "prodname",
     "prolog",
     "publisher",
+    "qmlAttached",
     "qmlDetail",
     "qmlImportModule",
     "qmlInheritedBy",
@@ -4463,6 +4464,12 @@ void DitaXmlGenerator::startQmlProperty(QmlPropertyNode* qpn,
         xmlWriter().writeAttribute("value","default");
         writeEndTag(); // </qmlQualifier>
     }
+    if (qpn->isAttached()) {
+        writeStartTag(DT_qmlAttached);
+        xmlWriter().writeAttribute("name","attached");
+        xmlWriter().writeAttribute("value","yes");
+        writeEndTag(); // </qmlAttached>
+    }
     writeStartTag(DT_apiData);
     generateQmlItem(qpn, relative, marker, false);
     writeEndTag(); // </apiData>
@@ -4589,6 +4596,12 @@ void DitaXmlGenerator::writeQmlRef(DitaTag tag,
     QString marked = getMarkedUpSynopsis(n, relative, marker, CodeMarker::Detailed);
     writeText(marked, marker, relative);
     writeEndTag(); // </apiData>
+    if (node->isAttached()) {
+        writeStartTag(DT_qmlAttached);
+        xmlWriter().writeAttribute("name","attached");
+        xmlWriter().writeAttribute("value","yes");
+        writeEndTag(); // </qmlAttached>
+    }
     writeEndTag(); // </qmlXxxDef>
     writeQmlDesc(node, marker);
     writeEndTag(); // </qmlXxxDetail>
@@ -4636,9 +4649,9 @@ void DitaXmlGenerator::generateQmlInherits(const QmlClassNode* qcn, CodeMarker*
         return;
     const FakeNode* base = qcn->qmlBase();
     if (base) {
-        //writeStartTag(DT_qmlInherits);
-        writeStartTag(DT_qmlTypeDef);
-        xmlWriter().writeAttribute("outputclass","inherits");
+        writeStartTag(DT_qmlInherits);
+        //writeStartTag(DT_qmlTypeDef);
+        //xmlWriter().writeAttribute("outputclass","inherits");
         writeStartTag(DT_apiData);
         Text text;
         text << Atom(Atom::LinkNode,CodeMarker::stringForNode(base));
@@ -4661,9 +4674,9 @@ void DitaXmlGenerator::generateQmlInheritedBy(const QmlClassNode* qcn, CodeMarke
         NodeList subs;
         QmlClassNode::subclasses(qcn->name(),subs);
         if (!subs.isEmpty()) {
-            //writeStartTag(DT_qmlInheritedBy);
-            writeStartTag(DT_qmlTypeDef);
-            xmlWriter().writeAttribute("outputclass","inherited-by");
+            writeStartTag(DT_qmlInheritedBy);
+            //writeStartTag(DT_qmlTypeDef);
+            //xmlWriter().writeAttribute("outputclass","inherited-by");
             writeStartTag(DT_apiData);
             Text text;
             appendSortedQmlNames(text,qcn,subs,marker);
@@ -4686,9 +4699,9 @@ void DitaXmlGenerator::generateQmlInstantiates(QmlClassNode* qcn, CodeMarker* ma
 {
     ClassNode* cn = qcn->classNode();
     if (cn && (cn->status() != Node::Internal)) {
-        //writeStartTag(DT_qmlInstantiates);
-        writeStartTag(DT_qmlTypeDef);
-        xmlWriter().writeAttribute("outputclass","instantiates");
+        writeStartTag(DT_qmlInstantiates);
+        //writeStartTag(DT_qmlTypeDef);
+        //xmlWriter().writeAttribute("outputclass","instantiates");
         writeStartTag(DT_apiData);
         Text text;
         text << Atom(Atom::LinkNode,CodeMarker::stringForNode(cn));
@@ -4707,9 +4720,9 @@ void DitaXmlGenerator::generateQmlInstantiates(QmlClassNode* qcn, CodeMarker* ma
 void DitaXmlGenerator::generateQmlSince(const Node* node)
 {
     if (!node->since().isEmpty()) {
-        //writeStartTag(DT_qmlSince);
-        writeStartTag(DT_qmlTypeDef);
-        xmlWriter().writeAttribute("outputclass","since");
+        writeStartTag(DT_qmlSince);
+        //writeStartTag(DT_qmlTypeDef);
+        //xmlWriter().writeAttribute("outputclass","since");
         writeStartTag(DT_apiItemName);
         QStringList pieces = node->since().split(QLatin1Char(' '));
         writeCharacters(pieces[0]);
index b5deabd..538a667 100644 (file)
@@ -230,6 +230,7 @@ public:
         DT_prodname,
         DT_prolog,
         DT_publisher,
+        DT_qmlAttached,
         DT_qmlDetail,
         DT_qmlImportModule,
         DT_qmlInheritedBy,
index 44b4973..b0be5f0 100644 (file)
@@ -190,6 +190,7 @@ public:
     virtual bool isAbstract() const { return false; }
     virtual bool isQmlPropertyGroup() const { return false; }
     virtual bool isCollisionNode() const { return false; }
+    virtual bool isAttached() const { return false; }
     virtual void setAbstract(bool ) { }
     virtual QString title() const { return QString(); }
     bool isInternal() const;
@@ -613,8 +614,8 @@ public:
     bool isStored() const { return fromFlagValue(stored_,true); }
     bool isDesignable() const { return fromFlagValue(designable_,false); }
     bool isWritable(Tree* tree);
-    bool isAttached() const { return attached_; }
     bool isReadOnly() const { return fromFlagValue(readOnly_,false); }
+    virtual bool isAttached() const { return attached_; }
     virtual bool isQmlNode() const { return true; }
     virtual bool isQtQuickNode() const { return parent()->isQtQuickNode(); }
     virtual QString qmlModuleName() const { return parent()->qmlModuleName(); }
@@ -788,7 +789,7 @@ public:
     QStringList reconstructParams(bool values = false) const;
     QString signature(bool values = false) const;
     const QString& element() const { return parent()->name(); }
-    bool isAttached() const { return attached_; }
+    virtual bool isAttached() const { return attached_; }
     virtual bool isQmlNode() const {
         return ((type() == QmlSignal) ||
                 (type() == QmlMethod) ||