From 45f2e655b22cb6e845183a1090fb888c32c516b3 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 5 Apr 2011 20:11:00 +0200 Subject: Aim to fix Windows builds. --- doc/doc.pri | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/doc.pri b/doc/doc.pri index 68d729b..253e1b4 100644 --- a/doc/doc.pri +++ b/doc/doc.pri @@ -13,12 +13,14 @@ win32:!win32-g++* { unixstyle = true } +COPYWEBKITGUIDE = $$QT_SOURCE_TREE/examples/webkit/webkit-guide + $$unixstyle { QDOC = cd $$QT_SOURCE_TREE/tools/qdoc3/test && QT_BUILD_TREE=$$QT_BUILD_TREE QT_SOURCE_TREE=$$QT_SOURCE_TREE $$QT_BUILD_TREE/bin/qdoc3 $$DOCS_GENERATION_DEFINES - COPYWEBKITGUIDE = $$QT_SOURCE_TREE/examples/webkit/webkit-guide } else { QDOC = cd $$QT_SOURCE_TREE/tools/qdoc3/test && set QT_BUILD_TREE=$$QT_BUILD_TREE&& set QT_SOURCE_TREE=$$QT_SOURCE_TREE&& $$QT_BUILD_TREE/bin/qdoc3.exe $$DOCS_GENERATION_DEFINES QDOC = $$replace(QDOC, "/", "\\") + COPYWEBKITGUIDE = $$replace(COPYWEBKITGUIDE, "/", "\\") } ADP_DOCS_QDOCCONF_FILE = qt-build-docs-online.qdocconf QT_DOCUMENTATION = ($$QDOC qt-api-only.qdocconf assistant.qdocconf designer.qdocconf \ -- cgit v0.12 From c772ab261c3a09fab786306c70796c3c5f0efb15 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 6 Apr 2011 10:09:46 +0200 Subject: qdoc: Fixed QTBUG-18591 --- tools/qdoc3/htmlgenerator.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 114db26..88bc3e2 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -1494,8 +1494,10 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker) QString allQmlMembersLink = generateAllQmlMembersFile(qml_cn, marker); if (!allQmlMembersLink.isEmpty()) { + out() << "\n"; } s = sections.begin(); -- cgit v0.12 From 1db38c5ccb6188889bac1ae5e6f1d415a59ac444 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 6 Apr 2011 12:45:44 +0200 Subject: qdoc: Updated the QDoc manual. --- tools/qdoc3/ditaxmlgenerator.cpp | 24 ++++++++++++------------ tools/qdoc3/doc/corefeatures.qdoc | 8 ++++++++ tools/qdoc3/doc/qdoc-manual.qdoc | 15 +++------------ 3 files changed, 23 insertions(+), 24 deletions(-) create mode 100644 tools/qdoc3/doc/corefeatures.qdoc diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 1bc4992..69afde9 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -5664,29 +5664,29 @@ QString DitaXmlGenerator::metadataDefault(DitaTag t) const \list \o * \o * - \o + \o not used \o * \o * \o * \o * - \o + \o not used \o * - \o - \o - \o + \o not used + \o not used + \o not used \o * - \o + \o * \o * - \o + \o not used \o * \o * \o * \o * - \o - \o - \o - \o - \o + \o not used + \o not used + \o not used + \o not used + \o not used \o * \o * \endlist diff --git a/tools/qdoc3/doc/corefeatures.qdoc b/tools/qdoc3/doc/corefeatures.qdoc new file mode 100644 index 0000000..50bd726 --- /dev/null +++ b/tools/qdoc3/doc/corefeatures.qdoc @@ -0,0 +1,8 @@ +/*! + \page corefeatures.html + \title Core Features + + \input examples/signalandslots.qdocinc + \input examples/objectmodel.qdocinc + \input examples/layoutmanagement.qdocinc +*/ diff --git a/tools/qdoc3/doc/qdoc-manual.qdoc b/tools/qdoc3/doc/qdoc-manual.qdoc index 0e4055b..5b15fca 100644 --- a/tools/qdoc3/doc/qdoc-manual.qdoc +++ b/tools/qdoc3/doc/qdoc-manual.qdoc @@ -3999,20 +3999,11 @@ Here are links to the \c .qdocinc files used above: \l{signalandslots.qdocinc}, \l{objectmodel.qdocinc}, - \l{layoutmanagement.qdocinc}. QDoc renders this page as: - - \quotation - \raw HTML -

Core Features

- \endraw - - \input examples/signalandslots.qdocinc - \input examples/objectmodel.qdocinc - \input examples/layoutmanagement.qdocinc - \endquotation + \l{layoutmanagement.qdocinc}. QDoc renders this page + \l{corefeatures.html} {as shown here}. \target 2-argument-form} - \section2 \\include filename snippet-identifier + \section2 \\include filename snippet-identifier \span {class="newStuff"} {(new)} It is kind of a pain to make a separate \c .qdocinc file for every QDoc include snippet you want to use in multiple places in the -- cgit v0.12 From 90de2bb100b2f4a23655b2e914b93c644f1a4841 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 7 Apr 2011 09:59:57 +0200 Subject: qdoc: Updated the QDoc manual. --- src/gui/kernel/qwidget.cpp | 2 +- tools/qdoc3/doc/qdoc-manual.qdoc | 165 ++++++++++++++++++++++++++++++--------- 2 files changed, 128 insertions(+), 39 deletions(-) diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index ac35d42..9d9cd75 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -598,7 +598,7 @@ void QWidget::setAutoFillBackground(bool enabled) \brief The QWidget class is the base class of all user interface objects. \ingroup basicwidgets - + The widget is the atom of the user interface: it receives mouse, keyboard and other events from the window system, and paints a representation of itself on the screen. Every widget is rectangular, and they are sorted in a diff --git a/tools/qdoc3/doc/qdoc-manual.qdoc b/tools/qdoc3/doc/qdoc-manual.qdoc index 5b15fca..31c56a1 100644 --- a/tools/qdoc3/doc/qdoc-manual.qdoc +++ b/tools/qdoc3/doc/qdoc-manual.qdoc @@ -66,6 +66,7 @@ \o \l {Compatibility Issues} \o \l {qt.qdocconf} \o \l {minimum.qdocconf} + \o \l {Generating DITA XML Output} \endlist \endlist @@ -4037,48 +4038,77 @@ sent to the QDoc input stream. You can even nest these snippets, although it's not clear why you would want to do that. - \target meta-command + \target meta-command \section1 \\meta - The \\meta command is the QDoc equivalent to the HTML - \c meta tag. + The \\meta command is mainly used for including metadata in DITA + XML files. It is also used when generating HTML output for specifying + the \e maintainer(s) of a C++ class. - The command accepts two arguments: The first argument (the - following word) is equivalent to the HTML meta tag's \e name - variable, and the second argument (the rest of the line) is - equivalent to the tag's \e contents variable. + The command has two arguments: The first argument is the name of the + metadata attribute you wish to set, and the second argument is the + value for the attribute. Each argument should be enclosed in curly + brackets, as shown in this example: - \code - / *! - \meta author Summerfield - - \section1 Automatic Dialogs - - \abstract - This article shows how to maintain sets of - "attributes" (QVariant values), and how to allow - users to view and edit them using dialogs that are - created dynamically based on the attributes and - their types. - \endabstract - - The Attributes class described in this article holds a - set of QVariants, and can create a dialog to present - the QVariants to the user in an appropriate way. - - ... - * / - \endcode - - QDoc renders this as: + \code + / *! + \class QWidget + \brief The QWidget class is the base class of all user interface objects. + + \ingroup basicwidgets + + \meta {technology} {User Interface} + \meta {platform} {OS X 10.6} + \meta {platform} {Symbian} + \meta {platform} {MeeGo} + \meta {audience} {user} + \meta {audience} {programmer} + \meta {audience} {designer} + * / + \endcode - \code - - ... - - ... - - \endcode + When running QDoc to generate HTML, the example above will have no + effect on the generated output, but if you run QDoc to generate + DITA XML, the example will generate the following: + + \code + + + + + QWidget + the QWidget class is the base class of all user interface objects. + + Qt Development Frameworks + Nokia + + + Nokia + + + + + + + Class reference + + Qt Reference Documentation + + + + QtGui + + + + + + + + \endcode + + In the example output, several values have been set using defualt + values obtained from the QDoc configuration file. See \l + {Generating DITA XML Output} for details. \target omit-command \section1 \\omit @@ -6923,7 +6953,7 @@ \page 21-1-minimum-qdocconf.html \previouspage qt.qdocconf \contentspage Table of Contents - \nextpage Table of Contents + \nextpage Generating DITA XML Output \title minimum.qdocconf @@ -6942,6 +6972,65 @@ */ /*! + \page 21-3-qt-dita-xml-output.html + \previouspage minimum.qdocconf + \contentspage Table of Contents + \nextpage Table of Contents + + \title Generating DITA XML Output + + QDoc can generate \l {http://dita.xml.org} {DITA XML output}. + + In your confifiguration file, set your \c {outputformats} variable + to \c {DITAXML}, and send the output to an appropriate directory: + + \code + outputdir = $QTDIR/doc/ditaxml + outputformats = DITAXML + \endcode + + And include these macros in your configuration file to prevent + QDoc from doing some escaping that doesn't validate in XML: + + \code + macro.aacute.DITAXML = "á" + macro.Aring.DITAXML = "Å" + macro.aring.DITAXML = "å" + macro.Auml.DITAXML = "Ä" + macro.br.DITAXML = " " + macro.BR.DITAXML = " " + macro.copyright.DITAXML = "©" + macro.eacute.DITAXML = "é" + macro.hr.DITAXML = " " + macro.iacute.DITAXML = "í" + macro.oslash.DITAXML = "ø" + macro.ouml.DITAXML = "ö" + macro.raisedaster.DITAXML = "*" + macro.rarrow.DITAXML = "→" + macro.reg.DITAXML = "®" + macro.uuml.DITAXML = "ü" + macro.mdash.DITAXML = "—" + macro.emptyspan.DITAXML = " " + \endcode + + You can also set default values for some of the tags in the DITA + \c {} and \c {} elements: + + \code + dita.metadata.default.author = Qt Development Frameworks + dita.metadata.default.permissions = all + dita.metadata.default.publisher = Nokia + dita.metadata.default.copyryear = 2011 + dita.metadata.default.copyrholder = Nokia + dita.metadata.default.audience = programmer + \endcode + + See the \l {12-0-qdoc-commands-miscellaneous.html#meta-command} + {\\meta} command for more details on DITA metadata. + +*/ + +/*! \page 22-qdoc-configuration-generalvariables.html \previouspage The QDoc Configuration File \contentspage Table of Contents -- cgit v0.12 From 58e28ff518ee983f6af0e8937bbd355a2587c4d3 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 7 Apr 2011 11:47:40 +0200 Subject: qdoc: Updated the QDoc manual. --- tools/qdoc3/doc/qdoc-manual.qdoc | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/tools/qdoc3/doc/qdoc-manual.qdoc b/tools/qdoc3/doc/qdoc-manual.qdoc index 31c56a1..9039296 100644 --- a/tools/qdoc3/doc/qdoc-manual.qdoc +++ b/tools/qdoc3/doc/qdoc-manual.qdoc @@ -7560,23 +7560,26 @@ \target macro-variable \section1 macro - The \c macro variable can be used to create your own QDoc - commands. - - The general syntax is \tt {macro.\e{command} = - "\e{definition}}". The definition can be described using QDoc - syntax. In addition it is possible to provide an HTML definition - by appending .HTML to the variable. + The \c macro variable is used to create your own simple QDoc + commands or to redefine existing QDoc commands. The syntax is \tt + {macro.\e{command} = \e{definition}}, where the definition is + written using QDoc syntax. - For example in \l qt.qdocconf: + A macro command can be restricted for use in one type of output + generation. By appending \c {.HTML} to the macro name, for + example, the macro is only used when generating HTML output. By + appending \c {.DITAXML} to the macro name, the macro is only used + when generating DITA XML. \code macro.gui = "\\bold" macro.raisedaster.HTML = "*" \endcode - makes sure that the \\gui command renders its argument using a - bold font, and that \\raisedaster renders a '*'. + The first macro defines the \\gui command to render its argument + using a bold font. The second macro defines the \\raisedaster + command to render a superscript asterisk, but only when generating + HTML. \target naturallanguage-variable \section1 naturallanguage -- cgit v0.12 From bd0f7729ad5371b3b0ba42976451b622b1209b45 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 7 Apr 2011 13:21:25 +0200 Subject: qdoc: Updated the QDoc manual. --- tools/qdoc3/doc/qdoc-manual.qdoc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/qdoc3/doc/qdoc-manual.qdoc b/tools/qdoc3/doc/qdoc-manual.qdoc index 9039296..da0646e 100644 --- a/tools/qdoc3/doc/qdoc-manual.qdoc +++ b/tools/qdoc3/doc/qdoc-manual.qdoc @@ -7061,7 +7061,7 @@ information see the \l {Compatibility Issues} {compatibility section}. - See also \l {macro-command} {macro}. + See also \l {macro-variable} {macro}. \target codeindent-variable \section1 codeindent @@ -7561,11 +7561,10 @@ \section1 macro The \c macro variable is used to create your own simple QDoc - commands or to redefine existing QDoc commands. The syntax is \tt - {macro.\e{command} = \e{definition}}, where the definition is - written using QDoc syntax. + commands. The syntax is \tt {macro.\e{command} = \e{definition}}, + where the definition is written using QDoc syntax. - A macro command can be restricted for use in one type of output + A macro variable can be restricted for use in one type of output generation. By appending \c {.HTML} to the macro name, for example, the macro is only used when generating HTML output. By appending \c {.DITAXML} to the macro name, the macro is only used @@ -7581,6 +7580,8 @@ command to render a superscript asterisk, but only when generating HTML. + See also \l {alias-variable} {alias}. + \target naturallanguage-variable \section1 naturallanguage -- cgit v0.12 From 779a58513f0c2d4e55410aee4cae6a6510841d57 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 7 Apr 2011 13:51:45 +0200 Subject: qdoc: Added missing copyright notice --- tools/qdoc3/doc/corefeatures.qdoc | 41 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/tools/qdoc3/doc/corefeatures.qdoc b/tools/qdoc3/doc/corefeatures.qdoc index 50bd726..ff903f8 100644 --- a/tools/qdoc3/doc/corefeatures.qdoc +++ b/tools/qdoc3/doc/corefeatures.qdoc @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the tools applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + /*! \page corefeatures.html \title Core Features -- cgit v0.12 From 384679ff46d2f970de3010fd6aac8a697dbfb907 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Thu, 7 Apr 2011 19:25:06 +0200 Subject: Ensured that incomplete downloads are removed. Task-number: QTBUG-18509 --- doc/src/examples/ftp.qdoc | 4 +++- examples/network/qftp/ftpwindow.cpp | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/doc/src/examples/ftp.qdoc b/doc/src/examples/ftp.qdoc index 4fa2cfd..841d298 100644 --- a/doc/src/examples/ftp.qdoc +++ b/doc/src/examples/ftp.qdoc @@ -131,7 +131,9 @@ \snippet examples/network/qftp/ftpwindow.cpp 5 - QFtp supports canceling the download of files. + QFtp supports canceling the download of files. We make sure that + any file that is currently being written to is closed and removed, + and tidy up by deleting the file object. \snippet examples/network/qftp/ftpwindow.cpp 6 diff --git a/examples/network/qftp/ftpwindow.cpp b/examples/network/qftp/ftpwindow.cpp index c3e629f..159cad6 100644 --- a/examples/network/qftp/ftpwindow.cpp +++ b/examples/network/qftp/ftpwindow.cpp @@ -243,6 +243,12 @@ void FtpWindow::downloadFile() void FtpWindow::cancelDownload() { ftp->abort(); + + if (file->exists()) { + file->close(); + file->remove(); + } + delete file; } //![5] -- cgit v0.12 From 932b28483f82f3fbc3a007ecdc5fbb152b504024 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Fri, 8 Apr 2011 08:05:55 +0200 Subject: qdoc: Fixed license comment. --- tools/qdoc3/doc/corefeatures.qdoc | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/tools/qdoc3/doc/corefeatures.qdoc b/tools/qdoc3/doc/corefeatures.qdoc index ff903f8..ee579cf 100644 --- a/tools/qdoc3/doc/corefeatures.qdoc +++ b/tools/qdoc3/doc/corefeatures.qdoc @@ -4,37 +4,23 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the tools applications of the Qt Toolkit. +** This file is part of the documentation of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL$ +** $QT_BEGIN_LICENSE:FDL$ ** No Commercial Usage ** This file contains pre-release code and may not be distributed. ** You may use this file in accordance with the terms and conditions ** contained in the Technology Preview License Agreement accompanying ** this package. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU Free Documentation License +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of this +** file. ** ** If you have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** ** $QT_END_LICENSE$ ** ****************************************************************************/ -- cgit v0.12 From a769192ef0393afa07c08a1672b45604fdf64be1 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 11 Apr 2011 15:44:03 +0200 Subject: Doc: Fixed reference to a name in a table. Task-number: QTBUG-18679 --- src/gui/itemviews/qdatawidgetmapper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/itemviews/qdatawidgetmapper.cpp b/src/gui/itemviews/qdatawidgetmapper.cpp index 745ef5a..dac4613 100644 --- a/src/gui/itemviews/qdatawidgetmapper.cpp +++ b/src/gui/itemviews/qdatawidgetmapper.cpp @@ -291,7 +291,7 @@ void QDataWidgetMapperPrivate::_q_modelDestroyed() \snippet doc/src/snippets/code/src_gui_itemviews_qdatawidgetmapper.cpp 0 After the call to toFirst(), \c mySpinBox displays the value \c{1}, \c myLineEdit - displays \c {Nokia Corporation and/or its subsidiary(-ies)} and \c myCountryChooser displays \c{Oslo}. The + displays \c{Qt Norway} and \c myCountryChooser displays \c{Oslo}. The navigational functions toFirst(), toNext(), toPrevious(), toLast() and setCurrentIndex() can be used to navigate in the model and update the widgets with contents from the model. -- cgit v0.12 From 16fe5d5b87ed1d819bf0791fabbd121481d62d22 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 13 Apr 2011 09:31:21 +0200 Subject: qdoc: Last commit before merge into master. Added a function to class Config to unload the qdocconf file. This is for the qdoc wizard. --- tools/qdoc3/config.cpp | 27 ++++++++++++++++++++++++++- tools/qdoc3/config.h | 1 + 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/tools/qdoc3/config.cpp b/tools/qdoc3/config.cpp index 838f6ac..eaec327 100644 --- a/tools/qdoc3/config.cpp +++ b/tools/qdoc3/config.cpp @@ -48,7 +48,7 @@ #include #include #include - +#include #include "config.h" #include @@ -175,6 +175,7 @@ Config::Config(const QString& programName) } /*! + The destructor has nothing special to do. */ Config::~Config() { @@ -202,6 +203,30 @@ void Config::load(const QString& fileName) } /*! + Writes the qdoc configuration data to the named file. + The previous contents of the file are overwritten. + */ +void Config::unload(const QString& fileName) +{ + + QStringMultiMap::ConstIterator v = stringValueMap.begin(); + while (v != stringValueMap.end()) { + qDebug() << v.key() << " = " << v.value(); +#if 0 + if (v.key().startsWith(varDot)) { + QString subVar = v.key().mid(varDot.length()); + int dot = subVar.indexOf(QLatin1Char('.')); + if (dot != -1) + subVar.truncate(dot); + t.insert(subVar,v.value()); + } +#endif + ++v; + } + qDebug() << "fileName:" << fileName; +} + +/*! Joins all the strings in \a values into a single string with the individual \a values separated by ' '. Then it inserts the result into the string list map with \a var as the key. diff --git a/tools/qdoc3/config.h b/tools/qdoc3/config.h index 8e19ed2..94f0060 100644 --- a/tools/qdoc3/config.h +++ b/tools/qdoc3/config.h @@ -63,6 +63,7 @@ class Config ~Config(); void load(const QString& fileName); + void unload(const QString& fileName); void setStringList(const QString& var, const QStringList& values); const QString& programName() const { return prog; } -- cgit v0.12 From 6414bda3218790fb8a20a8ff5b3acf6fc6e206da Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 14 Apr 2011 13:40:36 +0200 Subject: qdoc: Completed task QTBUG-18733 --- tools/qdoc3/codemarker.h | 3 +- tools/qdoc3/ditaxmlgenerator.cpp | 76 +++++++++++++++++++++++------ tools/qdoc3/ditaxmlgenerator.h | 13 +++-- tools/qdoc3/htmlgenerator.cpp | 101 +-------------------------------------- tools/qdoc3/pagegenerator.cpp | 6 --- 5 files changed, 74 insertions(+), 125 deletions(-) diff --git a/tools/qdoc3/codemarker.h b/tools/qdoc3/codemarker.h index 21bc31f..00660e7 100644 --- a/tools/qdoc3/codemarker.h +++ b/tools/qdoc3/codemarker.h @@ -165,10 +165,11 @@ class CodeMarker static const Node *nodeForString(const QString& string); static QString stringForNode(const Node *node); + QString typified(const QString &string); + protected: virtual QString sortName(const Node *node); QString protect(const QString &string); - QString typified(const QString &string); QString taggedNode(const Node* node); #ifdef QDOC_QML QString taggedQmlNode(const Node* node); diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 69afde9..e394249 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -92,6 +92,7 @@ QString DitaXmlGenerator::ditaTags[] = "apiDesc", "APIMap", "apiName", + "apiRelation", "audience", "author", "b", @@ -284,14 +285,15 @@ void DitaXmlGenerator::writeCharacters(const QString& text) with the \a href attribute and the \a text. */ void DitaXmlGenerator::addLink(const QString& href, - const QStringRef& text) + const QStringRef& text, + DitaTag t) { if (!href.isEmpty()) { - writeStartTag(DT_xref); + writeStartTag(t); // formathtml xmlWriter().writeAttribute("href", href); writeCharacters(text.toString()); - writeEndTag(); // + writeEndTag(); // } else { writeCharacters(text.toString()); @@ -1718,7 +1720,7 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark */ generateHeader(inner, fullTitle); generateBrief(inner, marker); // - writeProlog(inner,marker); + writeProlog(inner); writeStartTag(DT_cxxClassDetail); writeStartTag(DT_cxxClassDefinition); @@ -1838,7 +1840,7 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark generateHeader(inner, fullTitle); generateBrief(inner, marker); // - writeProlog(inner,marker); + writeProlog(inner); writeStartTag(DT_cxxClassDetail); writeStartTag(DT_cxxClassDefinition); @@ -1974,7 +1976,7 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark */ generateHeader(inner, fullTitle); generateBrief(inner, marker); // - writeProlog(inner,marker); + writeProlog(inner); writeStartTag(DT_cxxClassDetail); enterApiDesc(QString(),title); @@ -2093,7 +2095,7 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark generateHeader(inner, fullTitle); generateBrief(inner, marker); // - writeProlog(inner,marker); + writeProlog(inner); writeStartTag(DT_cxxClassDetail); enterApiDesc(QString(),title); @@ -2195,7 +2197,7 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode* fake, CodeMarker* marker generateHeader(fake, fullTitle); generateBrief(fake, marker); // - writeProlog(fake, marker); + writeProlog(fake); writeStartTag(DT_body); enterSection(QString(),QString()); @@ -4712,7 +4714,7 @@ void DitaXmlGenerator::writeLocation(const Node* n) Write the elements. */ void DitaXmlGenerator::writeFunctions(const Section& s, - const Node* n, + const InnerNode* parent, CodeMarker* marker, const QString& attribute) { @@ -4775,7 +4777,7 @@ void DitaXmlGenerator::writeFunctions(const Section& s, } } - if (fn->name() == n->name()) { + if (fn->name() == parent->name()) { writeStartTag(DT_cxxFunctionConstructor); xmlWriter().writeAttribute("name","constructor"); xmlWriter().writeAttribute("value","constructor"); @@ -4789,7 +4791,8 @@ void DitaXmlGenerator::writeFunctions(const Section& s, } else { writeStartTag(DT_cxxFunctionDeclaredType); - writeCharacters(fn->returnType()); + QString src = marker->typified(fn->returnType()); + replaceTypesWithLinks(fn,parent,marker,src); writeEndTag(); // } @@ -4825,7 +4828,7 @@ void DitaXmlGenerator::writeFunctions(const Section& s, writeEndTag(); // } } - writeParameters(fn); + writeParameters(fn,parent,marker); writeLocation(fn); writeEndTag(); // @@ -4846,10 +4849,51 @@ void DitaXmlGenerator::writeFunctions(const Section& s, } } +static const QString typeTag("type"); +static const QChar charLangle = '<'; +static const QChar charAt = '@'; + +/*! + This function replaces class and enum names with + elements, i.e. links. + */ +void DitaXmlGenerator::replaceTypesWithLinks(const Node* n, + const InnerNode* parent, + CodeMarker* marker, + QString& src) +{ + QStringRef arg; + QStringRef par1; + int srcSize = src.size(); + QString text; + for (int i=0; iresolveTarget(arg.toString(), myTree, parent, n); + addLink(linkForNode(tn,parent),arg,DT_apiRelation); + } + } + else { + text += src.at(i++); + } + } + if (!text.isEmpty()) { + writeCharacters(text); + text.clear(); + } +} + /*! This function writes the element. */ -void DitaXmlGenerator::writeParameters(const FunctionNode* fn) +void DitaXmlGenerator::writeParameters(const FunctionNode* fn, + const InnerNode* parent, + CodeMarker* marker) { const QList& parameters = fn->parameters(); if (!parameters.isEmpty()) { @@ -4858,7 +4902,9 @@ void DitaXmlGenerator::writeParameters(const FunctionNode* fn) while (p != parameters.end()) { writeStartTag(DT_cxxFunctionParameter); writeStartTag(DT_cxxFunctionParameterDeclaredType); - writeCharacters((*p).leftType()); + QString src = marker->typified((*p).leftType()); + replaceTypesWithLinks(fn,parent,marker,src); + //writeCharacters((*p).leftType()); if (!(*p).rightType().isEmpty()) writeCharacters((*p).rightType()); writeEndTag(); // @@ -5695,7 +5741,7 @@ QString DitaXmlGenerator::metadataDefault(DitaTag t) const */ void -DitaXmlGenerator::writeProlog(const InnerNode* inner, CodeMarker* marker) +DitaXmlGenerator::writeProlog(const InnerNode* inner) { if (!inner) return; diff --git a/tools/qdoc3/ditaxmlgenerator.h b/tools/qdoc3/ditaxmlgenerator.h index ffca234..0044eff 100644 --- a/tools/qdoc3/ditaxmlgenerator.h +++ b/tools/qdoc3/ditaxmlgenerator.h @@ -87,6 +87,7 @@ class DitaXmlGenerator : public PageGenerator DT_apiDesc, DT_APIMap, DT_apiName, + DT_apiRelation, DT_audience, DT_author, DT_b, @@ -292,11 +293,15 @@ class DitaXmlGenerator : public PageGenerator void writeDerivations(const ClassNode* cn, CodeMarker* marker); void writeLocation(const Node* n); void writeFunctions(const Section& s, - const Node* n, + const InnerNode* parent, CodeMarker* marker, const QString& attribute = QString()); void writeNestedClasses(const Section& s, const Node* n); - void writeParameters(const FunctionNode* fn); + void replaceTypesWithLinks(const Node* n, + const InnerNode* parent, + CodeMarker* marker, + QString& src); + void writeParameters(const FunctionNode* fn, const InnerNode* parent, CodeMarker* marker); void writeEnumerations(const Section& s, CodeMarker* marker, const QString& attribute = QString()); @@ -315,7 +320,7 @@ class DitaXmlGenerator : public PageGenerator void writePropertyParameter(const QString& tag, const NodeList& nlist); void writeRelatedLinks(const FakeNode* fake, CodeMarker* marker); void writeLink(const Node* node, const QString& tex, const QString& role); - void writeProlog(const InnerNode* inner, CodeMarker* marker); + void writeProlog(const InnerNode* inner); bool writeMetadataElement(const InnerNode* inner, DitaXmlGenerator::DitaTag t, bool force=true); @@ -438,7 +443,7 @@ class DitaXmlGenerator : public PageGenerator virtual void generateInnerNode(const InnerNode* node); QXmlStreamWriter& xmlWriter(); void writeApiDesc(const Node* node, CodeMarker* marker, const QString& title); - void addLink(const QString& href, const QStringRef& text); + void addLink(const QString& href, const QStringRef& text, DitaTag t = DT_xref); void writeDitaMap(); void writeStartTag(DitaTag t); void writeEndTag(DitaTag t=DT_NONE); diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 88bc3e2..a6cf646 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -93,104 +93,6 @@ static QRegExp typeTag("(<@(type|headerfile|func)(?: +[^>]*)?>)(.*)()"); static QRegExp spanTag(""); static QRegExp unknownTag("]*>"); -bool parseArg(const QString &src, - const QString &tag, - int *pos, - int n, - QStringRef *contents, - QStringRef *par1 = 0, - bool debug = false) -{ -#define SKIP_CHAR(c) \ - if (debug) \ - qDebug() << "looking for " << c << " at " << QString(src.data() + i, n - i); \ - if (i >= n || src[i] != c) { \ - if (debug) \ - qDebug() << " char '" << c << "' not found"; \ - return false; \ - } \ - ++i; - - -#define SKIP_SPACE \ - while (i < n && src[i] == ' ') \ - ++i; - - int i = *pos; - int j = i; - - // assume "<@" has been parsed outside - //SKIP_CHAR('<'); - //SKIP_CHAR('@'); - - if (tag != QStringRef(&src, i, tag.length())) { - if (0 && debug) - qDebug() << "tag " << tag << " not found at " << i; - return false; - } - - if (debug) - qDebug() << "haystack:" << src << "needle:" << tag << "i:" <).*()"); - if (par1) { - SKIP_SPACE; - // read parameter name - j = i; - while (i < n && src[i].isLetter()) - ++i; - if (src[i] == '=') { - if (debug) - qDebug() << "read parameter" << QString(src.data() + j, i - j); - SKIP_CHAR('='); - SKIP_CHAR('"'); - // skip parameter name - j = i; - while (i < n && src[i] != '"') - ++i; - *par1 = QStringRef(&src, j, i - j); - SKIP_CHAR('"'); - SKIP_SPACE; - } else { - if (debug) - qDebug() << "no optional parameter found"; - } - } - SKIP_SPACE; - SKIP_CHAR('>'); - - // find contents up to closing " - j = i; - for (; true; ++i) { - if (i + 4 + tag.length() > n) - return false; - if (src[i] != '<') - continue; - if (src[i + 1] != '/') - continue; - if (src[i + 2] != '@') - continue; - if (tag != QStringRef(&src, i + 3, tag.length())) - continue; - if (src[i + 3 + tag.length()] != '>') - continue; - break; - } - - *contents = QStringRef(&src, j, i - j); - - i += tag.length() + 4; - - *pos = i; - if (debug) - qDebug() << " tag " << tag << " found: pos now: " << i; - return true; -#undef SKIP_CHAR -} - static void addLink(const QString &linkTarget, const QStringRef &nestedStuff, QString *res) @@ -2849,7 +2751,7 @@ QString HtmlGenerator::highlightedCode(const QString& markedCode, static const QString headerTag("headerfile"); static const QString funcTag("func"); static const QString linkTag("link"); - + // replace all <@link> tags: "(<@link node=\"([^\"]+)\">).*()" bool done = false; for (int i = 0, srcSize = src.size(); i < srcSize;) { @@ -2884,6 +2786,7 @@ QString HtmlGenerator::highlightedCode(const QString& markedCode, if (src.at(i) == charLangle && src.at(i + 1) == charAt) { i += 2; if (parseArg(src, funcTag, &i, srcSize, &arg, &par1)) { + const Node* n = marker->resolveTarget(par1.toString(), myTree, relative); diff --git a/tools/qdoc3/pagegenerator.cpp b/tools/qdoc3/pagegenerator.cpp index d5564f7..d331d41 100644 --- a/tools/qdoc3/pagegenerator.cpp +++ b/tools/qdoc3/pagegenerator.cpp @@ -70,12 +70,6 @@ PageGenerator::~PageGenerator() endSubPage(); } -static QRegExp linkTag("(<@link node=\"([^\"]+)\">).*()"); -static QRegExp funcTag("(<@func target=\"([^\"]*)\">)(.*)()"); -static QRegExp typeTag("(<@(type|headerfile|func)(?: +[^>]*)?>)(.*)()"); -static QRegExp spanTag(""); -static QRegExp unknownTag("]*>"); - bool PageGenerator::parseArg(const QString& src, const QString& tag, int* pos, -- cgit v0.12 From 75aea79ce599d5f62a1642a875774544f548c904 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Fri, 15 Apr 2011 12:22:02 +0200 Subject: qdoc: Completed task QTBUG-18790 --- tools/qdoc3/ditaxmlgenerator.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index e394249..5f44cd8 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -769,6 +769,7 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, case Atom::Code: { writeStartTag(DT_codeblock); + xmlWriter().writeAttribute("outputclass","cpp"); QString chars = trimmedTrailing(atom->string()); writeText(chars, marker, relative); writeEndTag(); // @@ -776,6 +777,7 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, break; case Atom::Qml: writeStartTag(DT_codeblock); + xmlWriter().writeAttribute("outputclass","qml"); writeText(trimmedTrailing(atom->string()), marker, relative); writeEndTag(); // break; -- cgit v0.12 From 2af5f51c1a7e4b9b5af4eafff8f64f2f8978c3a2 Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Fri, 29 Apr 2011 14:24:54 +0200 Subject: Fixing potential js hole in the js function for the feedback channel. --- doc/src/template/scripts/functions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/template/scripts/functions.js b/doc/src/template/scripts/functions.js index 62bc535..3ab4a08 100755 --- a/doc/src/template/scripts/functions.js +++ b/doc/src/template/scripts/functions.js @@ -184,7 +184,7 @@ var blankRE=/^\s*$/; function CheckEmptyAndLoadList() { /* Start Extracting information for feedback and adding this to the feedback form */ - var pageUrl = window.location.href; + var pageUrl = window.location.pathname; var pageVal = $('title').html(); $('#pageType').removeClass('red'); $('#feedUrl').remove(); -- cgit v0.12