summaryrefslogtreecommitdiffstats
path: root/tools/qdoc3
diff options
context:
space:
mode:
Diffstat (limited to 'tools/qdoc3')
-rw-r--r--tools/qdoc3/codemarker.cpp4
-rw-r--r--tools/qdoc3/codemarker.h3
-rw-r--r--tools/qdoc3/cppcodemarker.cpp45
-rw-r--r--tools/qdoc3/cppcodemarker.h3
-rw-r--r--tools/qdoc3/ditaxmlgenerator.cpp4
-rw-r--r--tools/qdoc3/generator.cpp7
-rw-r--r--tools/qdoc3/htmlgenerator.cpp102
-rw-r--r--tools/qdoc3/htmlgenerator.h5
-rw-r--r--tools/qdoc3/test/qt-html-templates.qdocconf9
9 files changed, 165 insertions, 17 deletions
diff --git a/tools/qdoc3/codemarker.cpp b/tools/qdoc3/codemarker.cpp
index 7130d61..ec86ae3 100644
--- a/tools/qdoc3/codemarker.cpp
+++ b/tools/qdoc3/codemarker.cpp
@@ -624,7 +624,9 @@ QString CodeMarker::macName(const Node *node, const QString &name)
Get the list of documentation sections for the children of
the specified QmlClassNode.
*/
-QList<Section> CodeMarker::qmlSections(const QmlClassNode* , SynopsisStyle )
+QList<Section> CodeMarker::qmlSections(const QmlClassNode* ,
+ SynopsisStyle ,
+ const Tree* )
{
return QList<Section>();
}
diff --git a/tools/qdoc3/codemarker.h b/tools/qdoc3/codemarker.h
index 53ad4a8..f17b28e 100644
--- a/tools/qdoc3/codemarker.h
+++ b/tools/qdoc3/codemarker.h
@@ -153,7 +153,8 @@ class CodeMarker
Status status) = 0;
#ifdef QDOC_QML
virtual QList<Section> qmlSections(const QmlClassNode* qmlClassNode,
- SynopsisStyle style);
+ SynopsisStyle style,
+ const Tree* tree);
#endif
virtual const Node* resolveTarget(const QString& target,
const Tree* tree,
diff --git a/tools/qdoc3/cppcodemarker.cpp b/tools/qdoc3/cppcodemarker.cpp
index 562e92b..3615a84 100644
--- a/tools/qdoc3/cppcodemarker.cpp
+++ b/tools/qdoc3/cppcodemarker.cpp
@@ -1127,7 +1127,8 @@ QString CppCodeMarker::addMarkUp(const QString& protectedCode,
Currently, it only handles QML property groups.
*/
QList<Section> CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode,
- SynopsisStyle style)
+ SynopsisStyle style,
+ const Tree* tree)
{
QList<Section> sections;
if (qmlClassNode) {
@@ -1244,6 +1245,48 @@ QList<Section> CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode,
append(sections,qmlmethods);
append(sections,qmlattachedmethods);
}
+ else {
+ FastSection all(qmlClassNode,"","","member","members");
+
+ QStack<const QmlClassNode*> stack;
+ stack.push(qmlClassNode);
+
+ while (!stack.isEmpty()) {
+ const QmlClassNode* ancestorClass = stack.pop();
+
+ NodeList::ConstIterator c = ancestorClass->childNodes().begin();
+ while (c != ancestorClass->childNodes().end()) {
+ // if ((*c)->access() != Node::Private)
+ if ((*c)->subType() == Node::QmlPropertyGroup) {
+ const QmlPropGroupNode* qpgn = static_cast<const QmlPropGroupNode*>(*c);
+ NodeList::ConstIterator p = qpgn->childNodes().begin();
+ while (p != qpgn->childNodes().end()) {
+ if ((*p)->type() == Node::QmlProperty) {
+ insert(all,*p,style,Okay);
+ }
+ ++p;
+ }
+ }
+ else
+ insert(all,*c,style,Okay);
+ ++c;
+ }
+
+ if (!ancestorClass->links().empty()) {
+ if (ancestorClass->links().contains(Node::InheritsLink)) {
+ QPair<QString,QString> linkPair;
+ linkPair = ancestorClass->links()[Node::InheritsLink];
+ QStringList strList(linkPair.first);
+ const Node* n = tree->findNode(strList,Node::Fake);
+ if (n && n->subType() == Node::QmlClass) {
+ const QmlClassNode* qcn = static_cast<const QmlClassNode*>(n);
+ stack.prepend(qcn);
+ }
+ }
+ }
+ }
+ append(sections, all);
+ }
}
return sections;
diff --git a/tools/qdoc3/cppcodemarker.h b/tools/qdoc3/cppcodemarker.h
index eca3936..804a302 100644
--- a/tools/qdoc3/cppcodemarker.h
+++ b/tools/qdoc3/cppcodemarker.h
@@ -80,7 +80,8 @@ class CppCodeMarker : public CodeMarker
SynopsisStyle style,
Status status);
QList<Section> qmlSections(const QmlClassNode* qmlClassNode,
- SynopsisStyle style);
+ SynopsisStyle style,
+ const Tree* tree);
const Node* resolveTarget(const QString& target,
const Tree* tree,
const Node* relative,
diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp
index 816ab9f..7892025 100644
--- a/tools/qdoc3/ditaxmlgenerator.cpp
+++ b/tools/qdoc3/ditaxmlgenerator.cpp
@@ -1764,7 +1764,7 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker
generateQmlInstantiates(qml_cn, marker);
generateBrief(qml_cn, marker);
generateQmlInheritedBy(qml_cn, marker);
- sections = marker->qmlSections(qml_cn,CodeMarker::Summary);
+ sections = marker->qmlSections(qml_cn,CodeMarker::Summary,0);
s = sections.begin();
while (s != sections.end()) {
out() << "<a name=\"" << registerRef((*s).name) << "\"></a>\n";
@@ -1781,7 +1781,7 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker
generateAlsoList(fake, marker);
out() << "<hr />\n";
- sections = marker->qmlSections(qml_cn,CodeMarker::Detailed);
+ sections = marker->qmlSections(qml_cn,CodeMarker::Detailed,0);
s = sections.begin();
while (s != sections.end()) {
out() << "<h2>" << protectEnc((*s).name) << "</h2>\n";
diff --git a/tools/qdoc3/generator.cpp b/tools/qdoc3/generator.cpp
index 24219a1..7f39be2 100644
--- a/tools/qdoc3/generator.cpp
+++ b/tools/qdoc3/generator.cpp
@@ -1068,8 +1068,11 @@ void Generator::generateSince(const Node *node, CodeMarker *marker)
Text text;
text << Atom::ParaLeft
<< "This "
- << typeString(node)
- << " was introduced in ";
+ << typeString(node);
+ if (node->type() == Node::Enum)
+ text << " was introduced or modified in ";
+ else
+ text << " was introduced in ";
if (project.isEmpty())
text << "version";
else
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index 356e615..9e8d768 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -1493,7 +1493,7 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker)
const QmlClassNode* qml_cn = 0;
if (fake->subType() == Node::QmlClass) {
qml_cn = static_cast<const QmlClassNode*>(fake);
- sections = marker->qmlSections(qml_cn,CodeMarker::Summary);
+ sections = marker->qmlSections(qml_cn,CodeMarker::Summary,0);
generateTableOfContents(fake,marker,&sections);
}
else if (fake->name() != QString("index.html"))
@@ -1575,6 +1575,13 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker)
generateQmlInherits(qml_cn, marker);
generateQmlInheritedBy(qml_cn, marker);
generateQmlInstantiates(qml_cn, marker);
+
+ QString allQmlMembersLink = generateAllQmlMembersFile(qml_cn, marker);
+ if (!allQmlMembersLink.isEmpty()) {
+ out() << "<li><a href=\"" << allQmlMembersLink << "\">"
+ << "List of all members, including inherited members</a></li>\n";
+ }
+
s = sections.begin();
while (s != sections.end()) {
out() << "<a name=\"" << registerRef((*s).name.toLower())
@@ -1594,7 +1601,7 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker)
generateExtractionMark(fake, EndMark);
//out() << "<hr />\n";
- sections = marker->qmlSections(qml_cn,CodeMarker::Detailed);
+ sections = marker->qmlSections(qml_cn,CodeMarker::Detailed,0);
s = sections.begin();
while (s != sections.end()) {
out() << "<h2>" << protectEnc((*s).name) << "</h2>\n";
@@ -1876,6 +1883,61 @@ void HtmlGenerator::generateHeader(const QString& title,
break;
}
+ navigationLinks.clear();
+
+ if (node && !node->links().empty()) {
+ QPair<QString,QString> linkPair;
+ QPair<QString,QString> anchorPair;
+ const Node *linkNode;
+
+ if (node->links().contains(Node::PreviousLink)) {
+ linkPair = node->links()[Node::PreviousLink];
+ linkNode = findNodeForTarget(linkPair.first, node, marker);
+ if (!linkNode || linkNode == node)
+ anchorPair = linkPair;
+ else
+ anchorPair = anchorForNode(linkNode);
+
+ out() << " <link rel=\"prev\" href=\""
+ << anchorPair.first << "\" />\n";
+
+ navigationLinks += "[Previous: <a href=\"" + anchorPair.first + "\">";
+ if (linkPair.first == linkPair.second && !anchorPair.second.isEmpty())
+ navigationLinks += protect(anchorPair.second);
+ else
+ navigationLinks += protect(linkPair.second);
+ navigationLinks += "</a>]\n";
+ }
+ if (node->links().contains(Node::NextLink)) {
+ linkPair = node->links()[Node::NextLink];
+ linkNode = findNodeForTarget(linkPair.first, node, marker);
+ if (!linkNode || linkNode == node)
+ anchorPair = linkPair;
+ else
+ anchorPair = anchorForNode(linkNode);
+
+ out() << " <link rel=\"next\" href=\""
+ << anchorPair.first << "\" />\n";
+
+ navigationLinks += "[Next: <a href=\"" + anchorPair.first + "\">";
+ if (linkPair.first == linkPair.second && !anchorPair.second.isEmpty())
+ navigationLinks += protect(anchorPair.second);
+ else
+ navigationLinks += protect(linkPair.second);
+ navigationLinks += "</a>]\n";
+ }
+ if (node->links().contains(Node::StartLink)) {
+ linkPair = node->links()[Node::StartLink];
+ linkNode = findNodeForTarget(linkPair.first, node, marker);
+ if (!linkNode || linkNode == node)
+ anchorPair = linkPair;
+ else
+ anchorPair = anchorForNode(linkNode);
+ out() << " <link rel=\"start\" href=\""
+ << anchorPair.first << "\" />\n";
+ }
+ }
+
#if 0 // Removed for new doc format. MWS
if (node && !node->links().empty())
out() << "<p>\n" << navigationLinks << "</p>\n";
@@ -1970,7 +2032,7 @@ void HtmlGenerator::generateIncludes(const InnerNode *inner, CodeMarker *marker)
}
/*!
- Generates a table of contents begining at \a node.
+ Generates a table of contents beginning at \a node.
*/
void HtmlGenerator::generateTableOfContents(const Node *node,
CodeMarker *marker,
@@ -2056,7 +2118,7 @@ void HtmlGenerator::generateTableOfContents(const Node *node,
/*!
Revised for the new doc format.
- Generates a table of contents begining at \a node.
+ Generates a table of contents beginning at \a node.
*/
void HtmlGenerator::generateTableOfContents(const Node *node,
CodeMarker *marker,
@@ -2234,6 +2296,38 @@ QString HtmlGenerator::generateListOfAllMemberFile(const InnerNode *inner,
return fileName;
}
+/*!
+ This function creates an html page on which are listed all
+ the members of QML class \a qml_cn, including the inherited
+ members. The \a marker is used for formatting stuff.
+ */
+QString HtmlGenerator::generateAllQmlMembersFile(const QmlClassNode* qml_cn,
+ CodeMarker* marker)
+{
+ QList<Section> sections;
+ QList<Section>::ConstIterator s;
+
+ sections = marker->qmlSections(qml_cn,CodeMarker::SeparateList,myTree);
+ if (sections.isEmpty())
+ return QString();
+
+ QString fileName = fileBase(qml_cn) + "-members." + fileExtension(qml_cn);
+ beginSubPage(qml_cn->location(), fileName);
+ QString title = "List of All Members for " + qml_cn->name();
+ generateHeader(title, qml_cn, marker);
+ generateTitle(title, Text(), SmallSubTitle, qml_cn, marker);
+ out() << "<p>This is the complete list of members for ";
+ generateFullName(qml_cn, 0, marker);
+ out() << ", including inherited members.</p>\n";
+
+ Section section = sections.first();
+ generateSectionList(section, 0, marker, CodeMarker::SeparateList);
+
+ generateFooter();
+ endSubPage();
+ return fileName;
+}
+
QString HtmlGenerator::generateLowStatusMemberFile(const InnerNode *inner,
CodeMarker *marker,
CodeMarker::Status status)
diff --git a/tools/qdoc3/htmlgenerator.h b/tools/qdoc3/htmlgenerator.h
index ec79896..07226f5 100644
--- a/tools/qdoc3/htmlgenerator.h
+++ b/tools/qdoc3/htmlgenerator.h
@@ -169,7 +169,10 @@ class HtmlGenerator : public PageGenerator
void generateTableOfContents(const Node *node,
CodeMarker *marker,
QList<Section>* sections = 0);
- QString generateListOfAllMemberFile(const InnerNode *inner, CodeMarker *marker);
+ QString generateListOfAllMemberFile(const InnerNode *inner,
+ CodeMarker *marker);
+ QString generateAllQmlMembersFile(const QmlClassNode* qml_cn,
+ CodeMarker* marker);
QString generateLowStatusMemberFile(const InnerNode *inner,
CodeMarker *marker,
CodeMarker::Status status);
diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf
index 67d7165..2d729fa 100644
--- a/tools/qdoc3/test/qt-html-templates.qdocconf
+++ b/tools/qdoc3/test/qt-html-templates.qdocconf
@@ -12,7 +12,7 @@ HTML.postheader = " <div class=\"header\" id=\"qtdocheader\">\n" \
" <div id=\"nav-logo\">\n" \
" <a href=\"index.html\">Home</a></div>\n" \
" <a href=\"index.html\" class=\"qtref\"><span>Qt Reference Documentation</span></a>\n" \
- " <div id=\"narrowsearch\"><form onsubmit=\"return false;\" action=\"\" id=\"qtdocsearch\">\n" \
+ " <div id=\"narrowsearch\"><form onsubmit=\"return false;\" action=\"\" id=\"qtdocsearchTop\">\n" \
" <fieldset>\n" \
" <input type=\"text\" value=\"\" id=\"pageType2\" name=\"searchstring\"/>\n" \
" </fieldset>\n" \
@@ -41,7 +41,7 @@ HTML.postheader = " <div class=\"header\" id=\"qtdocheader\">\n" \
" <li><a href=\"functions.html\">Function index</a></li> \n" \
" <li><a href=\"modules.html\">Modules</a></li> \n" \
" <li><a href=\"namespaces.html\">Namespaces</a></li> \n" \
- " <li><a href=\"qtglobal.html\">Global stuff</a></li> \n" \
+ " <li><a href=\"qtglobal.html\">Global Declarations</a></li> \n" \
" <li><a href=\"qdeclarativeelements.html\">QML elements</a></li> \n" \
" </ul> \n" \
" </li> \n" \
@@ -149,6 +149,7 @@ HTML.footer = " <!-- /div -->\n" \
" <span></span>\n" \
" </div>\n" \
" </div> \n" \
+ " </div> \n" \
" <div class=\"footer\">\n" \
" <p>\n" \
" <acronym title=\"Copyright\">&copy;</acronym> 2008-2010 Nokia Corporation and/or its\n" \
@@ -161,8 +162,8 @@ HTML.footer = " <!-- /div -->\n" \
" <div id=\"feedbackBox\">\n" \
" <div id=\"feedcloseX\" class=\"feedclose t_button\">X</div>\n" \
" <form id=\"feedform\" action=\"http://doc.qt.nokia.com/docFeedbck/feedback.php\" method=\"get\">\n" \
- " <p id=\"noteHead\">Thank you for giving your feedback. <div class=\"note\">Make sure it is related to this specific page. For more general bugs and \n" \
- " requests, please use the <a href=\"http://bugreports.qt.nokia.com/secure/Dashboard.jspa\">Qt Bug Tracker</a>.</div></p>\n" \
+ " <p id=\"noteHead\">Thank you for giving your feedback.</p> <div class=\"note\"><p>Make sure it is related to this specific page. For more general bugs and \n" \
+ " requests, please use the <a href=\"http://bugreports.qt.nokia.com/secure/Dashboard.jspa\">Qt Bug Tracker</a>.</p></div>\n" \
" <p><textarea id=\"feedbox\" name=\"feedText\" rows=\"5\" cols=\"40\"></textarea></p>\n" \
" <p><input id=\"feedsubmit\" class=\"feedclose\" type=\"submit\" name=\"feedback\" /></p>\n" \
" </form>\n" \