qdoc: Don't include internal QML properties in output
authorMartin Smith <martin.smith@nokia.com>
Tue, 15 May 2012 11:48:29 +0000 (13:48 +0200)
committerQt by Nokia <qt-info@nokia.com>
Tue, 15 May 2012 12:01:58 +0000 (14:01 +0200)
QML properties marked internal were still appearing in the
the HTML output. Also, the title for QML type pages was not
correct in the help project writer.

Change-Id: Icaad7cefce77a4af70796bc185c99a3035fb17c8
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
src/tools/qdoc/codemarker.cpp
src/tools/qdoc/codeparser.cpp
src/tools/qdoc/cppcodemarker.cpp
src/tools/qdoc/helpprojectwriter.cpp
src/tools/qdoc/htmlgenerator.cpp

index 00094a1..c0a781b 100644 (file)
@@ -397,8 +397,9 @@ void CodeMarker::insert(FastSection &fastSection,
     bool inheritedMember = false;
     if (!node->relates()) {
         if (node->parent() != (const InnerNode*)fastSection.innerNode && !node->parent()->isAbstract()) {
-            if (node->type() != Node::QmlProperty)
+            if (node->type() != Node::QmlProperty) {
                 inheritedMember = true;
+            }
         }
     }
 
index 1d0c486..71a82a7 100644 (file)
@@ -274,6 +274,17 @@ void CodeParser::processCommonMetaCommand(const Location& location,
         if (!showInternal) {
             node->setAccess(Node::Private);
             node->setStatus(Node::Internal);
+            if (node->subType() == Node::QmlPropertyGroup) {
+                const QmlPropGroupNode* qpgn = static_cast<const QmlPropGroupNode*>(node);
+                NodeList::ConstIterator p = qpgn->childNodes().begin();
+                while (p != qpgn->childNodes().end()) {
+                    if ((*p)->type() == Node::QmlProperty) {
+                        (*p)->setAccess(Node::Private);
+                        (*p)->setStatus(Node::Internal);
+                    }
+                    ++p;
+                }
+            }
         }
     }
     else if (command == COMMAND_REENTRANT) {
index 20c3316..9bfbebb 100644 (file)
@@ -1125,11 +1125,8 @@ QString CppCodeMarker::addMarkUp(const QString &in,
   This function is for documenting QML properties. It returns
   the list of documentation sections for the children of the
   \a qmlClassNode.
-
-  Currently, it only handles QML property groups.
  */
-QList<Section> CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode,
-                                          SynopsisStyle style)
+QList<Section> CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode, SynopsisStyle style)
 {
     QList<Section> sections;
     if (qmlClassNode) {
index 590feba..c5e4f59 100644 (file)
@@ -534,7 +534,10 @@ void HelpProjectWriter::writeNode(HelpProject &project, QXmlStreamWriter &writer
 
         writer.writeStartElement("section");
         writer.writeAttribute("ref", href);
-        writer.writeAttribute("title", fakeNode->fullTitle());
+        if (fakeNode->subType() == Node::QmlClass)
+            writer.writeAttribute("title", tr("%1 Type Reference").arg(fakeNode->fullTitle()));
+        else
+            writer.writeAttribute("title", fakeNode->fullTitle());
 
         if ((fakeNode->subType() == Node::HeaderFile) || (fakeNode->subType() == Node::QmlClass)) {
             // Write subsections for all members, obsolete members and Qt 3
index 4fa2bb6..11cfbff 100644 (file)
@@ -4025,8 +4025,6 @@ void HtmlGenerator::endLink()
 /*!
   Generates the summary for the \a section. Only used for
   sections of QML element documentation.
-
-  Currently handles only the QML property group.
  */
 void HtmlGenerator::generateQmlSummary(const Section& section,
                                        const Node *relative,