diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-02-23 13:04:15 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-02-23 13:04:15 (GMT) |
commit | 0d02bf894a1f3f494a4787ddfaf0e3bcd02affa2 (patch) | |
tree | 619aae505826654f3d89492efa53f758214fea6f /tools | |
parent | 3db40b0be40c946f547f238ed3f0af813892115e (diff) | |
parent | de4332a4728e739b37e9c7b04c021e150e096270 (diff) | |
download | Qt-0d02bf894a1f3f494a4787ddfaf0e3bcd02affa2.zip Qt-0d02bf894a1f3f494a4787ddfaf0e3bcd02affa2.tar.gz Qt-0d02bf894a1f3f494a4787ddfaf0e3bcd02affa2.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1: (33 commits)
Use QTRY_COMPARE to give the animation a chance to finish
Cocoa: Sheets loose their opacity on 2nd show
Added function overload for QByteArray &QByteArray::replace()
Second attempt at work-around for MSVC2008 compiler crash
QNativeSocketEngine: Fix some error handling related to waitFor*()
qdoc: List new QML elements in \sincelist for What's New page.
Cocoa: fix namespace build
Cocoa: Fix build with namespace
Cocoa: namespace build fix
doc: Fixed some qdoc errors.
Don't include private headers from public headers.
Fix compilation on HP-UXi: m_volume is a #define
WinCE doesn't have sys/types.h
Fix compilation: qmlviewer cannot use symbols exported with Q_AUTOTEST_EXPORT in production builds
Fix compilation on recent Linux systems: getpid(2) is in unistd.h.
Cocoa: calling QEventLoop::exec from mouse up causes problem
Fix compilation on GNU/Hurd (SA_SIGINFO isn't defined)
Doc: Collected the Declarative UI tutorials together and renamed them.
Doc: Simplified Commercial Editions for Qt 4.7.
Work around MSVC2008 compiler crash
...
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qdoc3/cppcodeparser.cpp | 13 | ||||
-rw-r--r-- | tools/qdoc3/generator.cpp | 53 | ||||
-rw-r--r-- | tools/qdoc3/generator.h | 8 | ||||
-rw-r--r-- | tools/qdoc3/htmlgenerator.cpp | 49 | ||||
-rw-r--r-- | tools/qdoc3/htmlgenerator.h | 3 | ||||
-rw-r--r-- | tools/qdoc3/node.cpp | 20 | ||||
-rw-r--r-- | tools/qdoc3/node.h | 6 | ||||
-rw-r--r-- | tools/qdoc3/test/qt-build-docs.qdocconf | 8 | ||||
-rw-r--r-- | tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf | 8 | ||||
-rw-r--r-- | tools/qdoc3/test/qt.qdocconf | 7 |
10 files changed, 112 insertions, 63 deletions
diff --git a/tools/qdoc3/cppcodeparser.cpp b/tools/qdoc3/cppcodeparser.cpp index c8655a4..d9e9c3b 100644 --- a/tools/qdoc3/cppcodeparser.cpp +++ b/tools/qdoc3/cppcodeparser.cpp @@ -1033,7 +1033,10 @@ void CppCodeParser::processOtherMetaCommand(const Doc& doc, #ifdef QDOC_QML else if (command == COMMAND_QMLINHERITS) { setLink(node, Node::InheritsLink, arg); - } + if (node->subType() == Node::QmlClass) { + QmlClassNode::addInheritedBy(arg,node); + } + } else if (command == COMMAND_QMLDEFAULT) { QmlPropGroupNode* qpgn = static_cast<QmlPropGroupNode*>(node); qpgn->setDefault(); @@ -2299,14 +2302,6 @@ void CppCodeParser::createExampleFileNodes(FakeNode *fake) QString imagesPath = fullPath + "/images"; QStringList imageFiles = Config::getFilesHere(imagesPath,exampleImageFilter); -#if 0 - qDebug() << "examplePath:" << examplePath; - qDebug() << " exampleFiles" << exampleFiles; - qDebug() << "imagesPath:" << imagesPath; - qDebug() << "fullPath:" << fullPath; - qDebug() << " imageFiles" << imageFiles; -#endif - if (!exampleFiles.isEmpty()) { // move main.cpp and to the end, if it exists QString mainCpp; diff --git a/tools/qdoc3/generator.cpp b/tools/qdoc3/generator.cpp index 9b58d7f..a7ab453 100644 --- a/tools/qdoc3/generator.cpp +++ b/tools/qdoc3/generator.cpp @@ -641,33 +641,6 @@ void Generator::generateExampleFiles(const FakeNode *fake, CodeMarker *marker) } #endif -void Generator::generateModuleWarning(const ClassNode *classe, - CodeMarker *marker) -{ - QString module = classe->moduleName(); - if (!module.isEmpty()) { - Text text; - if (!editionModuleMap["DesktopLight"].contains(module)) { - text << Atom::ParaLeft - << Atom(Atom::FormattingLeft, ATOM_FORMATTING_BOLD) - << "This class is not part of the Qt GUI Framework Edition." - << Atom(Atom::FormattingRight, ATOM_FORMATTING_BOLD) - << Atom::ParaRight; - } - else if (module == "Qt3Support") { - text << Atom::ParaLeft - << Atom(Atom::FormattingLeft, ATOM_FORMATTING_BOLD) - << "Note to Qt GUI Framework Edition users:" - << Atom(Atom::FormattingRight, ATOM_FORMATTING_BOLD) - << " This class is only available in the " - << Atom(Atom::AutoLink, "Qt Full Framework Edition") - << "." << Atom::ParaRight; - } - - generateText(text, classe, marker); - } -} - QString Generator::indent(int level, const QString& markedCode) { if (level == 0) @@ -1213,6 +1186,32 @@ void Generator::appendSortedNames(Text& text, } } +void Generator::appendSortedNames(Text& text, + const Node* base, + const NodeList& subs, + CodeMarker *marker) +{ + NodeList::ConstIterator r; + QMap<QString,Text> classMap; + int index = 0; + + r = subs.begin(); + while (r != subs.end()) { + Text className; + appendFullName(className, (*r), base, marker); + classMap[className.toString().toLower()] = className; + ++r; + } + + QStringList classNames = classMap.keys(); + classNames.sort(); + + foreach (const QString &className, classNames) { + text << classMap[className]; + text << separator(index++, classNames.count()); + } +} + int Generator::skipAtoms(const Atom *atom, Atom::Type type) const { int skipAhead = 0; diff --git a/tools/qdoc3/generator.h b/tools/qdoc3/generator.h index 06f7f88..50ffb0a 100644 --- a/tools/qdoc3/generator.h +++ b/tools/qdoc3/generator.h @@ -124,7 +124,6 @@ class Generator Node::SubType subtype, const QString& tag); void generateExampleFiles(const FakeNode *fake, CodeMarker *marker); - void generateModuleWarning(const ClassNode *classe, CodeMarker *marker); virtual int skipAtoms(const Atom *atom, Atom::Type type) const; virtual QString fullName(const Node *node, @@ -170,6 +169,13 @@ class Generator const QList<RelatedClass> &classes, CodeMarker *marker); + protected: + void appendSortedNames(Text& text, + const Node* base, + const NodeList& subs, + CodeMarker *marker); + + private: QString amp; QString lt; QString gt; diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index e341a03..0477ebb 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -73,6 +73,7 @@ QString HtmlGenerator::sinceTitles[] = " New Typedefs", " New Properties", " New Variables", + " New QML Elements", " New Qml Properties", " New Qml Signals", " New Qml Methods", @@ -687,6 +688,8 @@ int HtmlGenerator::generateAtom(const Atom *atom, nsmap = newSinceMaps.find(atom->string()); NewClassMaps::const_iterator ncmap; ncmap = newClassMaps.find(atom->string()); + NewClassMaps::const_iterator nqcmap; + nqcmap = newQmlClassMaps.find(atom->string()); if ((nsmap != newSinceMaps.constEnd()) && !nsmap.value().isEmpty()) { QList<Section> sections; QList<Section>::ConstIterator s; @@ -697,6 +700,10 @@ int HtmlGenerator::generateAtom(const Atom *atom, while (n != nsmap.value().constEnd()) { const Node* node = n.value(); switch (node->type()) { + case Node::Fake: + if (node->subType() == Node::QmlClass) + sections[QmlClass].appendMember((Node*)node); + break; case Node::Namespace: sections[Namespace].appendMember((Node*)node); break; @@ -782,6 +789,8 @@ int HtmlGenerator::generateAtom(const Atom *atom, out() << "<h3>" << protectEnc((*s).name) << "</h3>\n"; if (idx == Class) generateCompactList(0, marker, ncmap.value(), QString("Q")); + else if (idx == QmlClass) + generateCompactList(0, marker, nqcmap.value(), QString("Q")); else if (idx == MemberFunction) { ParentMaps parentmaps; ParentMaps::iterator pmap; @@ -1261,7 +1270,6 @@ void HtmlGenerator::generateClassLikeNode(const InnerNode *inner, generateIncludes(inner, marker); generateStatus(inner, marker); if (classe) { - generateModuleWarning(classe, marker); generateInherits(classe, marker); generateInheritedBy(classe, marker); } @@ -1525,6 +1533,7 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker) generateQmlInherits(qml_cn, marker); generateQmlInstantiates(qml_cn, marker); generateBrief(qml_cn, marker); + generateQmlInheritedBy(qml_cn, marker); sections = marker->qmlSections(qml_cn,CodeMarker::Summary); s = sections.begin(); while (s != sections.end()) { @@ -2332,7 +2341,11 @@ void HtmlGenerator::generateCompactList(const Node *relative, out() << "<a href=\"" << linkForNode(it.value(), relative) << "\">"; - QStringList pieces = fullName(it.value(), relative, marker).split("::"); + QStringList pieces; + if (it.value()->subType() == Node::QmlClass) + pieces << it.value()->name(); + else + pieces = fullName(it.value(), relative, marker).split("::"); out() << protectEnc(pieces.last()); out() << "</a>"; if (pieces.size() > 1) { @@ -3723,6 +3736,9 @@ void HtmlGenerator::findAllSince(const InnerNode *node) NewClassMaps::iterator ncmap = newClassMaps.find(sinceVersion); if (ncmap == newClassMaps.end()) ncmap = newClassMaps.insert(sinceVersion,NodeMap()); + NewClassMaps::iterator nqcmap = newQmlClassMaps.find(sinceVersion); + if (nqcmap == newQmlClassMaps.end()) + nqcmap = newQmlClassMaps.insert(sinceVersion,NodeMap()); if ((*child)->type() == Node::Function) { FunctionNode *func = static_cast<FunctionNode *>(*child); @@ -3742,6 +3758,15 @@ void HtmlGenerator::findAllSince(const InnerNode *node) nsmap.value().insert(className,(*child)); ncmap.value().insert(className,(*child)); } + else if ((*child)->subType() == Node::QmlClass) { + 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)); + nqcmap.value().insert(className,(*child)); + } } else { QString name = (*child)->name(); @@ -4309,6 +4334,26 @@ void HtmlGenerator::generateQmlInherits(const QmlClassNode* cn, } /*! + Output the "Inherit by" list for the QML element, + if it is inherited by any other elements. + */ +void HtmlGenerator::generateQmlInheritedBy(const QmlClassNode* cn, + CodeMarker* marker) +{ + if (cn) { + NodeList subs; + QmlClassNode::subclasses(cn->name(),subs); + if (!subs.isEmpty()) { + Text text; + text << Atom::ParaLeft << "Inherited by "; + appendSortedNames(text,cn,subs,marker); + text << Atom::ParaRight; + generateText(text, cn, marker); + } + } +} + +/*! Output the "[Xxx instantiates the C++ class QmlGraphicsXxx]" line for the QML element, if there should be one. diff --git a/tools/qdoc3/htmlgenerator.h b/tools/qdoc3/htmlgenerator.h index 369d6c3..8fe0331 100644 --- a/tools/qdoc3/htmlgenerator.h +++ b/tools/qdoc3/htmlgenerator.h @@ -90,6 +90,7 @@ class HtmlGenerator : public PageGenerator Typedef, Property, Variable, + QmlClass, QmlProperty, QmlSignal, QmlMethod, @@ -185,6 +186,7 @@ class HtmlGenerator : public PageGenerator const InnerNode *relative, CodeMarker *marker); void generateQmlInherits(const QmlClassNode* cn, CodeMarker* marker); + void generateQmlInheritedBy(const QmlClassNode* cn, CodeMarker* marker); void generateQmlInstantiates(const QmlClassNode* qcn, CodeMarker* marker); void generateInstantiatedBy(const ClassNode* cn, CodeMarker* marker); #endif @@ -325,6 +327,7 @@ class HtmlGenerator : public PageGenerator NewSinceMaps newSinceMaps; static QString sinceTitles[]; NewClassMaps newClassMaps; + NewClassMaps newQmlClassMaps; static int id; }; diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp index ec574f8..5357597 100644 --- a/tools/qdoc3/node.cpp +++ b/tools/qdoc3/node.cpp @@ -1257,6 +1257,7 @@ bool TargetNode::isInnerNode() const #ifdef QDOC_QML bool QmlClassNode::qmlOnly = false; +QMultiMap<QString,Node*> QmlClassNode::inheritedBy; /*! Constructs a Qml class node (i.e. a Fake node with the @@ -1290,6 +1291,25 @@ QString QmlClassNode::fileBase() const } /*! + Record the fact that QML class \a base is inherited by + QML class \a sub. + */ +void QmlClassNode::addInheritedBy(const QString& base, Node* sub) +{ + inheritedBy.insert(base,sub); +} + +/*! + Loads the list \a subs with the nodes of all the subclasses of \a base. + */ +void QmlClassNode::subclasses(const QString& base, NodeList& subs) +{ + subs.clear(); + if (inheritedBy.contains(base)) + subs = inheritedBy.values(base); +} + +/*! Constructs a Qml basic type node (i.e. a Fake node with the subtype QmlBasicType. The new node has the given \a parent and \a name. diff --git a/tools/qdoc3/node.h b/tools/qdoc3/node.h index 021a052..3798e4e 100644 --- a/tools/qdoc3/node.h +++ b/tools/qdoc3/node.h @@ -383,11 +383,15 @@ class QmlClassNode : public FakeNode const ClassNode* classNode() const { return cnode; } virtual QString fileBase() const; + static void addInheritedBy(const QString& base, Node* sub); + static void subclasses(const QString& base, NodeList& subs); + public: static bool qmlOnly; + static QMultiMap<QString,Node*> inheritedBy; private: - const ClassNode* cnode; + const ClassNode* cnode; }; class QmlBasicTypeNode : public FakeNode diff --git a/tools/qdoc3/test/qt-build-docs.qdocconf b/tools/qdoc3/test/qt-build-docs.qdocconf index 555e826..fb2c3c1 100644 --- a/tools/qdoc3/test/qt-build-docs.qdocconf +++ b/tools/qdoc3/test/qt-build-docs.qdocconf @@ -12,14 +12,6 @@ sourceencoding = UTF-8 outputencoding = UTF-8 naturallanguage = en_US -edition.Desktop.modules = QtCore QtDBus QtGui QtNetwork QtOpenGL QtScript \ - QtScriptTools QtSql QtSvg QtWebKit QtXml QtXmlPatterns \ - Qt3Support QtHelp QtDesigner QtAssistant QAxContainer Phonon \ - QAxServer QtUiTools QtTest QtDBus - -edition.DesktopLight.modules = QtCore QtDBus QtGui Qt3SupportLight QtTest -edition.DesktopLight.groups = -graphicsview-api - qhp.projects = Qt qhp.Qt.file = qt.qhp diff --git a/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf b/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf index 18b72a1..7a77f54 100644 --- a/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf +++ b/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf @@ -14,14 +14,6 @@ naturallanguage = zh-Hans indexes = $QT_BUILD_TREE/doc-build/html-qt/qt.index -edition.Desktop.modules = QtCore QtDBus QtGui QtNetwork QtOpenGL QtScript \ - QtScriptTools QtSql QtSvg QtWebKit QtXml QtXmlPatterns \ - Qt3Support QtHelp QtDesigner QtAssistant QAxContainer Phonon \ - QAxServer QtUiTools QtTest QtDBus - -edition.DesktopLight.modules = QtCore QtDBus QtGui Qt3SupportLight QtTest -edition.DesktopLight.groups = -graphicsview-api - qhp.projects = Qt qhp.Qt.file = qt.qhp diff --git a/tools/qdoc3/test/qt.qdocconf b/tools/qdoc3/test/qt.qdocconf index f7757fb..d8b9136 100644 --- a/tools/qdoc3/test/qt.qdocconf +++ b/tools/qdoc3/test/qt.qdocconf @@ -14,13 +14,6 @@ sourceencoding = UTF-8 outputencoding = UTF-8 naturallanguage = en_US -edition.Desktop.modules = QtCore QtDBus QtGui QtNetwork QtOpenGL QtScript \ - QtScriptTools QtSql QtSvg QtWebKit QtXml QtXmlPatterns \ - Qt3Support QtHelp QtDesigner QtAssistant QAxContainer Phonon \ - QAxServer QtUiTools QtTest QtDBus -edition.DesktopLight.modules = QtCore QtDBus QtGui Qt3SupportLight QtTest -edition.DesktopLight.groups = -graphicsview-api - qhp.projects = Qt qhp.Qt.file = qt.qhp |