diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/configure/configureapp.cpp | 3 | ||||
-rw-r--r-- | tools/linguist/phrasebooks/russian.qph | 16 | ||||
-rw-r--r-- | tools/qdoc3/codemarker.cpp | 4 | ||||
-rw-r--r-- | tools/qdoc3/codemarker.h | 3 | ||||
-rw-r--r-- | tools/qdoc3/cppcodemarker.cpp | 45 | ||||
-rw-r--r-- | tools/qdoc3/cppcodemarker.h | 3 | ||||
-rw-r--r-- | tools/qdoc3/ditaxmlgenerator.cpp | 14 | ||||
-rw-r--r-- | tools/qdoc3/htmlgenerator.cpp | 99 | ||||
-rw-r--r-- | tools/qdoc3/htmlgenerator.h | 7 | ||||
-rw-r--r-- | tools/qdoc3/main.cpp | 15 | ||||
-rw-r--r-- | tools/qdoc3/test/qt-html-templates.qdocconf | 3 | ||||
-rw-r--r-- | tools/qdoc3/tree.cpp | 6 |
12 files changed, 156 insertions, 62 deletions
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index e27e16d..0c716d1 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -988,7 +988,6 @@ void Configure::parseCmdLine() ++i; if (i == argCount) break; - qmakeDefines += "QT_NAMESPACE="+configCmdLine.at(i); dictionary[ "QT_NAMESPACE" ] = configCmdLine.at(i); } else if (configCmdLine.at(i) == "-qtlibinfix") { ++i; @@ -2945,8 +2944,6 @@ void Configure::generateCachefile() configStream << "#namespaces" << endl << "QT_NAMESPACE = " << dictionary["QT_NAMESPACE"] << endl; } - configStream << "#modules" << endl << "for(mod,$$list($$files($$[QMAKE_MKSPECS]/modules/qt_*.pri))):include($$mod)" << endl; - configStream.flush(); configFile.close(); } diff --git a/tools/linguist/phrasebooks/russian.qph b/tools/linguist/phrasebooks/russian.qph index 750fda0..5876ee9 100644 --- a/tools/linguist/phrasebooks/russian.qph +++ b/tools/linguist/phrasebooks/russian.qph @@ -498,7 +498,7 @@ </phrase> <phrase> <source>Next</source> - <target>Следующий</target> + <target>Далее</target> </phrase> <phrase> <source>object</source> @@ -1070,7 +1070,7 @@ </phrase> <phrase> <source>Next</source> - <target>Далее</target> + <target>Следующий</target> </phrase> <phrase> <source>tree view</source> @@ -1204,4 +1204,16 @@ <source>Permission denied</source> <target>Доступ запрещён</target> </phrase> +<phrase> + <source>Previous</source> + <target>Предыдущий</target> +</phrase> +<phrase> + <source>Next</source> + <target>Следующее</target> +</phrase> +<phrase> + <source>Previous</source> + <target>Предыдущее</target> +</phrase> </QPH> 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..a83a321 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -544,6 +544,7 @@ void DitaXmlGenerator::generateTree(const Tree *tree, CodeMarker *marker) funcIndex.clear(); legaleseTexts.clear(); serviceClasses.clear(); + qmlClasses.clear(); findAllClasses(tree->root()); findAllFunctions(tree->root()); findAllLegaleseTexts(tree->root()); @@ -751,6 +752,9 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, else if (atom->string() == "classes") { generateCompactList(relative, marker, nonCompatClasses, true); } + else if (atom->string() == "qmlclasses") { + generateCompactList(relative, marker, qmlClasses, true); + } else if (atom->string().contains("classesbymodule")) { QString arg = atom->string().trimmed(); QString moduleName = atom->string().mid(atom->string().indexOf( @@ -1764,7 +1768,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 +1785,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"; @@ -3675,6 +3679,12 @@ void DitaXmlGenerator::findAllClasses(const InnerNode *node) if (!serviceName.isEmpty()) serviceClasses.insert(serviceName, *c); } + else if ((*c)->type() == Node::Fake && + (*c)->subType() == Node::QmlClass && + !(*c)->doc().isEmpty()) { + QString qmlClassName = (*c)->name(); + qmlClasses.insert(qmlClassName,*c); + } else if ((*c)->isInnerNode()) { findAllClasses(static_cast<InnerNode *>(*c)); } diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index d23b41e..50f8b56 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -293,12 +293,8 @@ void HtmlGenerator::initializeGenerator(const Config &config) application = Online; else if (app == "creator") application = Creator; - else if (app == "assistant") - application = Assistant; - else if (app == "base") - application = Assistant; else - application = Online; + application = Creator; projectDescription = config.getString(CONFIG_DESCRIPTION); if (projectDescription.isEmpty() && !project.isEmpty()) @@ -380,6 +376,7 @@ void HtmlGenerator::generateTree(const Tree *tree, CodeMarker *marker) funcIndex.clear(); legaleseTexts.clear(); serviceClasses.clear(); + qmlClasses.clear(); findAllClasses(tree->root()); findAllFunctions(tree->root()); findAllLegaleseTexts(tree->root()); @@ -615,6 +612,9 @@ int HtmlGenerator::generateAtom(const Atom *atom, else if (atom->string() == "classes") { generateCompactList(relative, marker, nonCompatClasses, true); } + else if (atom->string() == "qmlclasses") { + generateCompactList(relative, marker, qmlClasses, true); + } else if (atom->string().contains("classesbymodule")) { QString arg = atom->string().trimmed(); QString moduleName = atom->string().mid(atom->string().indexOf( @@ -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,§ions); } 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"; @@ -1717,7 +1724,7 @@ void HtmlGenerator::generateBreadCrumbs(const QString& title, out() << "</li>\n"; } if (!cn->name().isEmpty()) - out() << " <li>" << cn->name() << "</li>\n"; + out() << " <li>" << protectEnc(cn->name()) << "</li>\n"; } else if (node->type() == Node::Fake) { const FakeNode* fn = static_cast<const FakeNode*>(node); @@ -1725,52 +1732,50 @@ void HtmlGenerator::generateBreadCrumbs(const QString& title, out() << " <li><a href=\"modules.html\">Modules</a></li>"; QString name = node->name(); if (!name.isEmpty()) - out() << " <li>" << name << "</li>\n"; + out() << " <li>" << protectEnc(name) << "</li>\n"; } else if (node->subType() == Node::Group) { if (fn->name() == QString("modules")) out() << " <li>Modules</li>"; else { - out() << " <li>" << title << "</li>"; + out() << " <li>" << protectEnc(title) << "</li>"; } } else if (node->subType() == Node::Page) { if (fn->name() == QString("qdeclarativeexamples.html")) { out() << " <li><a href=\"all-examples.html\">Examples</a></li>"; - out() << " <li>QML Examples & Demos</li>"; + out() << " <li>QML Examples & Demos</li>"; } else if (fn->name().startsWith("examples-")) { out() << " <li><a href=\"all-examples.html\">Examples</a></li>"; - out() << " <li>" << title << "</li>"; + out() << " <li>" << protectEnc(title) << "</li>"; } else if (fn->name() == QString("namespaces.html")) { out() << " <li>Namespaces</li>"; } else { - out() << " <li>" << title << "</li>"; + out() << " <li>" << protectEnc(title) << "</li>"; } } else if (node->subType() == Node::QmlClass) { out() << " <li><a href=\"qdeclarativeelements.html\">QML Elements</a></li>"; - out() << " <li>" << title << "</li>"; + out() << " <li>" << protectEnc(title) << "</li>"; } else if (node->subType() == Node::Example) { out() << " <li><a href=\"all-examples.html\">Examples</a></li>"; QStringList sl = fn->name().split('/'); if (sl.contains("declarative")) - out() << " <li><a href=\"qdeclarativeexamples.html\">QML Examples & Demos</a></li>"; + out() << " <li><a href=\"qdeclarativeexamples.html\">QML Examples & Demos</a></li>"; else { - QString name = "examples-" + sl.at(0) + ".html"; // this generates an empty link + QString name = protectEnc("examples-" + sl.at(0) + ".html"); // this generates an empty link QString t = CodeParser::titleFromName(name); - // out() << " <li> <a href=\"" << name << "\">" - // << t << "</a></li>"; } - out() << " <li>" << title << "</li>"; + out() << " <li>" << protectEnc(title) << "</li>"; } } else if (node->type() == Node::Namespace) { out() << " <li><a href=\"namespaces.html\">Namespaces</a></li>"; - out() << " <li>" << title << "</li>"; + out() << " <li>" << protectEnc(title) << "</li>"; } } @@ -1836,10 +1841,6 @@ void HtmlGenerator::generateHeader(const QString& title, // CheckEmptyAndLoadList activating search out() << "<body class=\"\" onload=\"CheckEmptyAndLoadList();\">\n"; break; - case Assistant: - out() << "</head>\n"; - out() << "<body class=\"offline \">\n"; - break; case Creator: out() << "</head>\n"; out() << "<body class=\"offline narrow creator\">\n"; // offline narrow @@ -1861,11 +1862,6 @@ void HtmlGenerator::generateHeader(const QString& title, generateBreadCrumbs(title,node,marker); out() << QString(postPostHeader).replace("\\" + COMMAND_VERSION, myTree->version()); break; - case Assistant: - out() << QString(creatorPostHeader).replace("\\" + COMMAND_VERSION, myTree->version()); - generateBreadCrumbs(title,node,marker); - out() << QString(creatorPostPostHeader).replace("\\" + COMMAND_VERSION, myTree->version()); - break; case Creator: out() << QString(creatorPostHeader).replace("\\" + COMMAND_VERSION, myTree->version()); generateBreadCrumbs(title,node,marker); @@ -1983,9 +1979,6 @@ void HtmlGenerator::generateFooter(const Node *node) out() << " </script> -->\n"; out() << "</body>\n"; break; - case Assistant: - out() << "</body>\n"; - break; case Creator: out() << "</body>\n"; break; @@ -2027,7 +2020,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, @@ -2113,7 +2106,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, @@ -2291,6 +2284,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) @@ -3686,6 +3711,12 @@ void HtmlGenerator::findAllClasses(const InnerNode *node) if (!serviceName.isEmpty()) serviceClasses.insert(serviceName, *c); } + else if ((*c)->type() == Node::Fake && + (*c)->subType() == Node::QmlClass && + !(*c)->doc().isEmpty()) { + QString qmlClassName = (*c)->name(); + qmlClasses.insert(qmlClassName,*c); + } else if ((*c)->isInnerNode()) { findAllClasses(static_cast<InnerNode *>(*c)); } diff --git a/tools/qdoc3/htmlgenerator.h b/tools/qdoc3/htmlgenerator.h index ec79896..d885ada 100644 --- a/tools/qdoc3/htmlgenerator.h +++ b/tools/qdoc3/htmlgenerator.h @@ -97,7 +97,6 @@ class HtmlGenerator : public PageGenerator enum Application { Online, - Assistant, Creator}; public: @@ -169,7 +168,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); @@ -328,6 +330,7 @@ class HtmlGenerator : public PageGenerator NodeMap obsoleteClasses; NodeMap namespaceIndex; NodeMap serviceClasses; + NodeMap qmlClasses; QMap<QString, NodeMap > funcIndex; QMap<Text, const Node *> legaleseTexts; NewSinceMaps newSinceMaps; diff --git a/tools/qdoc3/main.cpp b/tools/qdoc3/main.cpp index 38b76a4..fa7efee 100644 --- a/tools/qdoc3/main.cpp +++ b/tools/qdoc3/main.cpp @@ -194,10 +194,7 @@ static void processQdocconfFile(const QString &fileName) /* Set the application to which qdoc will create the output. - The three applications are: - - base or assistant: simple, basic html output - for offline viewing in the Assistant application. + The two applications are: creator: additional formatting for viewing in the Creator application. @@ -207,9 +204,9 @@ static void processQdocconfFile(const QString &fileName) */ if (appArg.isEmpty()) { qDebug() << "Warning: Application flag not specified on" - << "command line. Options are -assistant, -creator," - << "and -online (default)."; - appArg = "online"; + << "command line. Options are -creator (default)" + << "and -online."; + appArg = "creator"; } config.setStringList(CONFIG_APPLICATION, QStringList(appArg)); @@ -484,10 +481,6 @@ int main(int argc, char **argv) else if (opt == "-obsoletelinks") { obsoleteLinks = true; } - else if (opt == "-base") - appArg = "base"; - else if (opt == "-assistant") - appArg = "assistant"; else if (opt == "-creator") appArg = "creator"; else if (opt == "-online") diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf index 70f3a40..71b13ff 100644 --- a/tools/qdoc3/test/qt-html-templates.qdocconf +++ b/tools/qdoc3/test/qt-html-templates.qdocconf @@ -166,4 +166,5 @@ HTML.footer = " <!-- /div -->\n" \ " </form>\n" \ " </div>\n" \ " <div id=\"blurpage\">\n" \ - " </div>\n" + " </div>\n" \ + " </div>\n" diff --git a/tools/qdoc3/tree.cpp b/tools/qdoc3/tree.cpp index 56e3484..540ffa9 100644 --- a/tools/qdoc3/tree.cpp +++ b/tools/qdoc3/tree.cpp @@ -1963,8 +1963,8 @@ QString Tree::fullDocumentLocation(const Node *node) const if ((node->subType() == Node::QmlClass) || (node->subType() == Node::QmlBasicType)) { QString fb = node->fileBase(); - if (fb.startsWith(QLatin1String("QML:"))) - return node->fileBase() + ".html"; + if (fb.startsWith(QLatin1String("qml-"))) + return fb + ".html"; else return "qml-" + node->fileBase() + ".html"; } else @@ -1981,7 +1981,7 @@ QString Tree::fullDocumentLocation(const Node *node) const else if ((parentNode = node->parent())) { if (parentNode->subType() == Node::QmlPropertyGroup) { parentNode = parentNode->parent(); - parentName = "qml-" + parentNode->fileBase() + ".html"; + parentName = fullDocumentLocation(parentNode); } else parentName = fullDocumentLocation(node->parent()); |