diff options
author | Bea Lam <bea.lam@nokia.com> | 2009-10-21 00:43:19 (GMT) |
---|---|---|
committer | Bea Lam <bea.lam@nokia.com> | 2009-10-21 00:43:19 (GMT) |
commit | f6b1582d726f97d8be4b30f0f6da2350220f27c5 (patch) | |
tree | 64bcea1b8b3cc8f94073a9e83b36b2b40ad990e8 /tools | |
parent | 110c58a20f3158143d83ebea4f2ece4f7925f913 (diff) | |
parent | 7bd7f5ec6eb520b7d9940a24817b17132d9ed6a2 (diff) | |
download | Qt-f6b1582d726f97d8be4b30f0f6da2350220f27c5.zip Qt-f6b1582d726f97d8be4b30f0f6da2350220f27c5.tar.gz Qt-f6b1582d726f97d8be4b30f0f6da2350220f27c5.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'tools')
-rw-r--r-- | tools/assistant/lib/qhelpsearchquerywidget.cpp | 2 | ||||
-rw-r--r-- | tools/assistant/translations/qt_help.pro | 4 | ||||
-rw-r--r-- | tools/assistant/translations/translations_adp.pro | 2 | ||||
-rw-r--r-- | tools/configure/configureapp.cpp | 5 | ||||
-rw-r--r-- | tools/configure/tools.cpp | 2 | ||||
-rw-r--r-- | tools/designer/translations/translations.pro | 5 | ||||
-rw-r--r-- | tools/porting/src/filewriter.cpp | 14 | ||||
-rw-r--r-- | tools/qdoc3/codemarker.h | 2 | ||||
-rw-r--r-- | tools/qdoc3/cppcodemarker.cpp | 19 | ||||
-rw-r--r-- | tools/qdoc3/cppcodeparser.cpp | 29 | ||||
-rw-r--r-- | tools/qdoc3/htmlgenerator.cpp | 512 | ||||
-rw-r--r-- | tools/qdoc3/htmlgenerator.h | 60 | ||||
-rw-r--r-- | tools/qdoc3/node.cpp | 120 | ||||
-rw-r--r-- | tools/qdoc3/node.h | 33 | ||||
-rw-r--r-- | tools/qdoc3/test/qt-api-only-with-xcode.qdocconf | 29 | ||||
-rw-r--r-- | tools/qdoc3/test/qt-build-docs-with-xcode.qdocconf | 3 | ||||
-rw-r--r-- | tools/qdoc3/test/qt-with-xcode.qdocconf | 3 | ||||
-rw-r--r-- | tools/qtestlib/wince/cetest/main.cpp | 2 |
18 files changed, 535 insertions, 311 deletions
diff --git a/tools/assistant/lib/qhelpsearchquerywidget.cpp b/tools/assistant/lib/qhelpsearchquerywidget.cpp index 9ac4a7d..361e9ac 100644 --- a/tools/assistant/lib/qhelpsearchquerywidget.cpp +++ b/tools/assistant/lib/qhelpsearchquerywidget.cpp @@ -229,7 +229,7 @@ private: const QList<QHelpSearchQuery> &query = queryHist->queries.at(queryHist->curQuery); foreach (const QHelpSearchQuery &queryPart, query) { - QLineEdit *lineEdit; + QLineEdit *lineEdit = 0; switch (queryPart.fieldName) { case QHelpSearchQuery::DEFAULT: lineEdit = defaultQuery; diff --git a/tools/assistant/translations/qt_help.pro b/tools/assistant/translations/qt_help.pro index 69570d3..0133ea4 100644 --- a/tools/assistant/translations/qt_help.pro +++ b/tools/assistant/translations/qt_help.pro @@ -42,11 +42,9 @@ HEADERS += ../lib/qhelpcollectionhandler_p.h \ TR_DIR = $$PWD/../../../translations TRANSLATIONS = \ $$TR_DIR/qt_help_da.ts \ - $$TR_DIR/qt_help_de.ts + $$TR_DIR/qt_help_de.ts \ $$TR_DIR/qt_help_ja.ts \ $$TR_DIR/qt_help_pl.ts \ $$TR_DIR/qt_help_ru.ts \ $$TR_DIR/qt_help_zh_CN.ts \ $$TR_DIR/qt_help_zh_TW.ts - -error("This is a dummy profile to be used for translations ONLY.") diff --git a/tools/assistant/translations/translations_adp.pro b/tools/assistant/translations/translations_adp.pro index 852bdeb..f8da2e3 100644 --- a/tools/assistant/translations/translations_adp.pro +++ b/tools/assistant/translations/translations_adp.pro @@ -39,5 +39,3 @@ TRANSLATIONS = \ $$TR_DIR/assistant_adp_ru.ts \ $$TR_DIR/assistant_adp_zh_CN.ts \ $$TR_DIR/assistant_adp_zh_TW.ts - -error("This is a dummy profile to be used for translations ONLY.") diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 4d1a025..5cafbfe 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -1470,6 +1470,9 @@ void Configure::applySpecSpecifics() dictionary[ "SQL_SQLITE" ] = "yes"; dictionary[ "SQL_SQLITE_LIB" ] = "system"; + // Disable building docs and translations for now + disabledBuildParts << "docs" << "translations"; + } else if(dictionary[ "XQMAKESPEC" ].startsWith("linux")) { //TODO actually wrong. //TODO dictionary[ "STYLE_WINDOWSXP" ] = "no"; @@ -3729,7 +3732,7 @@ void Configure::readLicense() (dictionary.value("QMAKESPEC").startsWith("wince") || dictionary.value("XQMAKESPEC").startsWith("wince"))) dictionary["PLATFORM NAME"] = "Qt for Windows CE"; else if (dictionary.value("XQMAKESPEC").startsWith("symbian")) - dictionary["PLATFORM NAME"] = "Qt for S60"; + dictionary["PLATFORM NAME"] = "Qt for Symbian"; else dictionary["PLATFORM NAME"] = "Qt for Windows"; dictionary["LICENSE FILE"] = sourcePath; diff --git a/tools/configure/tools.cpp b/tools/configure/tools.cpp index 0d170f5..c958dd9 100644 --- a/tools/configure/tools.cpp +++ b/tools/configure/tools.cpp @@ -152,7 +152,7 @@ void Tools::checkLicense(QMap<QString,QString> &dictionary, QMap<QString,QString if (platforms == 'X') { dictionary["LICENSE_EXTENSION"] = "-ALLOS"; - } else if (strchr("3679ACDEHJKMSUWX", platforms)) { + } else if (strchr("2346789ABCDEGHJKMPQSTUVWX", platforms)) { dictionary["LICENSE_EXTENSION"] = "-EMBEDDED"; } else if (strchr("4BFPQRTY", platforms)) { dictionary["LICENSE_EXTENSION"] = "-DESKTOP"; diff --git a/tools/designer/translations/translations.pro b/tools/designer/translations/translations.pro index a37918c..2323882 100644 --- a/tools/designer/translations/translations.pro +++ b/tools/designer/translations/translations.pro @@ -82,7 +82,6 @@ SOURCES += $$APP_DIR/appfontdialog.cpp \ $$APP_DIR/main.cpp \ $$APP_DIR/mainwindow.cpp \ $$APP_DIR/newform.cpp \ - $$APP_DIR/plugindialog.cpp \ $$APP_DIR/preferencesdialog.cpp \ $$APP_DIR/qdesigner_actions.cpp \ $$APP_DIR/qdesigner_appearanceoptions.cpp \ @@ -100,7 +99,6 @@ HEADERS+= $$APP_DIR/appfontdialog.h \ $$APP_DIR/designer_enums.h \ $$APP_DIR/mainwindow.h \ $$APP_DIR/newform.h \ - $$APP_DIR/plugindialog.h \ $$APP_DIR/preferencesdialog.h \ $$APP_DIR/qdesigner_actions.h \ $$APP_DIR/qdesigner_appearanceoptions.h \ @@ -114,8 +112,7 @@ HEADERS+= $$APP_DIR/appfontdialog.h \ $$APP_DIR/saveformastemplate.h \ $$APP_DIR/versiondialog.h -FORMS += $$APP_DIR/plugindialog.ui \ - $$APP_DIR/preferencesdialog.ui \ +FORMS += $$APP_DIR/preferencesdialog.ui \ $$APP_DIR/qdesigner_appearanceoptions.ui \ $$APP_DIR/saveformastemplate.ui diff --git a/tools/porting/src/filewriter.cpp b/tools/porting/src/filewriter.cpp index ee8debb..99bd6e7 100644 --- a/tools/porting/src/filewriter.cpp +++ b/tools/porting/src/filewriter.cpp @@ -44,6 +44,7 @@ #include <QFileInfo> #include <QDir> #include <ctype.h> +#include <errno.h> QT_BEGIN_NAMESPACE @@ -106,11 +107,18 @@ FileWriter::WriteResult FileWriter::writeFile(QString filePath, QByteArray conte char answer = 0; while (answer != 'y' && answer != 'n' && answer != 'a') { #if defined(Q_OS_WIN) && defined(_MSC_VER) && _MSC_VER >= 1400 - scanf_s("%c", &answer); + int result = scanf_s("%c", &answer); #else - scanf("%c", &answer); + int result = scanf("%c", &answer); #endif - answer = tolower(answer); + if (1 == result) + answer = tolower(answer); + else if (EOF == result) { + if (EINTR == errno || EILSEQ == errno) + continue; + + answer = 'n'; + } } if(answer == 'n') diff --git a/tools/qdoc3/codemarker.h b/tools/qdoc3/codemarker.h index e400f8a..9858484 100644 --- a/tools/qdoc3/codemarker.h +++ b/tools/qdoc3/codemarker.h @@ -71,6 +71,8 @@ struct Section : name(name0), singularMember(singularMember0), pluralMember(pluralMember0) { } + void appendMember(Node* node) { members.append(node); } + void appendReimpMember(Node* node) { reimpMembers.append(node); } }; struct FastSection diff --git a/tools/qdoc3/cppcodemarker.cpp b/tools/qdoc3/cppcodemarker.cpp index 1062f9c..3bee3d9 100644 --- a/tools/qdoc3/cppcodemarker.cpp +++ b/tools/qdoc3/cppcodemarker.cpp @@ -1112,6 +1112,10 @@ QList<Section> CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode, "Properties", "property", "properties"); + FastSection qmlattachedproperties(qmlClassNode, + "Attached Properties", + "property", + "properties"); FastSection qmlsignals(qmlClassNode, "Signals", "signal", @@ -1128,7 +1132,11 @@ QList<Section> CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode, NodeList::ConstIterator p = qpgn->childNodes().begin(); while (p != qpgn->childNodes().end()) { if ((*p)->type() == Node::QmlProperty) { - insert(qmlproperties,*p,style,Okay); + const QmlPropertyNode* pn = static_cast<const QmlPropertyNode*>(*p); + if (pn->isAttached()) + insert(qmlattachedproperties,*p,style,Okay); + else + insert(qmlproperties,*p,style,Okay); } ++p; } @@ -1142,17 +1150,23 @@ QList<Section> CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode, ++c; } append(sections,qmlproperties); + append(sections,qmlattachedproperties); append(sections,qmlsignals); append(sections,qmlmethods); } else if (style == Detailed) { FastSection qmlproperties(qmlClassNode, "Property Documentation"); + FastSection qmlattachedproperties(qmlClassNode,"Attached 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) { - insert(qmlproperties,*c,style,Okay); + const QmlPropGroupNode* pgn = static_cast<const QmlPropGroupNode*>(*c); + if (pgn->isAttached()) + insert(qmlattachedproperties,*c,style,Okay); + else + insert(qmlproperties,*c,style,Okay); } else if ((*c)->type() == Node::QmlSignal) { insert(qmlsignals,*c,style,Okay); @@ -1163,6 +1177,7 @@ QList<Section> CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode, ++c; } append(sections,qmlproperties); + append(sections,qmlattachedproperties); append(sections,qmlsignals); append(sections,qmlmethods); } diff --git a/tools/qdoc3/cppcodeparser.cpp b/tools/qdoc3/cppcodeparser.cpp index ec5ce96..ad43b2b 100644 --- a/tools/qdoc3/cppcodeparser.cpp +++ b/tools/qdoc3/cppcodeparser.cpp @@ -88,6 +88,7 @@ QT_BEGIN_NAMESPACE #ifdef QDOC_QML #define COMMAND_QMLCLASS Doc::alias("qmlclass") #define COMMAND_QMLPROPERTY Doc::alias("qmlproperty") +#define COMMAND_QMLATTACHEDPROPERTY Doc::alias("qmlattachedproperty") #define COMMAND_QMLINHERITS Doc::alias("inherits") #define COMMAND_QMLSIGNAL Doc::alias("qmlsignal") #define COMMAND_QMLMETHOD Doc::alias("qmlmethod") @@ -482,6 +483,7 @@ QSet<QString> CppCodeParser::topicCommands() << COMMAND_VARIABLE << COMMAND_QMLCLASS << COMMAND_QMLPROPERTY + << COMMAND_QMLATTACHEDPROPERTY << COMMAND_QMLSIGNAL << COMMAND_QMLMETHOD; #else @@ -541,9 +543,10 @@ Node *CppCodeParser::processTopicCommand(const Doc& doc, else { lastPath = parentPath; } - - if (func) + if (func) { func->borrowParameterNames(clone); + func->setParentPath(clone->parentPath()); + } delete clone; } return func; @@ -758,32 +761,40 @@ bool CppCodeParser::splitQmlArg(const Doc& doc, /*! Process the topic \a command group with arguments \a args. - Currently, this function is called only for \e{qmlproperty}. + Currently, this function is called only for \e{qmlproperty} + and \e{qmlattachedproperty}. */ Node *CppCodeParser::processTopicCommandGroup(const Doc& doc, const QString& command, const QStringList& args) { QmlPropGroupNode* qmlPropGroup = 0; - if (command == COMMAND_QMLPROPERTY) { + if ((command == COMMAND_QMLPROPERTY) || + (command == COMMAND_QMLATTACHEDPROPERTY)) { QString type; QString element; QString property; + bool attached = (command == COMMAND_QMLATTACHEDPROPERTY); QStringList::ConstIterator arg = args.begin(); if (splitQmlPropertyArg(doc,(*arg),type,element,property)) { Node* n = tre->findNode(QStringList(element),Node::Fake); if (n && n->subType() == Node::QmlClass) { QmlClassNode* qmlClass = static_cast<QmlClassNode*>(n); if (qmlClass) - qmlPropGroup = new QmlPropGroupNode(qmlClass,property); + qmlPropGroup = new QmlPropGroupNode(qmlClass, + property, + attached); } } if (qmlPropGroup) { - new QmlPropertyNode(qmlPropGroup,property,type); + new QmlPropertyNode(qmlPropGroup,property,type,attached); ++arg; while (arg != args.end()) { if (splitQmlPropertyArg(doc,(*arg),type,element,property)) { - new QmlPropertyNode(qmlPropGroup,property,type); + new QmlPropertyNode(qmlPropGroup, + property, + type, + attached); } ++arg; } @@ -1371,6 +1382,7 @@ bool CppCodeParser::matchFunctionDecl(InnerNode *parent, func->setAccess(access); func->setLocation(location()); func->setReturnType(returnType.toString()); + func->setParentPath(parentPath); func->setTemplateStuff(templateStuff); if (compat) func->setStatus(Node::Compat); @@ -1967,7 +1979,8 @@ bool CppCodeParser::matchDocsAndStuff() There is a topic command. Process it. */ #ifdef QDOC_QML - if (topic == COMMAND_QMLPROPERTY) { + if ((topic == COMMAND_QMLPROPERTY) || + (topic == COMMAND_QMLATTACHEDPROPERTY)) { Doc nodeDoc = doc; Node *node = processTopicCommandGroup(nodeDoc,topic,args); if (node != 0) { diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 291f60b..18c7916 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -59,6 +59,24 @@ QT_BEGIN_NAMESPACE #define COMMAND_VERSION Doc::alias("version") +QString HtmlGenerator::sinceTitles[] = + { + " New Namespaces", + " New Classes", + " New Member Functions", + " New Functions in Namespaces", + " New Global Functions", + " New Macros", + " New Enum Types", + " New Typedefs", + " New Properties", + " New Variables", + " New Qml Properties", + " New Qml Signals", + " New Qml Methods", + "" + }; + static bool showBrokenLinks = false; static QRegExp linkTag("(<@link node=\"([^\"]+)\">).*(</@link>)"); @@ -186,7 +204,7 @@ HtmlGenerator::HtmlGenerator() : helpProjectWriter(0), inLink(false), inContents(false), inSectionHeading(false), inTableHeader(false), numTableRows(0), threeColumnEnumValueTable(true), funcLeftParen("\\S(\\()"), - tre(0), slow(false), obsoleteLinks(false) + myTree(0), slow(false), obsoleteLinks(false) { } @@ -313,7 +331,7 @@ void HtmlGenerator::generateTree(const Tree *tree, CodeMarker *marker) ++styleIter; } - tre = tree; + myTree = tree; nonCompatClasses.clear(); mainClasses.clear(); compatClasses.clear(); @@ -332,64 +350,6 @@ void HtmlGenerator::generateTree(const Tree *tree, CodeMarker *marker) #endif findAllSince(tree->root()); -#if 0 - if (!sinceVersions.isEmpty()) { - SinceVersionMap::const_iterator v = sinceVersions.constEnd(); - do { - --v; - qDebug() << "SINCE:" << v.key(); - if (!v.value().isEmpty()) { - QString type; - SinceNodeMultiMap::const_iterator n = v.value().constBegin(); - while (n != v.value().constEnd()) { - switch (n.value()->type()) { - case Node::Namespace: - type = "namespace"; - break; - case Node::Class: - type = "class"; - break; - case Node::Fake: - type = "fake"; - break; - case Node::Enum: - type = "enum"; - break; - case Node::Typedef: - type = "typedef"; - break; - case Node::Function: - type = "function"; - break; - case Node::Property: - type = "property"; - break; - case Node::Variable: - type = "variable"; - break; - case Node::Target: - type = "target"; - break; - case Node::QmlProperty: - type = "QML property"; - break; - case Node::QmlSignal: - type = "QML signal"; - break; - case Node::QmlMethod: - type = "QML method"; - break; - default: - type = "No type"; - } - qDebug() << " " << type << n.key(); - ++n; - } - } - } while (v != sinceVersions.constBegin()); - } -#endif - PageGenerator::generateTree(tree, marker); dcfClassesRoot.ref = "classes.html"; @@ -433,7 +393,7 @@ void HtmlGenerator::generateTree(const Tree *tree, CodeMarker *marker) projectUrl, projectDescription); - helpProjectWriter->generate(tre); + helpProjectWriter->generate(myTree); } void HtmlGenerator::startText(const Node * /* relative */, @@ -598,13 +558,12 @@ int HtmlGenerator::generateAtom(const Atom *atom, break; case Atom::AnnotatedList: { - QList<Node*> values = tre->groups().values(atom->string()); - QMap<QString, const Node*> nodeMap; + QList<Node*> values = myTree->groups().values(atom->string()); + NodeMap nodeMap; for (int i = 0; i < values.size(); ++i) { const Node* n = values.at(i); if ((n->status() != Node::Internal) && (n->access() != Node::Private)) { nodeMap.insert(n->nameForLists(),n); - //qDebug() << " " << n->nameForLists(); } } generateAnnotatedList(relative, marker, nodeMap); @@ -633,7 +592,7 @@ int HtmlGenerator::generateAtom(const Atom *atom, if (editionModuleMap.contains(editionName)) { // Add all classes in the modules listed for that edition. - QMap<QString, const Node *> editionClasses; + NodeMap editionClasses; foreach (const QString &moduleName, editionModuleMap[editionName]) { if (moduleClassMap.contains(moduleName)) editionClasses.unite(moduleClassMap[moduleName]); @@ -642,7 +601,7 @@ int HtmlGenerator::generateAtom(const Atom *atom, // Add additional groups and remove groups of classes that // should be excluded from the edition. - QMultiMap <QString, Node *> groups = tre->groups(); + QMultiMap <QString, Node *> groups = myTree->groups(); foreach (const QString &groupName, editionGroupMap[editionName]) { QList<Node *> groupClasses; if (groupName.startsWith("-")) { @@ -689,7 +648,7 @@ int HtmlGenerator::generateAtom(const Atom *atom, else if (atom->string() == "related") { const FakeNode *fake = static_cast<const FakeNode *>(relative); if (fake && !fake->groupMembers().isEmpty()) { - QMap<QString, const Node *> groupMembersMap; + NodeMap groupMembersMap; foreach (const Node *node, fake->groupMembers()) { if (node->type() == Node::Fake) groupMembersMap[fullName(node, relative, marker)] = node; @@ -713,34 +672,144 @@ int HtmlGenerator::generateAtom(const Atom *atom, break; case Atom::SinceList: { - QList<Node*> nodes; - SinceVersionMap::const_iterator v; - v = sinceVersions.find(atom->string()); - if ((v != sinceVersions.constEnd()) && !v.value().isEmpty()) { - for (int i=0; !Node::typeName(i).isEmpty(); i++) { - Node::Type t = (Node::Type) i; - SinceNodeMultiMap::const_iterator n=v.value().constBegin(); - QMultiMap<QString, const Node*> nodeMap; - while (n != v.value().constEnd()) { - const Node* node = n.value(); - if (node->type() == t) - nodeMap.insert(node->nameForLists(),node); - ++n; + NewSinceMaps::const_iterator nsmap; + nsmap = newSinceMaps.find(atom->string()); + NewClassMaps::const_iterator ncmap; + ncmap = newClassMaps.find(atom->string()); + if ((nsmap != newSinceMaps.constEnd()) && !nsmap.value().isEmpty()) { + QList<Section> sections; + QList<Section>::ConstIterator s; + for (int i=0; i<LastSinceType; ++i) + sections.append(Section(sinceTitle(i),QString(),QString())); + + NodeMultiMap::const_iterator n = nsmap.value().constBegin(); + while (n != nsmap.value().constEnd()) { + const Node* node = n.value(); + switch (node->type()) { + case Node::Namespace: + sections[Namespace].appendMember((Node*)node); + break; + case Node::Class: + sections[Class].appendMember((Node*)node); + break; + case Node::Enum: + sections[Enum].appendMember((Node*)node); + break; + case Node::Typedef: + sections[Typedef].appendMember((Node*)node); + break; + case Node::Function: { + const FunctionNode* fn = static_cast<const FunctionNode*>(node); + if (fn->isMacro()) + sections[Macro].appendMember((Node*)node); + else { + Node* p = fn->parent(); + if (p) { + if (p->type() == Node::Class) + sections[MemberFunction].appendMember((Node*)node); + else if (p->type() == Node::Namespace) { + if (p->name().isEmpty()) + sections[GlobalFunction].appendMember((Node*)node); + else + sections[NamespaceFunction].appendMember((Node*)node); + } + else + sections[GlobalFunction].appendMember((Node*)node); + } + else + sections[GlobalFunction].appendMember((Node*)node); + } + break; + } + case Node::Property: + sections[Property].appendMember((Node*)node); + break; + case Node::Variable: + sections[Variable].appendMember((Node*)node); + break; + case Node::QmlProperty: + sections[QmlProperty].appendMember((Node*)node); + break; + case Node::QmlSignal: + sections[QmlSignal].appendMember((Node*)node); + break; + case Node::QmlMethod: + sections[QmlMethod].appendMember((Node*)node); + break; + default: + break; } - if (!nodeMap.isEmpty()) { - out() << "<h2>" - << Node::typeName(i) - << " new in Qt " - << atom->string() - << "</h2>"; - generateAnnotatedList(relative, marker, nodeMap); - nodeMap.clear(); + ++n; + } + + /* + First generate the table of contents. + */ + out() << "<ul>\n"; + s = sections.constBegin(); + while (s != sections.constEnd()) { + if (!(*s).members.isEmpty()) { + + out() << "<li>" + << "<a href=\"#" + << Doc::canonicalTitle((*s).name) + << "\">" + << (*s).name + << "</a></li>\n"; } + ++s; + } + out() << "</ul>\n"; + + int idx = 0; + s = sections.constBegin(); + while (s != sections.constEnd()) { + if (!(*s).members.isEmpty()) { + out() << "<a name=\"" + << Doc::canonicalTitle((*s).name) + << "\"></a>\n"; + out() << "<h3>" << protect((*s).name) << "</h3>\n"; + if (idx == Class) + generateCompactList(0, marker, ncmap.value(), QString("Q")); + else if (idx == MemberFunction) { + ParentMaps parentmaps; + ParentMaps::iterator pmap; + NodeList::const_iterator i = s->members.constBegin(); + while (i != s->members.constEnd()) { + Node* p = (*i)->parent(); + pmap = parentmaps.find(p); + if (pmap == parentmaps.end()) + pmap = parentmaps.insert(p,NodeMultiMap()); + pmap->insert((*i)->name(),(*i)); + ++i; + } + pmap = parentmaps.begin(); + while (pmap != parentmaps.end()) { + NodeList nlist = pmap->values(); + out() << "<p>Class "; + + out() << "<a href=\"" + << linkForNode(pmap.key(), 0) + << "\">"; + QStringList pieces = fullName(pmap.key(), 0, marker).split("::"); + out() << protect(pieces.last()); + out() << "</a>" << ":</p>\n"; + + generateSection(nlist, 0, marker, CodeMarker::Summary); + out() << "<br />"; + ++pmap; + } + } + else + generateSection(s->members, 0, marker, CodeMarker::Summary); + } + ++idx; + ++s; } } } break; -case Atom::Image: + case Atom::Image: case Atom::InlineImage: { QString fileName = imageFileName(relative, atom->string()); @@ -1083,7 +1152,10 @@ case Atom::Image: } if (node) - generateTableOfContents(node, marker, sectioningUnit, numColumns, + generateTableOfContents(node, + marker, + sectioningUnit, + numColumns, relative); } break; @@ -1151,7 +1223,7 @@ void HtmlGenerator::generateClassLikeNode(const InnerNode *inner, subtitleText << "[" << Atom(Atom::AutoLink, fixedModule) << " module]"; if (fixedModule.isEmpty()) { - QMultiMap<QString, QString> publicGroups = tre->publicGroups(); + QMultiMap<QString, QString> publicGroups = myTree->publicGroups(); QList<QString> groupNames = publicGroups.values(inner->name()); if (!groupNames.isEmpty()) { qSort(groupNames.begin(), groupNames.end()); @@ -1168,7 +1240,7 @@ void HtmlGenerator::generateClassLikeNode(const InnerNode *inner, generateHeader(title, inner, marker, true); generateTitle(title, subtitleText, SmallSubTitle, inner, marker); -#ifdef QDOC_QML +#ifdef QDOC_QML if (classe && !classe->qmlElement().isEmpty()) { generateInstantiatedBy(classe,marker); } @@ -1492,7 +1564,7 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker) generateAlsoList(fake, marker); if (!fake->groupMembers().isEmpty()) { - QMap<QString, const Node *> groupMembersMap; + NodeMap groupMembersMap; foreach (const Node *node, fake->groupMembers()) { if (node->type() == Node::Class || node->type() == Node::Namespace) groupMembersMap[node->name()] = node; @@ -1564,7 +1636,7 @@ void HtmlGenerator::generateHeader(const QString& title, if (node && !node->doc().location().isEmpty()) out() << "<!-- " << node->doc().location().fileName() << " -->\n"; - shortVersion = tre->version(); + shortVersion = myTree->version(); if (shortVersion.count(QChar('.')) == 2) shortVersion.truncate(shortVersion.lastIndexOf(QChar('.'))); if (!shortVersion.isEmpty()) { @@ -1686,7 +1758,7 @@ void HtmlGenerator::generateHeader(const QString& title, "<body>\n"; if (mainPage) generateMacRef(node, marker); - out() << QString(postHeader).replace("\\" + COMMAND_VERSION, tre->version()); + out() << QString(postHeader).replace("\\" + COMMAND_VERSION, myTree->version()); if (node && !node->links().empty()) @@ -1717,8 +1789,8 @@ void HtmlGenerator::generateFooter(const Node *node) if (node && !node->links().empty()) out() << "<p>\n" << navigationLinks << "</p>\n"; - out() << QString(footer).replace("\\" + COMMAND_VERSION, tre->version()) - << QString(address).replace("\\" + COMMAND_VERSION, tre->version()) + out() << QString(footer).replace("\\" + COMMAND_VERSION, myTree->version()) + << QString(address).replace("\\" + COMMAND_VERSION, myTree->version()) << "</body>\n" "</html>\n"; } @@ -1970,8 +2042,8 @@ void HtmlGenerator::generateClassHierarchy(const Node *relative, if (classMap.isEmpty()) return; - QMap<QString, const Node *> topLevel; - QMap<QString, const Node *>::ConstIterator c = classMap.begin(); + NodeMap topLevel; + NodeMap::ConstIterator c = classMap.begin(); while (c != classMap.end()) { const ClassNode *classe = static_cast<const ClassNode *>(*c); if (classe->baseClasses().isEmpty()) @@ -1979,7 +2051,7 @@ void HtmlGenerator::generateClassHierarchy(const Node *relative, ++c; } - QStack<QMap<QString, const Node *> > stack; + QStack<NodeMap > stack; stack.push(topLevel); out() << "<ul>\n"; @@ -1996,7 +2068,7 @@ void HtmlGenerator::generateClassHierarchy(const Node *relative, out() << "</li>\n"; stack.top().erase(stack.top().begin()); - QMap<QString, const Node *> newTop; + NodeMap newTop; foreach (const RelatedClass &d, child->derivedClasses()) { if (d.access != Node::Private) newTop.insert(d.node->name(), d.node); @@ -2011,7 +2083,7 @@ void HtmlGenerator::generateClassHierarchy(const Node *relative, void HtmlGenerator::generateAnnotatedList(const Node *relative, CodeMarker *marker, - const QMap<QString, const Node *> &nodeMap) + const NodeMap &nodeMap) { out() << "<p><table width=\"100%\" class=\"annotated\" cellpadding=\"2\" " << "cellspacing=\"1\" border=\"0\">\n"; @@ -2049,9 +2121,19 @@ void HtmlGenerator::generateAnnotatedList(const Node *relative, out() << "</table></p>\n"; } +/*! + This function finds the common prefix of the names of all + the classes in \a classMap and then generates a compact + list of the class names alphabetized on the part of the + name not including the common prefix. You can tell the + function to use \a comonPrefix as the common prefix, but + normally you let it figure it out itself by looking at + the name of the first and last classes in \a classMap. + */ void HtmlGenerator::generateCompactList(const Node *relative, CodeMarker *marker, - const QMap<QString, const Node *> &classMap) + const NodeMap &classMap, + QString commonPrefix) { const int NumParagraphs = 37; // '0' to '9', 'A' to 'Z', '_' const int NumColumns = 4; // number of columns in the result @@ -2060,64 +2142,79 @@ void HtmlGenerator::generateCompactList(const Node *relative, return; /* - First, find out the common prefix of all non-namespaced classes. - For Qt, the prefix is Q. It can easily be derived from the first - and last classes in alphabetical order (QAccel and QXtWidget in Qt 2.1). - */ - int commonPrefixLen = 0; - QString commonPrefix; - QString first; - QString last; - - QMap<QString, const Node *>::const_iterator iter = classMap.begin(); - while (iter != classMap.end()) { - if (!iter.key().contains("::")) { - first = iter.key(); - break; + If commonPrefix is not empty, then the caller knows what + the common prefix is and has passed it in, so just use that + one. + */ + int commonPrefixLen = commonPrefix.length(); + if (commonPrefixLen == 0) { + QString first; + QString last; + + /* + The caller didn't pass in a common prefix, so get the common + prefix by looking at the class names of the first and last + classes in the class map. Discard any namespace names and + just use the bare class names. For Qt, the prefix is "Q". + + Note that the algorithm used here to derive the common prefix + from the first and last classes in alphabetical order (QAccel + and QXtWidget in Qt 2.1), fails if either class name does not + begin with Q. + */ + + NodeMap::const_iterator iter = classMap.begin(); + while (iter != classMap.end()) { + if (!iter.key().contains("::")) { + first = iter.key(); + break; + } + ++iter; } - ++iter; - } - if (first.isEmpty()) - first = classMap.begin().key(); + if (first.isEmpty()) + first = classMap.begin().key(); - iter = classMap.end(); - while (iter != classMap.begin()) { - --iter; - if (!iter.key().contains("::")) { - last = iter.key(); - break; + iter = classMap.end(); + while (iter != classMap.begin()) { + --iter; + if (!iter.key().contains("::")) { + last = iter.key(); + break; + } } - } - if (last.isEmpty()) - last = classMap.begin().key(); + if (last.isEmpty()) + last = classMap.begin().key(); - if (classMap.size() > 1) { - while (commonPrefixLen < first.length() + 1 && - commonPrefixLen < last.length() + 1 && - first[commonPrefixLen] == last[commonPrefixLen]) - ++commonPrefixLen; - } + if (classMap.size() > 1) { + while (commonPrefixLen < first.length() + 1 && + commonPrefixLen < last.length() + 1 && + first[commonPrefixLen] == last[commonPrefixLen]) + ++commonPrefixLen; + } - commonPrefix = first.left(commonPrefixLen); + commonPrefix = first.left(commonPrefixLen); + } /* Divide the data into 37 paragraphs: 0, ..., 9, A, ..., Z, underscore (_). QAccel will fall in paragraph 10 (A) and QXtWidget in paragraph 33 (X). This is the only place where we - assume that NumParagraphs is 37. Each paragraph is a - QMap<QString, const Node *>. + assume that NumParagraphs is 37. Each paragraph is a NodeMap. */ - QMap<QString, const Node *> paragraph[NumParagraphs+1]; + NodeMap paragraph[NumParagraphs+1]; QString paragraphName[NumParagraphs+1]; - QMap<QString, const Node *>::ConstIterator c = classMap.begin(); + NodeMap::ConstIterator c = classMap.begin(); while (c != classMap.end()) { QStringList pieces = c.key().split("::"); QString key; + int idx = commonPrefixLen; + if (!pieces.last().startsWith(commonPrefix)) + idx = 0; if (pieces.size() == 1) - key = pieces.last().mid(commonPrefixLen).toLower(); + key = pieces.last().mid(idx).toLower(); else key = pieces.last().toLower(); @@ -2206,7 +2303,7 @@ void HtmlGenerator::generateCompactList(const Node *relative, if ((currentParagraphNo[i] < NumParagraphs) && !paragraphName[currentParagraphNo[i]].isEmpty()) { - QMap<QString, const Node *>::Iterator it; + NodeMap::Iterator it; it = paragraph[currentParagraphNo[i]].begin(); for (j = 0; j < currentOffsetInParagraph[i]; j++) ++it; @@ -2253,7 +2350,7 @@ void HtmlGenerator::generateFunctionIndex(const Node *relative, #if 1 out() << "<ul>\n"; #endif - QMap<QString, QMap<QString, const Node *> >::ConstIterator f = funcIndex.begin(); + QMap<QString, NodeMap >::ConstIterator f = funcIndex.begin(); while (f != funcIndex.end()) { #if 1 out() << "<li>"; @@ -2268,7 +2365,7 @@ void HtmlGenerator::generateFunctionIndex(const Node *relative, nextLetter++; } - QMap<QString, const Node *>::ConstIterator s = (*f).begin(); + NodeMap::ConstIterator s = (*f).begin(); while (s != (*f).end()) { out() << " "; generateFullName((*s)->parent(), relative, marker, *s); @@ -2384,7 +2481,7 @@ void HtmlGenerator::generateOverviewList(const Node *relative, CodeMarker * /* m QMap<QString, FakeNode *> uncategorizedNodeMap; QRegExp singleDigit("\\b([0-9])\\b"); - const NodeList children = tre->root()->childNodes(); + const NodeList children = myTree->root()->childNodes(); foreach (Node *child, children) { if (child->type() == Node::Fake && child != relative) { FakeNode *fakeNode = static_cast<FakeNode *>(child); @@ -2436,7 +2533,7 @@ void HtmlGenerator::generateOverviewList(const Node *relative, CodeMarker * /* m else if (!isGroupPage) { // If we encounter a page that belongs to a group then // we add that page to the list for that group. - const FakeNode *groupNode = static_cast<const FakeNode *>(tre->root()->findNode(group, Node::Fake)); + const FakeNode *groupNode = static_cast<const FakeNode *>(myTree->root()->findNode(group, Node::Fake)); if (groupNode) fakeNodeMap[groupNode].insert(sortKey, fakeNode); //else @@ -2748,7 +2845,7 @@ QString HtmlGenerator::highlightedCode(const QString& markedCode, if (parseArg(src, funcTag, &i, n, &arg, &par1)) { QString link = linkForNode( marker->resolveTarget(par1.toString(), - tre, + myTree, relative), relative); addLink(link, arg, &html); @@ -2777,7 +2874,7 @@ QString HtmlGenerator::highlightedCode(const QString& markedCode, if (parseArg(src, typeTags[k], &i, n, &arg, &par1)) { par1 = QStringRef(); QString link = linkForNode( - marker->resolveTarget(arg.toString(), tre, relative), + marker->resolveTarget(arg.toString(), myTree, relative), relative); addLink(link, arg, &html); handled = true; @@ -3018,7 +3115,7 @@ QString HtmlGenerator::highlightedCode(const QString& markedCode, if (parseArg(src, funcTag, &i, n, &arg, &par1)) { QString link = linkForNode( marker->resolveTarget(par1.toString(), - tre, + myTree, relative), relative); addLink(link, arg, &html); @@ -3047,7 +3144,7 @@ QString HtmlGenerator::highlightedCode(const QString& markedCode, if (parseArg(src, typeTags[k], &i, n, &arg, &par1)) { par1 = QStringRef(); QString link = linkForNode( - marker->resolveTarget(arg.toString(), tre, relative), + marker->resolveTarget(arg.toString(), myTree, relative), relative); addLink(link, arg, &html); handled = true; @@ -3371,12 +3468,12 @@ QString HtmlGenerator::refForNode(const Node *node) } break; case Node::Property: -#ifdef QDOC_QML +#ifdef QDOC_QML case Node::QmlProperty: #endif ref = node->name() + "-prop"; break; -#ifdef QDOC_QML +#ifdef QDOC_QML case Node::QmlSignal: ref = node->name() + "-signal"; break; @@ -3583,49 +3680,54 @@ void HtmlGenerator::findAllClasses(const InnerNode *node) } /*! - For generating the "Since x.y" page. + For generating the "New Classes... in 4.6" section on the + What's New in 4.6" page. */ void HtmlGenerator::findAllSince(const InnerNode *node) { - NodeList::const_iterator c = node->childNodes().constBegin(); - while (c != node->childNodes().constEnd()) { - QString sinceVersion = (*c)->since(); - if (((*c)->access() != Node::Private) && !sinceVersion.isEmpty()) { - SinceVersionMap::iterator vmap = sinceVersions.find(sinceVersion); - if (vmap == sinceVersions.end()) - vmap = sinceVersions.insert(sinceVersion,SinceNodeMultiMap()); - if ((*c)->type() == Node::Function) { - FunctionNode *func = static_cast<FunctionNode *>(*c); + NodeList::const_iterator child = node->childNodes().constBegin(); + while (child != node->childNodes().constEnd()) { + QString sinceVersion = (*child)->since(); + if (((*child)->access() != Node::Private) && !sinceVersion.isEmpty()) { + NewSinceMaps::iterator nsmap = newSinceMaps.find(sinceVersion); + if (nsmap == newSinceMaps.end()) + nsmap = newSinceMaps.insert(sinceVersion,NodeMultiMap()); + NewClassMaps::iterator ncmap = newClassMaps.find(sinceVersion); + if (ncmap == newClassMaps.end()) + ncmap = newClassMaps.insert(sinceVersion,NodeMap()); + + if ((*child)->type() == Node::Function) { + FunctionNode *func = static_cast<FunctionNode *>(*child); if ((func->status() > Node::Obsolete) && (func->metaness() != FunctionNode::Ctor) && (func->metaness() != FunctionNode::Dtor)) { - vmap.value().insert(func->name(),(*c)); + nsmap.value().insert(func->name(),(*child)); } } - else if ((*c)->url().isEmpty()) { - if ((*c)->type() == Node::Class && !(*c)->doc().isEmpty()) { - QString className = (*c)->name(); - if ((*c)->parent() && - (*c)->parent()->type() == Node::Namespace && - !(*c)->parent()->name().isEmpty()) - className = (*c)->parent()->name()+"::"+className; - vmap.value().insert(className,(*c)); + else if ((*child)->url().isEmpty()) { + if ((*child)->type() == Node::Class && !(*child)->doc().isEmpty()) { + QString className = (*child)->name(); + if ((*child)->parent() && + (*child)->parent()->type() == Node::Namespace && + !(*child)->parent()->name().isEmpty()) + className = (*child)->parent()->name()+"::"+className; + nsmap.value().insert(className,(*child)); + ncmap.value().insert(className,(*child)); } } else { - QString name = (*c)->name(); - if ((*c)->parent() && - (*c)->parent()->type() == Node::Namespace && - !(*c)->parent()->name().isEmpty()) - name = (*c)->parent()->name()+"::"+name; - vmap.value().insert(name,(*c)); - qDebug() << "GOT HEAH" << name; + QString name = (*child)->name(); + if ((*child)->parent() && + (*child)->parent()->type() == Node::Namespace && + !(*child)->parent()->name().isEmpty()) + name = (*child)->parent()->name()+"::"+name; + nsmap.value().insert(name,(*child)); } - if ((*c)->isInnerNode()) { - findAllSince(static_cast<InnerNode *>(*c)); + if ((*child)->isInnerNode()) { + findAllSince(static_cast<InnerNode *>(*child)); } } - ++c; + ++child; } } @@ -3646,9 +3748,10 @@ void HtmlGenerator::findAllFunctions(const InnerNode *node) } else if ((*c)->type() == Node::Function) { const FunctionNode *func = static_cast<const FunctionNode *>(*c); - if (func->status() > Node::Obsolete && func->metaness() != FunctionNode::Ctor - && func->metaness() != FunctionNode::Dtor) { - funcIndex[(*c)->name()].insert(tre->fullDocumentName((*c)->parent()), *c); + if ((func->status() > Node::Obsolete) && + (func->metaness() != FunctionNode::Ctor) && + (func->metaness() != FunctionNode::Dtor)) { + funcIndex[(*c)->name()].insert(myTree->fullDocumentName((*c)->parent()), *c); } } } @@ -3762,14 +3865,14 @@ const Node *HtmlGenerator::findNodeForTarget(const QString &target, node = relative; } else if (target.endsWith(".html")) { - node = tre->root()->findNode(target, Node::Fake); + node = myTree->root()->findNode(target, Node::Fake); } else if (marker) { - node = marker->resolveTarget(target, tre, relative); + node = marker->resolveTarget(target, myTree, relative); if (!node) - node = tre->findFakeNodeByTitle(target); + node = myTree->findFakeNodeByTitle(target); if (!node && atom) { - node = tre->findUnambiguousTarget(target, + node = myTree->findUnambiguousTarget(target, *const_cast<Atom**>(&atom)); } } @@ -3827,14 +3930,14 @@ QString HtmlGenerator::getLink(const Atom *atom, *node = relative; } else if (first.endsWith(".html")) { - *node = tre->root()->findNode(first, Node::Fake); + *node = myTree->root()->findNode(first, Node::Fake); } else { - *node = marker->resolveTarget(first, tre, relative); + *node = marker->resolveTarget(first, myTree, relative); if (!*node) - *node = tre->findFakeNodeByTitle(first); + *node = myTree->findFakeNodeByTitle(first); if (!*node) - *node = tre->findUnambiguousTarget(first, targetAtom); + *node = myTree->findUnambiguousTarget(first, targetAtom); } if (*node) { @@ -3886,7 +3989,7 @@ QString HtmlGenerator::getLink(const Atom *atom, } while (!path.isEmpty()) { - targetAtom = tre->findTarget(path.first(), *node); + targetAtom = myTree->findTarget(path.first(), *node); if (targetAtom == 0) break; path.removeFirst(); @@ -3915,7 +4018,7 @@ void HtmlGenerator::generateIndex(const QString &fileBase, const QString &url, const QString &title) { - tre->generateIndex(outputDir() + "/" + fileBase + ".index", url, title); + myTree->generateIndex(outputDir() + "/" + fileBase + ".index", url, title); } void HtmlGenerator::generateStatus(const Node *node, CodeMarker *marker) @@ -3930,18 +4033,21 @@ void HtmlGenerator::generateStatus(const Node *node, CodeMarker *marker) case Node::Compat: if (node->isInnerNode()) { text << Atom::ParaLeft - << Atom(Atom::FormattingLeft,ATOM_FORMATTING_BOLD) << "This " - << typeString(node) << " is part of the Qt 3 support library." + << Atom(Atom::FormattingLeft,ATOM_FORMATTING_BOLD) + << "This " + << typeString(node) + << " is part of the Qt 3 support library." << Atom(Atom::FormattingRight, ATOM_FORMATTING_BOLD) - << " It is provided to keep old source code working. We strongly advise against " + << " It is provided to keep old source code working. " + << "We strongly advise against " << "using it in new code. See "; - const FakeNode *fakeNode = tre->findFakeNodeByTitle("Porting To Qt 4"); + const FakeNode *fakeNode = myTree->findFakeNodeByTitle("Porting To Qt 4"); Atom *targetAtom = 0; if (fakeNode && node->type() == Node::Class) { QString oldName(node->name()); - targetAtom = tre->findTarget(oldName.replace("3", ""), - fakeNode); + targetAtom = myTree->findTarget(oldName.replace("3", ""), + fakeNode); } if (targetAtom) { @@ -4151,7 +4257,7 @@ void HtmlGenerator::generateQmlInherits(const QmlClassNode* cn, QPair<QString,QString> linkPair; linkPair = cn->links()[Node::InheritsLink]; QStringList strList(linkPair.first); - const Node* n = tre->findNode(strList,Node::Fake); + const Node* n = myTree->findNode(strList,Node::Fake); if (n && n->subType() == Node::QmlClass) { const QmlClassNode* qcn = static_cast<const QmlClassNode*>(n); out() << "<p style=\"text-align: center\">"; @@ -4210,7 +4316,7 @@ void HtmlGenerator::generateInstantiatedBy(const ClassNode* cn, CodeMarker* marker) { if (cn && cn->status() != Node::Internal && !cn->qmlElement().isEmpty()) { - const Node* n = tre->root()->findNode(cn->qmlElement(),Node::Fake); + const Node* n = myTree->root()->findNode(cn->qmlElement(),Node::Fake); if (n && n->subType() == Node::QmlClass) { out() << "<p style=\"text-align: center\">"; Text text; diff --git a/tools/qdoc3/htmlgenerator.h b/tools/qdoc3/htmlgenerator.h index 3f6e564..40117df 100644 --- a/tools/qdoc3/htmlgenerator.h +++ b/tools/qdoc3/htmlgenerator.h @@ -67,14 +67,35 @@ struct NavigationBar }; #endif -typedef QMultiMap<QString, Node*> SinceNodeMultiMap; -typedef QMap<QString, SinceNodeMultiMap> SinceVersionMap; +typedef QMultiMap<QString, Node*> NodeMultiMap; +typedef QMap<QString, NodeMultiMap> NewSinceMaps; +typedef QMap<Node*, NodeMultiMap> ParentMaps; +typedef QMap<QString, const Node*> NodeMap; +typedef QMap<QString, NodeMap> NewClassMaps; class HelpProjectWriter; class HtmlGenerator : public PageGenerator { public: + enum SinceType { + Namespace, + Class, + MemberFunction, + NamespaceFunction, + GlobalFunction, + Macro, + Enum, + Typedef, + Property, + Variable, + QmlProperty, + QmlSignal, + QmlMethod, + LastSinceType + }; + + public: HtmlGenerator(); ~HtmlGenerator(); @@ -85,6 +106,7 @@ class HtmlGenerator : public PageGenerator static QString protect(const QString& string); static QString cleanRef(const QString& ref); + static QString sinceTitle(int i) { return sinceTitles[i]; } protected: virtual void startText(const Node *relative, CodeMarker *marker); @@ -134,13 +156,14 @@ class HtmlGenerator : public PageGenerator CodeMarker::Status status); void generateClassHierarchy(const Node *relative, CodeMarker *marker, - const QMap<QString,const Node *> &classMap); + const NodeMap &classMap); void generateAnnotatedList(const Node *relative, CodeMarker *marker, - const QMap<QString, const Node *> &nodeMap); + const NodeMap &nodeMap); void generateCompactList(const Node *relative, CodeMarker *marker, - const QMap<QString, const Node *> &classMap); + const NodeMap &classMap, + QString commonPrefix = QString()); void generateFunctionIndex(const Node *relative, CodeMarker *marker); void generateLegaleseList(const Node *relative, CodeMarker *marker); void generateOverviewList(const Node *relative, CodeMarker *marker); @@ -273,23 +296,25 @@ class HtmlGenerator : public PageGenerator QString navigationLinks; QStringList stylesheets; QStringList customHeadElements; - const Tree *tre; + const Tree *myTree; bool slow; bool obsoleteLinks; - QMap<QString, QMap<QString, const Node *> > moduleClassMap; - QMap<QString, QMap<QString, const Node *> > moduleNamespaceMap; - QMap<QString, const Node *> nonCompatClasses; - QMap<QString, const Node *> mainClasses; - QMap<QString, const Node *> compatClasses; - QMap<QString, const Node *> obsoleteClasses; - QMap<QString, const Node *> namespaceIndex; - QMap<QString, const Node *> serviceClasses; + QMap<QString, NodeMap > moduleClassMap; + QMap<QString, NodeMap > moduleNamespaceMap; + NodeMap nonCompatClasses; + NodeMap mainClasses; + NodeMap compatClasses; + NodeMap obsoleteClasses; + NodeMap namespaceIndex; + NodeMap serviceClasses; #ifdef QDOC_QML - QMap<QString, const Node *> qmlClasses; + NodeMap qmlClasses; #endif - QMap<QString, QMap<QString, const Node *> > funcIndex; + QMap<QString, NodeMap > funcIndex; QMap<Text, const Node *> legaleseTexts; - SinceVersionMap sinceVersions; + NewSinceMaps newSinceMaps; + static QString sinceTitles[]; + NewClassMaps newClassMaps; }; #define HTMLGENERATOR_ADDRESS "address" @@ -303,3 +328,4 @@ class HtmlGenerator : public PageGenerator QT_END_NAMESPACE #endif + diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp index 42b73d9..d47c478 100644 --- a/tools/qdoc3/node.cpp +++ b/tools/qdoc3/node.cpp @@ -48,29 +48,17 @@ QT_BEGIN_NAMESPACE -QString Node::typeNames[] = - { - "Namespaces", - "Classes", - "Fake", - "Enums", - "Typedefs", - "Functions and Macros", - "Properties", - "Variables", - "Targets", - "Qml Properties", - "Qml Signals", - "Qml Methods", - "" - }; - /*! \class Node - \brief A node in a Tree. + \brief The Node class is a node in the Tree. + + A Node represents a class or function or something else + from the source code.. */ /*! + When this Node is destroyed, if it has a parent Node, it + removes itself from the parent node's child list. */ Node::~Node() { @@ -81,6 +69,11 @@ Node::~Node() } /*! + Sets this Node's Doc to \a doc. If \a replace is false and + this Node already has a Doc, a warning is reported that the + Doc is being overridden, and it reports where the previous + Doc was found. If \a replace is true, the Doc is replaced + silently. */ void Node::setDoc(const Doc& doc, bool replace) { @@ -840,9 +833,17 @@ void TypedefNode::setAssociatedEnum(const EnumNode *enume) /*! \class Parameter + \brief The class Parameter contains one parameter. + + A parameter can be a function parameter or a macro + parameter. */ /*! + Constructs this parameter from the left and right types + \a leftType and rightType, the parameter \a name, and the + \a defaultValue. In practice, \a rightType is not used, + and I don't know what is was meant for. */ Parameter::Parameter(const QString& leftType, const QString& rightType, @@ -853,6 +854,7 @@ Parameter::Parameter(const QString& leftType, } /*! + The standard copy constructor copies the strings from \a p. */ Parameter::Parameter(const Parameter& p) : lef(p.lef), rig(p.rig), nam(p.nam), def(p.def) @@ -860,6 +862,8 @@ Parameter::Parameter(const Parameter& p) } /*! + Assigning Parameter \a p to this Parameter copies the + strings across. */ Parameter& Parameter::operator=(const Parameter& p) { @@ -871,6 +875,23 @@ Parameter& Parameter::operator=(const Parameter& p) } /*! + Reconstructs the text describing the parameter and + returns it. If \a value is true, the default value + will be included, if there is one. + */ +QString Parameter::reconstruct(bool value) const +{ + QString p = lef + rig; + if (!p.endsWith(QChar('*')) && !p.endsWith(QChar('&')) && !p.endsWith(QChar(' '))) + p += " "; + p += nam; + if (value) + p += def; + return p; +} + + +/*! \class FunctionNode */ @@ -924,6 +945,8 @@ void FunctionNode::borrowParameterNames(const FunctionNode *source) } /*! + If this function is a reimplementation, \a from points + to the FunctionNode of the function being reimplemented. */ void FunctionNode::setReimplementedFrom(FunctionNode *from) { @@ -932,6 +955,8 @@ void FunctionNode::setReimplementedFrom(FunctionNode *from) } /*! + Sets the "associated" property to \a property. The function + might be the setter or getter for a property, for example. */ void FunctionNode::setAssociatedProperty(PropertyNode *property) { @@ -939,6 +964,8 @@ void FunctionNode::setAssociatedProperty(PropertyNode *property) } /*! + Returns the overload number for this function obtained + from the parent. */ int FunctionNode::overloadNumber() const { @@ -946,6 +973,8 @@ int FunctionNode::overloadNumber() const } /*! + Returns the number of times this function name has been + overloaded, obtained from the parent. */ int FunctionNode::numOverloads() const { @@ -953,6 +982,7 @@ int FunctionNode::numOverloads() const } /*! + Returns the list of parameter names. */ QStringList FunctionNode::parameterNames() const { @@ -966,6 +996,46 @@ QStringList FunctionNode::parameterNames() const } /*! + Returns the list of reconstructed parameters. If \a values + is true, the default values are included, if any are present. + */ +QStringList FunctionNode::reconstructParams(bool values) const +{ + QStringList params; + QList<Parameter>::ConstIterator p = parameters().begin(); + while (p != parameters().end()) { + params << (*p).reconstruct(values); + ++p; + } + return params; +} + +/*! + Reconstructs and returns the function's signature. If \a values + is true, the default values of the parameters are included, if + present. + */ +QString FunctionNode::signature(bool values) const +{ + QString s; + if (!returnType().isEmpty()) + s = returnType() + " "; + s += name() + "("; + QStringList params = reconstructParams(values); + int p = params.size(); + if (p > 0) { + for (int i=0; i<p; i++) { + s += params[i]; + if (i < (p-1)) + s += ", "; + } + } + s += ")"; + return s; +} + + +/*! \class PropertyNode */ @@ -1090,8 +1160,12 @@ QString QmlClassNode::fileBase() const Constructor for the Qml property group node. \a parent is always a QmlClassNode. */ -QmlPropGroupNode::QmlPropGroupNode(QmlClassNode* parent, const QString& name) - : FakeNode(parent, name, QmlPropertyGroup), isdefault(false) +QmlPropGroupNode::QmlPropGroupNode(QmlClassNode* parent, + const QString& name, + bool attached) + : FakeNode(parent, name, QmlPropertyGroup), + isdefault(false), + att(attached) { // nothing. } @@ -1101,11 +1175,13 @@ QmlPropGroupNode::QmlPropGroupNode(QmlClassNode* parent, const QString& name) */ QmlPropertyNode::QmlPropertyNode(QmlPropGroupNode *parent, const QString& name, - const QString& type) + const QString& type, + bool attached) : LeafNode(QmlProperty, parent, name), dt(type), sto(Trool_Default), - des(Trool_Default) + des(Trool_Default), + att(attached) { // nothing. } diff --git a/tools/qdoc3/node.h b/tools/qdoc3/node.h index dfe882c..c6f860f 100644 --- a/tools/qdoc3/node.h +++ b/tools/qdoc3/node.h @@ -175,13 +175,11 @@ class Node virtual QString fileBase() const; - static QString typeName(int i) { return typeNames[i]; } - protected: Node(Type type, InnerNode *parent, const QString& name); private: - static QString typeNames[]; + #ifdef Q_WS_WIN Type typ; Access acc; @@ -373,15 +371,19 @@ class QmlClassNode : public FakeNode class QmlPropGroupNode : public FakeNode { public: - QmlPropGroupNode(QmlClassNode* parent, const QString& name); + QmlPropGroupNode(QmlClassNode* parent, + const QString& name, + bool attached); virtual ~QmlPropGroupNode() { } const QString& element() const { return name(); } void setDefault() { isdefault = true; } bool isDefault() const { return isdefault; } + bool isAttached() const { return att; } private: bool isdefault; + bool att; }; class QmlPropertyNode : public LeafNode @@ -389,7 +391,8 @@ class QmlPropertyNode : public LeafNode public: QmlPropertyNode(QmlPropGroupNode* parent, const QString& name, - const QString& type); + const QString& type, + bool attached); virtual ~QmlPropertyNode() { } void setDataType(const QString& dataType) { dt = dataType; } @@ -400,6 +403,7 @@ class QmlPropertyNode : public LeafNode QString qualifiedDataType() const { return dt; } bool isStored() const { return fromTrool(sto,true); } bool isDesignable() const { return fromTrool(des,false); } + bool isAttached() const { return att; } const QString& element() const { return parent()->name(); } @@ -412,6 +416,7 @@ class QmlPropertyNode : public LeafNode QString dt; Trool sto; Trool des; + bool att; }; class QmlSignalNode : public LeafNode @@ -502,8 +507,10 @@ class Parameter { public: Parameter() {} - Parameter(const QString& leftType, const QString& rightType = "", - const QString& name = "", const QString& defaultValue = ""); + Parameter(const QString& leftType, + const QString& rightType = "", + const QString& name = "", + const QString& defaultValue = ""); Parameter(const Parameter& p); Parameter& operator=(const Parameter& p); @@ -516,6 +523,8 @@ class Parameter const QString& name() const { return nam; } const QString& defaultValue() const { return def; } + QString reconstruct(bool value = false) const; + private: QString lef; QString rig; @@ -543,6 +552,7 @@ class FunctionNode : public LeafNode virtual ~FunctionNode() { } void setReturnType(const QString& returnType) { rt = returnType; } + void setParentPath(const QStringList& parentPath) { pp = parentPath; } void setMetaness(Metaness metaness) { met = metaness; } void setVirtualness(Virtualness virtualness) { vir = virtualness; } void setConst(bool conste) { con = conste; } @@ -571,6 +581,10 @@ class FunctionNode : public LeafNode const FunctionNode *reimplementedFrom() const { return rf; } const QList<FunctionNode *> &reimplementedBy() const { return rb; } const PropertyNode *associatedProperty() const { return ap; } + const QStringList& parentPath() const { return pp; } + + QStringList reconstructParams(bool values = false) const; + QString signature(bool values = false) const; private: void setAssociatedProperty(PropertyNode *property); @@ -578,9 +592,10 @@ class FunctionNode : public LeafNode friend class InnerNode; friend class PropertyNode; - QString rt; + QString rt; + QStringList pp; #ifdef Q_WS_WIN - Metaness met; + Metaness met; Virtualness vir; #else Metaness met : 4; diff --git a/tools/qdoc3/test/qt-api-only-with-xcode.qdocconf b/tools/qdoc3/test/qt-api-only-with-xcode.qdocconf deleted file mode 100644 index 0d78cda..0000000 --- a/tools/qdoc3/test/qt-api-only-with-xcode.qdocconf +++ /dev/null @@ -1,29 +0,0 @@ -include(qt-build-docs-with-xcode.qdocconf) - -# Ensures that the generated index contains a URL that can be used by the -# tools documentation (assistant.qdocconf, designer.qdocconf, linguist.qdocconf, -# qmake.qdocconf). - -url = ./ - -# Ensures that the documentation for the tools is not included in the generated -# .qhp file. - -qhp.Qt.excluded = $QT_SOURCE_TREE/doc/src/development/assistant-manual.qdoc \ - $QT_SOURCE_TREE/doc/src/examples/simpletextviewer.qdoc \ - $QT_SOURCE_TREE/doc/src/development/designer-manual.qdoc \ - $QT_SOURCE_TREE/doc/src/examples/calculatorbuilder.qdoc \ - $QT_SOURCE_TREE/doc/src/examples/calculatorform.qdoc \ - $QT_SOURCE_TREE/doc/src/examples/customwidgetplugin.qdoc \ - $QT_SOURCE_TREE/doc/src/examples/taskmenuextension.qdoc \ - $QT_SOURCE_TREE/doc/src/examples/containerextension.qdoc \ - $QT_SOURCE_TREE/doc/src/examples/worldtimeclockbuilder.qdoc \ - $QT_SOURCE_TREE/doc/src/examples/worldtimeclockplugin.qdoc \ - $QT_SOURCE_TREE/doc/src/internationalization/linguist-manual.qdoc \ - $QT_SOURCE_TREE/doc/src/examples/hellotr.qdoc \ - $QT_SOURCE_TREE/doc/src/examples/arrowpad.qdoc \ - $QT_SOURCE_TREE/doc/src/examples/trollprint.qdoc \ - $QT_SOURCE_TREE/doc/src/development/qmake-manual.qdoc - -outputdir = $QT_BUILD_TREE/doc-build/html-qt -base = file:$QT_BUILD_TREE/doc-build/html-qt diff --git a/tools/qdoc3/test/qt-build-docs-with-xcode.qdocconf b/tools/qdoc3/test/qt-build-docs-with-xcode.qdocconf deleted file mode 100644 index e4be476..0000000 --- a/tools/qdoc3/test/qt-build-docs-with-xcode.qdocconf +++ /dev/null @@ -1,3 +0,0 @@ -include( qt-build-docs.qdocconf ) - -HTML.generatemacrefs = "true" diff --git a/tools/qdoc3/test/qt-with-xcode.qdocconf b/tools/qdoc3/test/qt-with-xcode.qdocconf deleted file mode 100644 index 932f6d9..0000000 --- a/tools/qdoc3/test/qt-with-xcode.qdocconf +++ /dev/null @@ -1,3 +0,0 @@ -include( qt.qdocconf ) - -HTML.generatemacrefs = "true" diff --git a/tools/qtestlib/wince/cetest/main.cpp b/tools/qtestlib/wince/cetest/main.cpp index 9df70e7..e00c0e7 100644 --- a/tools/qtestlib/wince/cetest/main.cpp +++ b/tools/qtestlib/wince/cetest/main.cpp @@ -237,6 +237,8 @@ int main(int argc, char **argv) debugOutput(QString::fromLatin1("Using Project File:").append(proFile),1); } + Option::before_user_vars.append("CONFIG+=build_pass"); + // read target and deployment rules int qmakeArgc = 1; char* qmakeArgv[] = { "qmake.exe" }; |