From 68073bbcde2d1b12d36f0c58aab1fc20f02ab967 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Fri, 18 Jun 2010 13:31:50 +0200 Subject: qdoc: Added a workaround for QML/Qt class name clashes. Reviewed-by: Trust Me --- tools/qdoc3/codemarker.cpp | 12 +++++++++++- tools/qdoc3/cppcodeparser.cpp | 7 ++++++- tools/qdoc3/node.cpp | 13 ++++++++++++- tools/qdoc3/node.h | 6 +++--- tools/qdoc3/pagegenerator.cpp | 3 ++- tools/qdoc3/tree.cpp | 10 +++++++--- 6 files changed, 41 insertions(+), 10 deletions(-) diff --git a/tools/qdoc3/codemarker.cpp b/tools/qdoc3/codemarker.cpp index 818a91f..33ceaf5 100644 --- a/tools/qdoc3/codemarker.cpp +++ b/tools/qdoc3/codemarker.cpp @@ -257,6 +257,7 @@ QString CodeMarker::typified(const QString &string) QString CodeMarker::taggedNode(const Node* node) { QString tag; + QString name = node->name(); switch (node->type()) { case Node::Namespace: @@ -277,11 +278,20 @@ QString CodeMarker::taggedNode(const Node* node) case Node::Property: tag = QLatin1String("@property"); break; +#ifdef QDOC_QML + case Node::Fake: + if (node->subType() == Node::QmlClass) { + if (node->name().startsWith(QLatin1String("QML:"))) + name = name.mid(4); // remove the "QML:" prefix + } + tag = QLatin1String("@property"); + break; +#endif default: tag = QLatin1String("@unknown"); break; } - return QLatin1Char('<') + tag + QLatin1Char('>') + protect(node->name()) + return QLatin1Char('<') + tag + QLatin1Char('>') + protect(name) + QLatin1String("'); } diff --git a/tools/qdoc3/cppcodeparser.cpp b/tools/qdoc3/cppcodeparser.cpp index 13678af..caee30b 100644 --- a/tools/qdoc3/cppcodeparser.cpp +++ b/tools/qdoc3/cppcodeparser.cpp @@ -728,7 +728,10 @@ Node *CppCodeParser::processTopicCommand(const Doc& doc, if (n) classNode = static_cast(n); } - return new QmlClassNode(tre->root(), names[0], classNode); + if (names[0].startsWith("Q")) + return new QmlClassNode(tre->root(), QLatin1String("QML:")+names[0], classNode); + else + return new QmlClassNode(tre->root(), names[0], classNode); } else if (command == COMMAND_QMLBASICTYPE) { #if 0 @@ -752,6 +755,8 @@ Node *CppCodeParser::processTopicCommand(const Doc& doc, QString type; QmlClassNode* qmlClass = 0; if (splitQmlMethodArg(doc,arg,type,element)) { + if (element.startsWith(QLatin1String("Q"))) + element = QLatin1String("QML:") + element; Node* n = tre->findNode(QStringList(element),Node::Fake); if (n && n->subType() == Node::QmlClass) { qmlClass = static_cast(n); diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp index 4664e9d..6a87639 100644 --- a/tools/qdoc3/node.cpp +++ b/tools/qdoc3/node.cpp @@ -871,6 +871,14 @@ FakeNode::FakeNode(InnerNode *parent, const QString& name, SubType subtype) } /*! + Returns the fake node's title. This is used for the page title. +*/ +QString FakeNode::title() const +{ + return tle; +} + +/*! Returns the fake node's full title, which is usually just title(), but for some SubType values is different from title() @@ -1324,7 +1332,10 @@ QmlClassNode::QmlClassNode(InnerNode *parent, const ClassNode* cn) : FakeNode(parent, name, QmlClass), cnode(cn) { - setTitle((qmlOnly ? "" : "QML ") + name + " Element"); + if (name.startsWith(QLatin1String("QML:"))) + setTitle((qmlOnly ? QLatin1String("") : QLatin1String("QML ")) + name.mid(4) + QLatin1String(" Element")); + else + setTitle((qmlOnly ? QLatin1String("") : QLatin1String("QML ")) + name + QLatin1String(" Element")); } /*! diff --git a/tools/qdoc3/node.h b/tools/qdoc3/node.h index 523394d..90295ee 100644 --- a/tools/qdoc3/node.h +++ b/tools/qdoc3/node.h @@ -362,9 +362,9 @@ class FakeNode : public InnerNode void addGroupMember(Node *node) { gr.append(node); } SubType subType() const { return sub; } - QString title() const { return tle; } - QString fullTitle() const; - QString subTitle() const; + virtual QString title() const; + virtual QString fullTitle() const; + virtual QString subTitle() const; const NodeList &groupMembers() const { return gr; } virtual QString nameForLists() const { return title(); } diff --git a/tools/qdoc3/pagegenerator.cpp b/tools/qdoc3/pagegenerator.cpp index cd364ef..a187c2e 100644 --- a/tools/qdoc3/pagegenerator.cpp +++ b/tools/qdoc3/pagegenerator.cpp @@ -209,7 +209,8 @@ QString PageGenerator::fileBase(const Node *node) const */ if ((p->subType() == Node::QmlClass) || (p->subType() == Node::QmlBasicType)) { - base.prepend("qml-"); + if (!base.startsWith(QLatin1String("QML:"))) + base.prepend("qml-"); } #endif if (!pp || pp->name().isEmpty() || pp->type() == Node::Fake) diff --git a/tools/qdoc3/tree.cpp b/tools/qdoc3/tree.cpp index 31bbf54..d31de4d 100644 --- a/tools/qdoc3/tree.cpp +++ b/tools/qdoc3/tree.cpp @@ -1952,9 +1952,13 @@ QString Tree::fullDocumentLocation(const Node *node) const else if (node->type() == Node::Fake) { #ifdef QDOC_QML if ((node->subType() == Node::QmlClass) || - (node->subType() == Node::QmlBasicType)) - return "qml-" + node->fileBase() + ".html"; - else + (node->subType() == Node::QmlBasicType)) { + QString fb = node->fileBase(); + if (fb.startsWith(QLatin1String("QML:"))) + return node->fileBase() + ".html"; + else + return "qml-" + node->fileBase() + ".html"; + } else #endif parentName = node->fileBase() + ".html"; } -- cgit v0.12 From 5b71c12c8ddb60bdc740fe7e3034cc5189d63f7e Mon Sep 17 00:00:00 2001 From: David Boddie Date: Fri, 18 Jun 2010 13:36:56 +0200 Subject: Doc: Changed links to explicitly refer to QML objects. Reviewed-by: Trust Me --- src/declarative/qml/qdeclarativeengine.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index 5c4d229..86053c4 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -183,11 +183,11 @@ data types. This is primarily useful when setting the properties of an item when the property has one of the following types: \list -\o \c color - use \l{Qt::rgba()}{Qt.rgba()}, \l{Qt::hsla()}{Qt.hsla()}, \l{Qt::darker()}{Qt.darker()}, \l{Qt::lighter()}{Qt.lighter()} or \l{Qt::tint()}{Qt.tint()} -\o \c rect - use \l{Qt::rect()}{Qt.rect()} -\o \c point - use \l{Qt::point()}{Qt.point()} -\o \c size - use \l{Qt::size()}{Qt.size()} -\o \c vector3d - use \l{Qt::vector3d()}{Qt.vector3d()} +\o \c color - use \l{QML:Qt::rgba()}{Qt.rgba()}, \l{QML:Qt::hsla()}{Qt.hsla()}, \l{QML:Qt::darker()}{Qt.darker()}, \l{QML:Qt::lighter()}{Qt.lighter()} or \l{QML:Qt::tint()}{Qt.tint()} +\o \c rect - use \l{QML:Qt::rect()}{Qt.rect()} +\o \c point - use \l{QML:Qt::point()}{Qt.point()} +\o \c size - use \l{QML:Qt::size()}{Qt.size()} +\o \c vector3d - use \l{QML:Qt::vector3d()}{Qt.vector3d()} \endlist There are also string based constructors for these types. See \l{qdeclarativebasictypes.html}{QML Basic Types} for more information. @@ -197,12 +197,12 @@ There are also string based constructors for these types. See \l{qdeclarativebas The Qt object contains several functions for formatting dates and times. \list - \o \l{Qt::formatDateTime}{string Qt.formatDateTime(datetime date, variant format)} - \o \l{Qt::formatDate}{string Qt.formatDate(datetime date, variant format)} - \o \l{Qt::formatTime}{string Qt.formatTime(datetime date, variant format)} + \o \l{QML:Qt::formatDateTime}{string Qt.formatDateTime(datetime date, variant format)} + \o \l{QML:Qt::formatDate}{string Qt.formatDate(datetime date, variant format)} + \o \l{QML:Qt::formatTime}{string Qt.formatTime(datetime date, variant format)} \endlist -The format specification is described at \l{Qt::formatDateTime}{Qt.formatDateTime}. +The format specification is described at \l{QML:Qt::formatDateTime}{Qt.formatDateTime}. \section1 Dynamic Object Creation @@ -211,8 +211,8 @@ items from files or strings. See \l{Dynamic Object Management} for an overview of their use. \list - \o \l{Qt::createComponent()}{object Qt.createComponent(url)} - \o \l{Qt::createQmlObject()}{object Qt.createQmlObject(string qml, object parent, string filepath)} + \o \l{QML:Qt::createComponent()}{object Qt.createComponent(url)} + \o \l{QML:Qt::createQmlObject()}{object Qt.createQmlObject(string qml, object parent, string filepath)} \endlist */ -- cgit v0.12 From ba76a029b9e6970ff5785ebfc65fa9e5b50ddb17 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Fri, 18 Jun 2010 15:26:48 +0200 Subject: Doc: Fixed links in the QML documentation. Reviewed-by: Trust Me --- doc/src/declarative/basictypes.qdoc | 16 ++++++++-------- doc/src/declarative/dynamicobjects.qdoc | 14 +++++++------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/doc/src/declarative/basictypes.qdoc b/doc/src/declarative/basictypes.qdoc index 87dab81..4beee08 100644 --- a/doc/src/declarative/basictypes.qdoc +++ b/doc/src/declarative/basictypes.qdoc @@ -171,8 +171,8 @@ Rectangle { color: "#800000FF" } \endqml - Or with the \l{Qt::rgba()}{Qt.rgba()}, \l{Qt::hsla()}{Qt.hsla()}, \l{Qt::darker()}{Qt.darker()}, - \l{Qt::lighter()}{Qt.lighter()} or \l{Qt::tint()}{Qt.tint()} functions: + Or with the \l{QML:Qt::rgba()}{Qt.rgba()}, \l{QML:Qt::hsla()}{Qt.hsla()}, \l{QML:Qt::darker()}{Qt.darker()}, + \l{QML:Qt::lighter()}{Qt.lighter()} or \l{QML:Qt::tint()}{Qt.tint()} functions: \qml Rectangle { color: Qt.rgba(255, 0, 0, 1) } @@ -195,7 +195,7 @@ CustomObject { myPointProperty: "0,20" } \endqml - Or use the \l{Qt::point()}{Qt.point()} function: + Or use the \l{QML:Qt::point()}{Qt.point()} function: \qml CustomObject { myPointProperty: Qt.point(0, 20) } @@ -227,7 +227,7 @@ LayoutItem { preferredSize: "150x50" } \endqml - Or use the \l{Qt::size()}{Qt.size()} function: + Or use the \l{QML:Qt::size()}{Qt.size()} function: \qml LayoutItem { preferredSize: Qt.size(150, 50) } @@ -260,7 +260,7 @@ CustomObject { myRectProperty: "50,50,100x100" } \endqml - Or use the \l{Qt::rect()}{Qt.rect()} function: + Or use the \l{QML:Qt::rect()}{Qt.rect()} function: \qml CustomObject { myRectProperty: Qt.rect(50, 50, 100, 100) } @@ -283,7 +283,7 @@ \endqml To read a date value returned from a C++ extension class, use - \l{Qt::formatDate()}{Qt.formatDate()} and \l{Qt::formatDateTime()}{Qt.formatDateTime()}. + \l{QML:Qt::formatDate()}{Qt.formatDate()} and \l{QML:Qt::formatDateTime()}{Qt.formatDateTime()}. \sa {QML Basic Types} */ @@ -302,7 +302,7 @@ \endqml To read a time value returned from a C++ extension class, use - \l{Qt::formatTime()}{Qt.formatTime()} and \l{Qt::formatDateTime()}{Qt.formatDateTime()}. + \l{QML:Qt::formatTime()}{Qt.formatTime()} and \l{QML:Qt::formatDateTime()}{Qt.formatDateTime()}. \sa {QML Basic Types} */ @@ -400,7 +400,7 @@ Rotation { angle: 60; axis: "0,1,0" } \endqml - or with the \l{Qt::vector3d()}{Qt.vector3d()} function: + or with the \l{QML:Qt::vector3d()}{Qt.vector3d()} function: \qml Rotation { angle: 60; axis: Qt.vector3d(0, 1, 0) } diff --git a/doc/src/declarative/dynamicobjects.qdoc b/doc/src/declarative/dynamicobjects.qdoc index 5e606f4..edce3f2 100644 --- a/doc/src/declarative/dynamicobjects.qdoc +++ b/doc/src/declarative/dynamicobjects.qdoc @@ -56,15 +56,15 @@ application, and there are no C++ components involved. \section1 Creating Objects Dynamically There are two ways to create objects dynamically from JavaScript. You can either call -\l {Qt::createComponent()}{Qt.createComponent()} to create -a component which instantiates items, or use \l{Qt::createQmlObject()}{Qt.createQmlObject()} +\l {QML:Qt::createComponent()}{Qt.createComponent()} to create +a component which instantiates items, or use \l{QML:Qt::createQmlObject()}{Qt.createQmlObject()} to create an item from a string of QML. Creating a component is better if you have a predefined item, and you want to create dynamic instances of that item; creating an item from a string of QML is useful when the item QML itself is generated at runtime. If you have a component specified in a QML file, you can dynamically load it with -the \l {Qt::createComponent()}{Qt.createComponent()} function on the \l{QML Global Object}. +the \l {QML:Qt::createComponent()}{Qt.createComponent()} function on the \l{QML Global Object}. This function takes the URL of the QML file as its only argument and returns a component object which can be used to create and load that QML file. @@ -98,10 +98,10 @@ in \c main.qml). After creating an item, you must set its parent to an item with Otherwise your dynamically created item will not appear in the scene. When using files with relative paths, the path should -be relative to the file where \l {Qt::createComponent()}{Qt.createComponent()} is executed. +be relative to the file where \l {QML:Qt::createComponent()}{Qt.createComponent()} is executed. If the QML component does not exist until runtime, you can create a QML item from -a string of QML using the \l{Qt::createQmlObject()}{Qt.createQmlObject()} function, as in the following example: +a string of QML using the \l{QML:Qt::createQmlObject()}{Qt.createQmlObject()} function, as in the following example: \snippet doc/src/snippets/declarative/createQmlObject.qml 0 @@ -121,9 +121,9 @@ the bindings in the dynamic item will no longer work. The actual creation context depends on how an item is created: \list -\o If \l {Qt::createComponent()}{Qt.createComponent()} is used, the creation context +\o If \l {QML:Qt::createComponent()}{Qt.createComponent()} is used, the creation context is the QDeclarativeContext in which this method is called -\o If \l{Qt::createQmlObject()}{Qt.createQmlObject()} +\o If \l{QML:Qt::createQmlObject()}{Qt.createQmlObject()} if called, it is the context of the item used as the second argument to this method \o If a \c {Component{}} item is defined and \l {Component::createObject()}{createObject()} is called on that item, it is the context in which the \c Component is defined -- cgit v0.12 From 318e1b3a78bc7114bacdce8bec019228d8ecab19 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Wed, 23 Jun 2010 14:58:01 +0200 Subject: Doc: Fixed whitespace issues and added missing files to lists. Reviewed-by: Trust Me --- tools/qdoc3/test/qt-build-docs.qdocconf | 76 +++++++++++++-------------- tools/qdoc3/test/qt-build-docs_ja_JP.qdocconf | 67 +++++++++++++---------- tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf | 14 ++++- 3 files changed, 90 insertions(+), 67 deletions(-) diff --git a/tools/qdoc3/test/qt-build-docs.qdocconf b/tools/qdoc3/test/qt-build-docs.qdocconf index 09cbc45..140b81f 100644 --- a/tools/qdoc3/test/qt-build-docs.qdocconf +++ b/tools/qdoc3/test/qt-build-docs.qdocconf @@ -22,43 +22,43 @@ qhp.Qt.indexTitle = Qt Reference Documentation # Files not referenced in any qdoc file (last four are needed by qtdemo) # See also extraimages.HTML qhp.Qt.extraFiles = index.html \ - images/bg_l.png \ - images/bg_l_blank.png \ - images/bg_r.png \ - images/box_bg.png \ - images/breadcrumb.png \ - images/bullet_gt.png \ - images/bullet_dn.png \ - images/bullet_sq.png \ - images/bullet_up.png \ - images/feedbackground.png \ - images/horBar.png \ - images/page.png \ - images/page_bg.png \ - images/sprites-combined.png \ - images/arrow-down.png \ - images/spinner.gif \ - images/stylesheet-coffee-plastique.png \ - images/taskmenuextension-example.png \ - images/coloreditorfactoryimage.png \ - images/dynamiclayouts-example.png \ - scripts/functions.js \ - scripts/jquery.js \ - scripts/shBrushCpp.js \ - scripts/shCore.js \ - scripts/shLegacy.js \ - scripts/narrow.js \ - scripts/superfish.js \ - style/shCore.css \ - style/shThemeDefault.css \ - style/narrow.css \ - style/superfish.css \ - style/superfish_skin.css \ - style/OfflineStyle.css \ - style/style_ie6.css \ - style/style_ie7.css \ - style/style_ie8.css \ - style/style.css + images/bg_l.png \ + images/bg_l_blank.png \ + images/bg_r.png \ + images/box_bg.png \ + images/breadcrumb.png \ + images/bullet_gt.png \ + images/bullet_dn.png \ + images/bullet_sq.png \ + images/bullet_up.png \ + images/feedbackground.png \ + images/horBar.png \ + images/page.png \ + images/page_bg.png \ + images/sprites-combined.png \ + images/arrow-down.png \ + images/spinner.gif \ + images/stylesheet-coffee-plastique.png \ + images/taskmenuextension-example.png \ + images/coloreditorfactoryimage.png \ + images/dynamiclayouts-example.png \ + scripts/functions.js \ + scripts/jquery.js \ + scripts/shBrushCpp.js \ + scripts/shCore.js \ + scripts/shLegacy.js \ + scripts/narrow.js \ + scripts/superfish.js \ + style/shCore.css \ + style/shThemeDefault.css \ + style/narrow.css \ + style/superfish.css \ + style/superfish_skin.css \ + style/OfflineStyle.css \ + style/style_ie6.css \ + style/style_ie7.css \ + style/style_ie8.css \ + style/style.css @@ -141,7 +141,7 @@ exampledirs = $QT_SOURCE_TREE/doc/src \ imagedirs = $QT_SOURCE_TREE/doc/src/images \ $QT_SOURCE_TREE/examples \ $QT_SOURCE_TREE/doc/src/declarative/pics \ - $QT_SOURCE_TREE/doc/src/template/images + $QT_SOURCE_TREE/doc/src/template/images outputdir = $QT_BUILD_TREE/doc/html tagfile = $QT_BUILD_TREE/doc/html/qt.tags base = file:$QT_BUILD_TREE/doc/html diff --git a/tools/qdoc3/test/qt-build-docs_ja_JP.qdocconf b/tools/qdoc3/test/qt-build-docs_ja_JP.qdocconf index e517b33..7701cae 100644 --- a/tools/qdoc3/test/qt-build-docs_ja_JP.qdocconf +++ b/tools/qdoc3/test/qt-build-docs_ja_JP.qdocconf @@ -30,33 +30,43 @@ qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.0 # Files not referenced in any qdoc file (last four are needed by qtdemo) # See also extraimages.HTML qhp.Qt.extraFiles = index.html \ - images/bg_l.png \ - images/bg_l_blank.png \ - images/bg_r.png \ - images/box_bg.png \ - images/breadcrumb.png \ - images/bullet_gt.png \ - images/bullet_dn.png \ - images/bullet_sq.png \ - images/bullet_up.png \ - images/feedbackground.png \ - images/horBar.png \ - images/page.png \ - images/page_bg.png \ - images/sprites-combined.png \ - images/arrow-down.png \ - images/spinner.gif \ - images/stylesheet-coffee-plastique.png \ - images/taskmenuextension-example.png \ - images/coloreditorfactoryimage.png \ - images/dynamiclayouts-example.png \ - scripts/functions.js \ - scripts/jquery.js \ - style/OfflineStyle.css \ - style/style_ie6.css \ - style/style_ie7.css \ - style/style_ie8.css \ - style/style.css + images/bg_l.png \ + images/bg_l_blank.png \ + images/bg_r.png \ + images/box_bg.png \ + images/breadcrumb.png \ + images/bullet_gt.png \ + images/bullet_dn.png \ + images/bullet_sq.png \ + images/bullet_up.png \ + images/feedbackground.png \ + images/horBar.png \ + images/page.png \ + images/page_bg.png \ + images/sprites-combined.png \ + images/arrow-down.png \ + images/spinner.gif \ + images/stylesheet-coffee-plastique.png \ + images/taskmenuextension-example.png \ + images/coloreditorfactoryimage.png \ + images/dynamiclayouts-example.png \ + scripts/functions.js \ + scripts/jquery.js \ + scripts/shBrushCpp.js \ + scripts/shCore.js \ + scripts/shLegacy.js \ + scripts/narrow.js \ + scripts/superfish.js \ + style/shCore.css \ + style/shThemeDefault.css \ + style/narrow.css \ + style/superfish.css \ + style/superfish_skin.css \ + style/OfflineStyle.css \ + style/style_ie6.css \ + style/style_ie7.css \ + style/style_ie8.css \ + style/style.css language = Cpp @@ -102,7 +112,8 @@ exampledirs = $QT_SOURCE_TREE/doc/src \ imagedirs = $QT_SOURCE_TREE/doc/src/ja_JP/images \ $QT_SOURCE_TREE/doc/src/images \ $QT_SOURCE_TREE/examples \ - $QT_SOURCE_TREE/doc/src/template/images + $QT_SOURCE_TREE/doc/src/declarative/pics \ + $QT_SOURCE_TREE/doc/src/template/images outputdir = $QT_BUILD_TREE/doc/html_ja_JP tagfile = $QT_BUILD_TREE/doc/html_ja_JP/qt.tags base = file:$QT_BUILD_TREE/doc/html_ja_JP diff --git a/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf b/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf index 909a2d4..be459d8 100644 --- a/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf +++ b/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf @@ -52,6 +52,17 @@ qhp.Qt.extraFiles = index.html \ images/dynamiclayouts-example.png \ scripts/functions.js \ scripts/jquery.js \ + scripts/shBrushCpp.js \ + scripts/shCore.js \ + scripts/shLegacy.js \ + scripts/narrow.js \ + scripts/superfish.js \ + style/shCore.css \ + style/shThemeDefault.css \ + style/narrow.css \ + style/superfish.css \ + style/superfish_skin.css \ + style/OfflineStyle.css \ style/style_ie6.css \ style/style_ie7.css \ style/style_ie8.css \ @@ -99,7 +110,8 @@ exampledirs = $QT_SOURCE_TREE/doc/src \ $QT_SOURCE_TREE/src/3rdparty/webkit/WebKit/qt/docs imagedirs = $QT_SOURCE_TREE/doc/src/images \ $QT_SOURCE_TREE/examples \ - $QT_SOURCE_TREE/doc/src/template/images + $QT_SOURCE_TREE/doc/src/declarative/pics \ + $QT_SOURCE_TREE/doc/src/template/images outputdir = $QT_BUILD_TREE/doc/html_zh_CN tagfile = $QT_BUILD_TREE/doc/html_zh_CN/qt.tags base = file:$QT_BUILD_TREE/doc/html_zh_CN -- cgit v0.12 From 94e7b873ed5c04d4850a9e36970906113f12cd55 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 28 Jun 2010 13:00:56 +0200 Subject: Don't load ciphers and system certificates for QSslSocket::supportsSsl() Loading these uses about 1 MB of memory and can be be deferred until it's actually needed. Reviewed-by: Peter Hartmann --- src/network/ssl/qsslsocket.cpp | 2 +- src/network/ssl/qsslsocket_openssl.cpp | 50 +++++++++++++++++++++++++++------- src/network/ssl/qsslsocket_p.h | 10 ++++++- 3 files changed, 50 insertions(+), 12 deletions(-) diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp index a8c602a..f85fa84 100644 --- a/src/network/ssl/qsslsocket.cpp +++ b/src/network/ssl/qsslsocket.cpp @@ -1556,7 +1556,7 @@ QList QSslSocket::sslErrors() const */ bool QSslSocket::supportsSsl() { - return QSslSocketPrivate::ensureInitialized(); + return QSslSocketPrivate::supportsSsl(); } /*! diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp index 9bd93a2..fa26fe8 100644 --- a/src/network/ssl/qsslsocket_openssl.cpp +++ b/src/network/ssl/qsslsocket_openssl.cpp @@ -72,6 +72,9 @@ QT_BEGIN_NAMESPACE +bool QSslSocketPrivate::s_libraryLoaded = false; +bool QSslSocketPrivate::s_loadedCiphersAndCerts = false; + // Useful defines #define SSL_ERRORSTR() QString::fromLocal8Bit(q_ERR_error_string(q_ERR_get_error(), NULL)) @@ -398,19 +401,24 @@ void QSslSocketPrivate::deinitialize() /*! \internal - Declared static in QSslSocketPrivate, makes sure the SSL libraries have - been initialized. + Does the minimum amount of initialization to determine whether SSL + is supported or not. */ -bool QSslSocketPrivate::ensureInitialized() + +bool QSslSocketPrivate::supportsSsl() +{ + return ensureLibraryLoaded(); +} + +bool QSslSocketPrivate::ensureLibraryLoaded() { if (!q_resolveOpenSslSymbols()) return false; // Check if the library itself needs to be initialized. QMutexLocker locker(openssl_locks()->initLock()); - static int q_initialized = false; - if (!q_initialized) { - q_initialized = true; + if (!s_libraryLoaded) { + s_libraryLoaded = true; // Initialize OpenSSL. q_CRYPTO_set_id_callback(id_function); @@ -447,10 +455,33 @@ bool QSslSocketPrivate::ensureInitialized() if (!attempts) return false; } - - resetDefaultCiphers(); - setDefaultCaCertificates(systemCaCertificates()); } + return true; +} + +void QSslSocketPrivate::ensureCiphersAndCertsLoaded() +{ + if (s_loadedCiphersAndCerts) + return; + s_loadedCiphersAndCerts = true; + + resetDefaultCiphers(); + setDefaultCaCertificates(systemCaCertificates()); +} + +/*! + \internal + + Declared static in QSslSocketPrivate, makes sure the SSL libraries have + been initialized. +*/ + +void QSslSocketPrivate::ensureInitialized() +{ + if (!supportsSsl()) + return; + + ensureCiphersAndCertsLoaded(); //load symbols needed to receive certificates from system store #if defined(Q_OS_MAC) @@ -481,7 +512,6 @@ bool QSslSocketPrivate::ensureInitialized() qWarning("could not load crypt32 library"); // should never happen } #endif - return true; } /*! diff --git a/src/network/ssl/qsslsocket_p.h b/src/network/ssl/qsslsocket_p.h index d3c3858..09775bc 100644 --- a/src/network/ssl/qsslsocket_p.h +++ b/src/network/ssl/qsslsocket_p.h @@ -108,7 +108,8 @@ public: // that was used for connecting to. QString verificationPeerName; - static bool ensureInitialized(); + static bool supportsSsl(); + static void ensureInitialized(); static void deinitialize(); static QList defaultCiphers(); static QList supportedCiphers(); @@ -154,6 +155,13 @@ public: virtual void disconnectFromHost() = 0; virtual void disconnected() = 0; virtual QSslCipher sessionCipher() const = 0; + +private: + static bool ensureLibraryLoaded(); + static void ensureCiphersAndCertsLoaded(); + + static bool s_libraryLoaded; + static bool s_loadedCiphersAndCerts; }; QT_END_NAMESPACE -- cgit v0.12 From 3aa8ae52ebb7a3395328f52fe2cbae0a44ae7198 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 28 Jun 2010 14:03:59 +0200 Subject: doc: Added more DITA output to the XML generator Added cxxDefine for macros. Task-number: QTBUG-11391 --- tools/qdoc3/ditaxmlgenerator.cpp | 105 ++++++++++++++++++++++++++++++++++----- tools/qdoc3/ditaxmlgenerator.h | 8 +-- 2 files changed, 97 insertions(+), 16 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index d48a578..d7a9c9e 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -1466,7 +1466,6 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark writeFunctions((*s),cn,marker); } else if ((*s).name == "Member Type Documentation") { - writeNestedClasses((*s),cn,marker); writeEnumerations((*s),cn,marker); writeTypedefs((*s),cn,marker); } @@ -1476,6 +1475,9 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark else if ((*s).name == "Property Documentation") { writeProperties((*s),cn,marker); } + else if ((*s).name == "Macro Documentation") { + writeMacros((*s),cn,marker); + } ++s; } writer.writeEndElement(); // @@ -4736,12 +4738,6 @@ void DitaXmlGenerator::writeParameters(const FunctionNode* fn, CodeMarker* marke } } -void DitaXmlGenerator::writeNestedClasses(const Section& s, - const ClassNode* cn, - CodeMarker* marker) -{ -} - void DitaXmlGenerator::writeEnumerations(const Section& s, const ClassNode* cn, CodeMarker* marker) @@ -4929,10 +4925,10 @@ void DitaXmlGenerator::writeProperties(const Section& s, writer.writeCharacters(pn->qualifiedDataType()); writer.writeCharacters(" "); writer.writeCharacters(pn->name()); - writerFunctions("READ",pn->getters()); - writerFunctions("WRITE",pn->setters()); - writerFunctions("RESET",pn->resetters()); - writerFunctions("NOTIFY",pn->notifiers()); + writePropParams("READ",pn->getters()); + writePropParams("WRITE",pn->setters()); + writePropParams("RESET",pn->resetters()); + writePropParams("NOTIFY",pn->notifiers()); if (pn->isDesignable() != pn->designableDefault()) { writer.writeCharacters(" DESIGNABLE "); if (!pn->runtimeDesignabilityFunction().isEmpty()) @@ -5058,7 +5054,92 @@ void DitaXmlGenerator::writeDataMembers(const Section& s, } } -void DitaXmlGenerator::writerFunctions(const QString& tag, const NodeList& nlist) +void DitaXmlGenerator::writeMacros(const Section& s, + const ClassNode* cn, + CodeMarker* marker) +{ + NodeList::ConstIterator m = s.members.begin(); + while (m != s.members.end()) { + if ((*m)->type() == Node::Function) { + const FunctionNode* fn = static_cast(*m); + if (fn->isMacro()) { + writer.writeStartElement(CXXDEFINE); + writer.writeAttribute("id",fn->guid()); + writer.writeStartElement(APINAME); + writer.writeCharacters(fn->name()); + writer.writeEndElement(); // + generateBrief(fn,marker); + writer.writeStartElement(CXXDEFINEDETAIL); + writer.writeStartElement(CXXDEFINEDEFINITION); + writer.writeStartElement(CXXDEFINEACCESSSPECIFIER); + writer.writeAttribute("value",fn->accessString()); + writer.writeEndElement(); // + + writer.writeStartElement(CXXDEFINEPROTOTYPE); + writer.writeCharacters("#define "); + writer.writeCharacters(fn->name()); + if (fn->metaness() == FunctionNode::MacroWithParams) { + QStringList params = fn->parameterNames(); + if (!params.isEmpty()) { + writer.writeCharacters("("); + for (int i = 0; i < params.size(); ++i) { + if (params[i].isEmpty()) + writer.writeCharacters("..."); + else + writer.writeCharacters(params[i]); + if ((i+1) < params.size()) + writer.writeCharacters(", "); + } + writer.writeCharacters(")"); + } + } + writer.writeEndElement(); // + + writer.writeStartElement(CXXDEFINENAMELOOKUP); + writer.writeCharacters(fn->name()); + writer.writeEndElement(); // + + if (fn->reimplementedFrom() != 0) { + FunctionNode* rfn = (FunctionNode*)fn->reimplementedFrom(); + writer.writeStartElement(CXXDEFINEREIMPLEMENTED); + writer.writeAttribute("href",rfn->ditaXmlHref()); + writer.writeCharacters(marker->plainFullName(rfn)); + writer.writeEndElement(); // + } + + if (fn->metaness() == FunctionNode::MacroWithParams) { + QStringList params = fn->parameterNames(); + if (!params.isEmpty()) { + writer.writeStartElement(CXXDEFINEPARAMETERS); + for (int i = 0; i < params.size(); ++i) { + writer.writeStartElement(CXXDEFINEPARAMETER); + writer.writeStartElement(CXXDEFINEPARAMETERDECLARATIONNAME); + writer.writeCharacters(params[i]); + writer.writeEndElement(); // + writer.writeEndElement(); // + } + writer.writeEndElement(); // + } + } + + writeLocation(fn); + writer.writeEndElement(); // + writer.writeStartElement(APIDESC); + + if (!fn->doc().isEmpty()) { + generateBody(fn, marker); + } + + writer.writeEndElement(); // + writer.writeEndElement(); // + writer.writeEndElement(); // + } + } + ++m; + } +} + +void DitaXmlGenerator::writePropParams(const QString& tag, const NodeList& nlist) { NodeList::const_iterator n = nlist.begin(); while (n != nlist.end()) { diff --git a/tools/qdoc3/ditaxmlgenerator.h b/tools/qdoc3/ditaxmlgenerator.h index 26788d7..446f735 100644 --- a/tools/qdoc3/ditaxmlgenerator.h +++ b/tools/qdoc3/ditaxmlgenerator.h @@ -118,9 +118,6 @@ class DitaXmlGenerator : public PageGenerator const ClassNode* cn, CodeMarker* marker); void writeParameters(const FunctionNode* fn, CodeMarker* marker); - void writeNestedClasses(const Section& s, - const ClassNode* cn, - CodeMarker* marker); void writeEnumerations(const Section& s, const ClassNode* cn, CodeMarker* marker); @@ -133,7 +130,10 @@ class DitaXmlGenerator : public PageGenerator void writeProperties(const Section& s, const ClassNode* cn, CodeMarker* marker); - void writerFunctions(const QString& tag, const NodeList& nlist); + void writeMacros(const Section& s, + const ClassNode* cn, + CodeMarker* marker); + void writePropParams(const QString& tag, const NodeList& nlist); private: enum SubTitleSize { SmallSubTitle, LargeSubTitle }; -- cgit v0.12 From 163c46079e60d346142abc383dd8c237690f3fd2 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 28 Jun 2010 15:07:23 +0200 Subject: ignore *.vcxproj.user --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index f187b23..fdb6843 100644 --- a/.gitignore +++ b/.gitignore @@ -134,6 +134,7 @@ qrc_*.cpp *.ncb *.vcxproj *.vcxproj.filters +*.vcxproj.user # MinGW generated files *.Debug -- cgit v0.12 From 2bf44ff6edc32eafa6d9ecd15c7c17eccc6a2ff8 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Mon, 28 Jun 2010 15:20:57 +0200 Subject: Updated JavaScriptCore from /home/khansen/dev/qtwebkit-qtscript-integration to javascriptcore-snapshot-28062010 ( 0fccd26d3624e80cf68873701ef70ad72ca66bec ) Changes in this update: - Fix Mac OS SnowLeopard-vs-Leopard deployment issue - Fix compilation with Intel compiler --- .../javascriptcore/JavaScriptCore/ChangeLog | 46 ++++++++++++++++++++++ .../JavaScriptCore/bytecode/Opcode.h | 2 +- .../javascriptcore/JavaScriptCore/wtf/Platform.h | 9 ++++- .../javascriptcore/JavaScriptCore/wtf/Vector.h | 2 +- src/3rdparty/javascriptcore/VERSION | 2 +- 5 files changed, 56 insertions(+), 5 deletions(-) diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog b/src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog index b0873ab..93431df 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog +++ b/src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog @@ -1,3 +1,49 @@ +2010-06-19 Thiago Macieira + + Reviewed by Kenneth Rohde Christiansen. + + Don't use __attribute__((may_alias)) with the Intel compiler, + as it doesn't understand it. + + * wtf/Vector.h: + +2010-06-19 Thiago Macieira + + Reviewed by Kenneth Rohde Christiansen. + + Fix compilation with the Intel C++ compiler (11.1.072). + + Like RVCT, label pointers must be void*, not const void*. + + * bytecode/Opcode.h: + +2010-06-19 Thiago Macieira + + Reviewed by Kenneth Rohde Christiansen. + + Add the WTF_COMPILER_INTEL for when the Intel compiler is used + for building. Usually, the Intel compiler masquerades as + another compiler in the system and gets away with it, but some + times specific fixes are required (such as when using language + extensions). + + * wtf/Platform.h: + +2010-06-07 Benjamin Poulain + + Reviewed by Simon Hausmann. + + [Qt] Crash when compiling on Snow Leopard and running on Leopard + https://bugs.webkit.org/show_bug.cgi?id=31403 + + Disable the use of pthread_setname_np and other symbols + when targetting Leopard. + + Use the defines TARGETING_XX instead of BUILDING_ON_XX + for features that cannot be used before Snow Leopard. + + * wtf/Platform.h: + 2010-05-10 Laszlo Gombos Reviewed by Darin Adler. diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/Opcode.h b/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/Opcode.h index d9b2153..9ac17ec 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/Opcode.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/Opcode.h @@ -196,7 +196,7 @@ namespace JSC { #undef VERIFY_OPCODE_ID #if HAVE(COMPUTED_GOTO) -#if COMPILER(RVCT) +#if COMPILER(RVCT) || COMPILER(INTEL) typedef void* Opcode; #else typedef const void* Opcode; diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h index be5f51b..5abe9a1 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h @@ -98,6 +98,11 @@ #define WTF_COMPILER_WINSCW 1 #endif +/* COMPILER(INTEL) - Intel C++ Compiler */ +#if defined(__INTEL_COMPILER) +#define WTF_COMPILER_INTEL 1 +#endif + /* COMPILER(ACC) - HP aCC */ #if defined(__HP_aCC) #define WTF_COMPILER_ACC 1 @@ -703,11 +708,11 @@ #define HAVE_SYS_TIME_H 1 #define HAVE_SYS_TIMEB_H 1 -#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) +#if !defined(TARGETING_TIGER) && !defined(TARGETING_LEOPARD) #define HAVE_DISPATCH_H 1 -#if !PLATFORM(IPHONE) && !PLATFORM(QT) +#if !PLATFORM(IPHONE) #define HAVE_MADV_FREE_REUSE 1 #define HAVE_MADV_FREE 1 #define HAVE_PTHREAD_SETNAME_NP 1 diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Vector.h b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Vector.h index 8a4ffba..156ff1a 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Vector.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Vector.h @@ -48,7 +48,7 @@ namespace WTF { #define WTF_ALIGN_OF(type) 0 #endif - #if COMPILER(GCC) && (((__GNUC__ * 100) + __GNUC_MINOR__) >= 303) + #if COMPILER(GCC) && !COMPILER(INTEL) && (((__GNUC__ * 100) + __GNUC_MINOR__) >= 303) typedef char __attribute__((__may_alias__)) AlignedBufferChar; #else typedef char AlignedBufferChar; diff --git a/src/3rdparty/javascriptcore/VERSION b/src/3rdparty/javascriptcore/VERSION index 4e01d20..6f5fb7c 100644 --- a/src/3rdparty/javascriptcore/VERSION +++ b/src/3rdparty/javascriptcore/VERSION @@ -8,4 +8,4 @@ The commit imported was from the and has the sha1 checksum - f483443ccd7d21f2a57a794c4d00a63505d2f5d9 + 0fccd26d3624e80cf68873701ef70ad72ca66bec -- cgit v0.12 From 2b599833c61de7bb164b0dffb5e28194d311972b Mon Sep 17 00:00:00 2001 From: John Brooks Date: Mon, 28 Jun 2010 20:13:50 +0200 Subject: Enable SSE2 for MSVC x64 builds, as it was incorrectly disabled Merge-request: 718 Reviewed-by: Benjamin Poulain --- src/corelib/global/qglobal.h | 6 ++---- src/corelib/tools/qsimd_p.h | 3 ++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 1eab394..76f35ac 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -412,15 +412,13 @@ namespace QT_NAMESPACE {} # if defined(__INTEL_COMPILER) # define Q_CC_INTEL # endif -/* x64 does not support mmx intrinsics on windows */ -# if (defined(Q_OS_WIN64) && defined(_M_X64)) +/* MSVC does not support SSE/MMX on x64 */ +# if (defined(Q_CC_MSVC) && defined(_M_X64)) # undef QT_HAVE_SSE -# undef QT_HAVE_SSE2 # undef QT_HAVE_MMX # undef QT_HAVE_3DNOW # endif - #elif defined(__BORLANDC__) || defined(__TURBOC__) # define Q_CC_BOR # define Q_INLINE_TEMPLATE diff --git a/src/corelib/tools/qsimd_p.h b/src/corelib/tools/qsimd_p.h index cbe6146..58d2dcb 100644 --- a/src/corelib/tools/qsimd_p.h +++ b/src/corelib/tools/qsimd_p.h @@ -58,7 +58,8 @@ QT_BEGIN_HEADER #endif // SSE intrinsics -#if defined(__SSE2__) && defined(QT_HAVE_SSE2) && !defined(QT_BOOTSTRAPPED) +#if defined(QT_HAVE_SSE2) && !defined(QT_BOOTSTRAPPED) && (defined(__SSE2__) \ + || (defined(Q_CC_MSVC) && (defined(_M_X64) || _M_IX86_FP == 2))) #if defined(QT_LINUXBASE) /// this is an evil hack - the posix_memalign declaration in LSB /// is wrong - see http://bugs.linuxbase.org/show_bug.cgi?id=2431 -- cgit v0.12