summaryrefslogtreecommitdiffstats
path: root/src/tools/qdoc
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/qdoc')
-rw-r--r--src/tools/qdoc/atom.cpp67
-rw-r--r--src/tools/qdoc/atom.h57
-rw-r--r--src/tools/qdoc/codechunk.cpp14
-rw-r--r--src/tools/qdoc/codechunk.h14
-rw-r--r--src/tools/qdoc/codemarker.cpp18
-rw-r--r--src/tools/qdoc/codemarker.h20
-rw-r--r--src/tools/qdoc/codeparser.cpp38
-rw-r--r--src/tools/qdoc/codeparser.h19
-rw-r--r--src/tools/qdoc/config.cpp58
-rw-r--r--src/tools/qdoc/config.h19
-rw-r--r--src/tools/qdoc/cppcodemarker.cpp90
-rw-r--r--src/tools/qdoc/cppcodemarker.h46
-rw-r--r--src/tools/qdoc/cppcodeparser.cpp365
-rw-r--r--src/tools/qdoc/cppcodeparser.h52
-rw-r--r--src/tools/qdoc/ditaxmlgenerator.cpp5993
-rw-r--r--src/tools/qdoc/ditaxmlgenerator.h520
-rw-r--r--src/tools/qdoc/doc.cpp62
-rw-r--r--src/tools/qdoc/doc.h24
-rw-r--r--src/tools/qdoc/doc/corefeatures.qdoc12
-rw-r--r--src/tools/qdoc/doc/examples/componentset/ProgressBar.qml8
-rw-r--r--src/tools/qdoc/doc/examples/componentset/Switch.qml8
-rw-r--r--src/tools/qdoc/doc/examples/componentset/TabWidget.qml8
-rw-r--r--src/tools/qdoc/doc/examples/componentset/uicomponents.qdoc.sample12
-rw-r--r--src/tools/qdoc/doc/examples/cpp.qdoc.sample12
-rw-r--r--src/tools/qdoc/doc/examples/examples.qdoc12
-rw-r--r--src/tools/qdoc/doc/examples/main.cpp14
-rw-r--r--src/tools/qdoc/doc/examples/mainwindow.cpp16
-rw-r--r--src/tools/qdoc/doc/examples/qml.qdoc.sample12
-rw-r--r--src/tools/qdoc/doc/examples/samples.qdocinc12
-rw-r--r--src/tools/qdoc/doc/images/link-to-qquickitem.pngbin0 -> 46571 bytes
-rw-r--r--src/tools/qdoc/doc/images/links-to-broken-links.pngbin0 -> 16569 bytes
-rw-r--r--src/tools/qdoc/doc/images/links-to-links.pngbin0 -> 10042 bytes
-rw-r--r--src/tools/qdoc/doc/images/qa-table.pngbin0 -> 7057 bytes
-rw-r--r--src/tools/qdoc/doc/qa-pages.qdoc109
-rw-r--r--src/tools/qdoc/doc/qdoc-guide/qdoc-guide.qdoc12
-rw-r--r--src/tools/qdoc/doc/qdoc-guide/qtwritingstyle-cpp.qdoc12
-rw-r--r--src/tools/qdoc/doc/qdoc-guide/qtwritingstyle-qml.qdoc12
-rw-r--r--src/tools/qdoc/doc/qdoc-manual-DITA.qdoc12
-rw-r--r--src/tools/qdoc/doc/qdoc-manual-cmdindex.qdoc12
-rw-r--r--src/tools/qdoc/doc/qdoc-manual-contextcmds.qdoc12
-rw-r--r--src/tools/qdoc/doc/qdoc-manual-intro.qdoc161
-rw-r--r--src/tools/qdoc/doc/qdoc-manual-markupcmds.qdoc119
-rw-r--r--src/tools/qdoc/doc/qdoc-manual-qdocconf.qdoc21
-rw-r--r--src/tools/qdoc/doc/qdoc-manual-topiccmds.qdoc12
-rw-r--r--src/tools/qdoc/doc/qdoc-manual.qdoc13
-rw-r--r--src/tools/qdoc/doc/qdoc-minimum-qdocconf.qdoc12
-rw-r--r--src/tools/qdoc/doc/qtgui-qdocconf.qdoc12
-rw-r--r--src/tools/qdoc/editdistance.cpp14
-rw-r--r--src/tools/qdoc/editdistance.h14
-rw-r--r--src/tools/qdoc/generator.cpp148
-rw-r--r--src/tools/qdoc/generator.h51
-rw-r--r--src/tools/qdoc/helpprojectwriter.cpp92
-rw-r--r--src/tools/qdoc/helpprojectwriter.h19
-rw-r--r--src/tools/qdoc/htmlgenerator.cpp566
-rw-r--r--src/tools/qdoc/htmlgenerator.h54
-rw-r--r--src/tools/qdoc/jscodemarker.cpp14
-rw-r--r--src/tools/qdoc/jscodemarker.h24
-rw-r--r--src/tools/qdoc/location.cpp30
-rw-r--r--src/tools/qdoc/location.h18
-rw-r--r--src/tools/qdoc/main.cpp505
-rw-r--r--src/tools/qdoc/node.cpp434
-rw-r--r--src/tools/qdoc/node.h492
-rw-r--r--src/tools/qdoc/openedlist.cpp14
-rw-r--r--src/tools/qdoc/openedlist.h14
-rw-r--r--src/tools/qdoc/plaincodemarker.cpp14
-rw-r--r--src/tools/qdoc/plaincodemarker.h40
-rw-r--r--src/tools/qdoc/puredocparser.cpp26
-rw-r--r--src/tools/qdoc/puredocparser.h18
-rw-r--r--src/tools/qdoc/qdoc.pro2
-rw-r--r--src/tools/qdoc/qdocdatabase.cpp492
-rw-r--r--src/tools/qdoc/qdocdatabase.h130
-rw-r--r--src/tools/qdoc/qdocindexfiles.cpp379
-rw-r--r--src/tools/qdoc/qdocindexfiles.h14
-rw-r--r--src/tools/qdoc/qdoctagfiles.cpp41
-rw-r--r--src/tools/qdoc/qdoctagfiles.h14
-rw-r--r--src/tools/qdoc/qmlcodemarker.cpp14
-rw-r--r--src/tools/qdoc/qmlcodemarker.h34
-rw-r--r--src/tools/qdoc/qmlcodeparser.cpp39
-rw-r--r--src/tools/qdoc/qmlcodeparser.h26
-rw-r--r--src/tools/qdoc/qmlmarkupvisitor.cpp14
-rw-r--r--src/tools/qdoc/qmlmarkupvisitor.h186
-rw-r--r--src/tools/qdoc/qmlparser/qqmljs.g42
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsast.cpp14
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsast_p.h566
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsastfwd_p.h14
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsastvisitor.cpp14
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsastvisitor_p.h14
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsengine_p.cpp14
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsengine_p.h14
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsglobal_p.h14
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsgrammar.cpp14
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsgrammar_p.h14
-rw-r--r--src/tools/qdoc/qmlparser/qqmljskeywords_p.h14
-rw-r--r--src/tools/qdoc/qmlparser/qqmljslexer.cpp14
-rw-r--r--src/tools/qdoc/qmlparser/qqmljslexer_p.h14
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsmemorypool_p.h14
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsparser.cpp14
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsparser_p.h14
-rw-r--r--src/tools/qdoc/qmlvisitor.cpp171
-rw-r--r--src/tools/qdoc/qmlvisitor.h48
-rw-r--r--src/tools/qdoc/quoter.cpp14
-rw-r--r--src/tools/qdoc/quoter.h14
-rw-r--r--src/tools/qdoc/separator.cpp14
-rw-r--r--src/tools/qdoc/separator.h14
-rw-r--r--src/tools/qdoc/text.cpp14
-rw-r--r--src/tools/qdoc/text.h14
-rw-r--r--src/tools/qdoc/tokenizer.cpp22
-rw-r--r--src/tools/qdoc/tokenizer.h14
-rw-r--r--src/tools/qdoc/tree.cpp419
-rw-r--r--src/tools/qdoc/tree.h117
-rw-r--r--src/tools/qdoc/yyindent.cpp14
111 files changed, 4253 insertions, 9573 deletions
diff --git a/src/tools/qdoc/atom.cpp b/src/tools/qdoc/atom.cpp
index 1af31afedd..745da21b30 100644
--- a/src/tools/qdoc/atom.cpp
+++ b/src/tools/qdoc/atom.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
@@ -97,6 +97,9 @@ QT_BEGIN_NAMESPACE
\value ImageText
\value ImportantNote
\value InlineImage
+ \value JavaScript
+ \value EndJavaScript
+ \value Keyword
\value LineBreak
\value Link
\value LinkNode
@@ -107,6 +110,8 @@ QT_BEGIN_NAMESPACE
\value ListItemLeft
\value ListItemRight
\value ListRight
+ \value NavAutoLink
+ \value NavLink
\value Nop
\value Note
\value ParaLeft
@@ -181,6 +186,7 @@ static const struct {
{ "InlineImage", Atom::InlineImage },
{ "JavaScript", Atom::JavaScript },
{ "EndJavaScript", Atom::EndJavaScript },
+ { "Keyword", Atom::Keyword },
{ "LegaleseLeft", Atom::LegaleseLeft },
{ "LegaleseRight", Atom::LegaleseRight },
{ "LineBreak", Atom::LineBreak },
@@ -193,6 +199,8 @@ static const struct {
{ "ListItemLeft", Atom::ListItemLeft },
{ "ListItemRight", Atom::ListItemRight },
{ "ListRight", Atom::ListRight },
+ { "NavAutoLink", Atom::NavAutoLink },
+ { "NavLink", Atom::NavLink },
{ "Nop", Atom::Nop },
{ "NoteLeft", Atom::NoteLeft },
{ "NoteRight", Atom::NoteRight },
@@ -371,15 +379,33 @@ void Atom::dump() const
the space character.
*/
LinkAtom::LinkAtom(const QString& p1, const QString& p2)
- : Atom(p1), genus_(Node::DontCare), goal_(Node::NoType), domain_(0)
+ : Atom(p1),
+ resolved_(false),
+ genus_(Node::DontCare),
+ goal_(Node::NoType),
+ domain_(0),
+ squareBracketParams_(p2)
{
- QStringList params = p2.toLower().split(QLatin1Char(' '));
- foreach (const QString& p, params) {
+ // nada.
+}
+
+/*!
+ This function resolves the parameters that were enclosed in
+ square brackets. If the parameters have already been resolved,
+ it does nothing and returns immediately.
+ */
+void LinkAtom::resolveSquareBracketParams()
+{
+ if (resolved_)
+ return;
+ QStringList params = squareBracketParams_.toLower().split(QLatin1Char(' '));
+ foreach (const QString& p, params) {
if (!domain_) {
domain_ = QDocDatabase::qdocDB()->findTree(p);
- if (domain_)
- continue;
- }
+ if (domain_) {
+ continue;
+ }
+ }
if (goal_ == Node::NoType) {
goal_ = Node::goal(p);
if (goal_ != Node::NoType)
@@ -393,9 +419,14 @@ LinkAtom::LinkAtom(const QString& p1, const QString& p2)
genus_ = Node::CPP;
continue;
}
- error_ = p2;
+ if (p == "doc") {
+ genus_ = Node::DOC;
+ continue;
+ }
+ error_ = squareBracketParams_;
break;
}
+ resolved_ = true;
}
/*!
@@ -403,10 +434,12 @@ LinkAtom::LinkAtom(const QString& p1, const QString& p2)
*/
LinkAtom::LinkAtom(const LinkAtom& t)
: Atom(Link, t.string()),
+ resolved_(t.resolved_),
genus_(t.genus_),
goal_(t.goal_),
domain_(t.domain_),
- error_(t.error_)
+ error_(t.error_),
+ squareBracketParams_(t.squareBracketParams_)
{
// nothing
}
@@ -418,10 +451,12 @@ LinkAtom::LinkAtom(const LinkAtom& t)
*/
LinkAtom::LinkAtom(Atom* previous, const LinkAtom& t)
: Atom(previous, Link, t.string()),
+ resolved_(t.resolved_),
genus_(t.genus_),
goal_(t.goal_),
domain_(t.domain_),
- error_(t.error_)
+ error_(t.error_),
+ squareBracketParams_(t.squareBracketParams_)
{
previous->next_ = this;
}
diff --git a/src/tools/qdoc/atom.h b/src/tools/qdoc/atom.h
index 3a7e992f7b..ebbba8917e 100644
--- a/src/tools/qdoc/atom.h
+++ b/src/tools/qdoc/atom.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
@@ -57,7 +57,7 @@ public:
BriefRight,
C,
CaptionLeft,
- CaptionRight, // 10
+ CaptionRight,
Code,
CodeBad,
CodeNew,
@@ -67,7 +67,7 @@ public:
DivLeft,
DivRight,
EndQmlText,
- FootnoteLeft, // 20
+ FootnoteLeft,
FootnoteRight,
FormatElse,
FormatEndif,
@@ -77,17 +77,18 @@ public:
GeneratedList,
GuidLink,
HR,
- Image, // 30
+ Image,
ImageText,
ImportantLeft,
ImportantRight,
InlineImage,
JavaScript,
EndJavaScript,
+ Keyword,
LegaleseLeft,
LegaleseRight,
LineBreak,
- Link, // 40
+ Link,
LinkNode,
ListLeft,
ListItemNumber,
@@ -96,8 +97,10 @@ public:
ListItemLeft,
ListItemRight,
ListRight,
+ NavAutoLink,
+ NavLink,
Nop,
- NoteLeft, // 50
+ NoteLeft,
NoteRight,
ParaLeft,
ParaRight,
@@ -107,7 +110,7 @@ public:
QuotationRight,
RawString,
SectionLeft,
- SectionRight, // 60
+ SectionRight,
SectionHeadingLeft,
SectionHeadingRight,
SidebarLeft,
@@ -117,7 +120,7 @@ public:
SnippetIdentifier,
SnippetLocation,
String,
- TableLeft, // 70
+ TableLeft,
TableRight,
TableHeaderLeft,
TableHeaderRight,
@@ -127,7 +130,7 @@ public:
TableItemRight,
TableOfContents,
Target,
- UnhandledFormat, // 80
+ UnhandledFormat,
UnknownCommand,
Last = UnknownCommand
};
@@ -191,11 +194,12 @@ public:
const QStringList& strings() const { return strs; }
virtual bool isLinkAtom() const { return false; }
- virtual Node::Genus genus() const { return Node::DontCare; }
- virtual bool specifiesDomain() const { return false; }
- virtual Tree* domain() const { return 0; }
- virtual Node::Type goal() const { return Node::NoType; }
+ virtual Node::Genus genus() { return Node::DontCare; }
+ virtual bool specifiesDomain() { return false; }
+ virtual Tree* domain() { return 0; }
+ virtual Node::Type goal() { return Node::NoType; }
virtual const QString& error() { return noError_; }
+ virtual void resolveSquareBracketParams() { }
protected:
static QString noError_;
@@ -212,18 +216,21 @@ class LinkAtom : public Atom
LinkAtom(Atom* previous, const LinkAtom& t);
virtual ~LinkAtom() { }
- virtual bool isLinkAtom() const { return true; }
- virtual Node::Genus genus() const { return genus_; }
- virtual bool specifiesDomain() const { return (domain_ != 0); }
- virtual Tree* domain() const { return domain_; }
- virtual Node::Type goal() const { return goal_; }
- virtual const QString& error() { return error_; }
+ virtual bool isLinkAtom() const Q_DECL_OVERRIDE { return true; }
+ virtual Node::Genus genus() Q_DECL_OVERRIDE { resolveSquareBracketParams(); return genus_; }
+ virtual bool specifiesDomain() Q_DECL_OVERRIDE { resolveSquareBracketParams(); return (domain_ != 0); }
+ virtual Tree* domain() Q_DECL_OVERRIDE { resolveSquareBracketParams(); return domain_; }
+ virtual Node::Type goal() Q_DECL_OVERRIDE { resolveSquareBracketParams(); return goal_; }
+ virtual const QString& error() Q_DECL_OVERRIDE { return error_; }
+ virtual void resolveSquareBracketParams() Q_DECL_OVERRIDE;
protected:
+ bool resolved_;
Node::Genus genus_;
Node::Type goal_;
Tree* domain_;
QString error_;
+ QString squareBracketParams_;
};
#define ATOM_FORMATTING_BOLD "bold"
diff --git a/src/tools/qdoc/codechunk.cpp b/src/tools/qdoc/codechunk.cpp
index 5a22d4ec4a..5799e0bac0 100644
--- a/src/tools/qdoc/codechunk.cpp
+++ b/src/tools/qdoc/codechunk.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
diff --git a/src/tools/qdoc/codechunk.h b/src/tools/qdoc/codechunk.h
index eab55344d2..ed898bcdc7 100644
--- a/src/tools/qdoc/codechunk.h
+++ b/src/tools/qdoc/codechunk.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
diff --git a/src/tools/qdoc/codemarker.cpp b/src/tools/qdoc/codemarker.cpp
index 9a22df4a9f..6a1675aeb5 100644
--- a/src/tools/qdoc/codemarker.cpp
+++ b/src/tools/qdoc/codemarker.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
@@ -394,7 +394,7 @@ void CodeMarker::insert(FastSection &fastSection,
if (p->type() == Node::QmlPropertyGroup)
p = p->parent();
if (p != fastSection.parent_) {
- if (!p->isQmlType() || !p->isAbstract()) {
+ if ((!p->isQmlType() && !p->isJsType()) || !p->isAbstract()) {
inheritedMember = true;
}
}
@@ -641,7 +641,7 @@ QString CodeMarker::macName(const Node *node, const QString &name)
/*!
Returns an empty list of documentation sections.
*/
-QList<Section> CodeMarker::qmlSections(QmlClassNode* , SynopsisStyle , Status )
+QList<Section> CodeMarker::qmlSections(QmlTypeNode* , SynopsisStyle , Status )
{
return QList<Section>();
}
diff --git a/src/tools/qdoc/codemarker.h b/src/tools/qdoc/codemarker.h
index 8f332de01a..7983aa532c 100644
--- a/src/tools/qdoc/codemarker.h
+++ b/src/tools/qdoc/codemarker.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
@@ -48,11 +48,11 @@ QT_BEGIN_NAMESPACE
class Config;
typedef QMultiMap<QString, Node*> MemberMap; // the string is the member signature
-typedef QPair<const QmlClassNode*, MemberMap> ClassMap; // the node is the QML type
+typedef QPair<const QmlTypeNode*, MemberMap> ClassMap; // the node is the QML type
typedef QList<ClassMap*> ClassMapList;
typedef QPair<QStringList, NodeList> KeysAndNodes;
-typedef QPair<const QmlClassNode*, KeysAndNodes> ClassKeysNodes;
+typedef QPair<const QmlTypeNode*, KeysAndNodes> ClassKeysNodes;
typedef QList<ClassKeysNodes*> ClassKeysNodesList;
struct Section
@@ -146,7 +146,7 @@ public:
virtual QList<Section> sections(const InnerNode *inner,
SynopsisStyle style,
Status status) = 0;
- virtual QList<Section> qmlSections(QmlClassNode* qmlClassNode,
+ virtual QList<Section> qmlSections(QmlTypeNode* qmlTypeNode,
SynopsisStyle style,
Status status = Okay);
virtual QStringList macRefsForNode(Node* node);
diff --git a/src/tools/qdoc/codeparser.cpp b/src/tools/qdoc/codeparser.cpp
index 00341940da..4f35672f82 100644
--- a/src/tools/qdoc/codeparser.cpp
+++ b/src/tools/qdoc/codeparser.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
@@ -50,6 +50,7 @@ QT_BEGIN_NAMESPACE
#define COMMAND_INGROUP Doc::alias(QLatin1String("ingroup"))
#define COMMAND_INMODULE Doc::alias(QLatin1String("inmodule")) // ### don't document
#define COMMAND_INQMLMODULE Doc::alias(QLatin1String("inqmlmodule"))
+#define COMMAND_INJSMODULE Doc::alias(QLatin1String("injsmodule"))
#define COMMAND_INTERNAL Doc::alias(QLatin1String("internal"))
#define COMMAND_MAINCLASS Doc::alias(QLatin1String("mainclass"))
#define COMMAND_NONREENTRANT Doc::alias(QLatin1String("nonreentrant"))
@@ -65,9 +66,9 @@ QT_BEGIN_NAMESPACE
#define COMMAND_TITLE Doc::alias(QLatin1String("title"))
#define COMMAND_WRAPPER Doc::alias(QLatin1String("wrapper"))
-QString CodeParser::currentSubDir_;
QList<CodeParser *> CodeParser::parsers;
-bool CodeParser::showInternal = false;
+bool CodeParser::showInternal_ = false;
+bool CodeParser::singleExec_ = false;
/*!
The constructor adds this code parser to the static
@@ -93,7 +94,8 @@ CodeParser::~CodeParser()
*/
void CodeParser::initializeParser(const Config& config)
{
- showInternal = config.getBool(CONFIG_SHOWINTERNAL);
+ showInternal_ = config.getBool(CONFIG_SHOWINTERNAL);
+ singleExec_ = config.getBool(CONFIG_SINGLEEXEC);
}
/*!
@@ -216,7 +218,8 @@ const QSet<QString>& CodeParser::commonMetaCommands()
<< COMMAND_SUBTITLE
<< COMMAND_THREADSAFE
<< COMMAND_TITLE
- << COMMAND_WRAPPER;
+ << COMMAND_WRAPPER
+ << COMMAND_INJSMODULE;
}
return commonMetaCommands_;
}
@@ -249,6 +252,9 @@ void CodeParser::processCommonMetaCommand(const Location& location,
else if (command == COMMAND_INQMLMODULE) {
qdb_->addToQmlModule(arg.first,node);
}
+ else if (command == COMMAND_INJSMODULE) {
+ qdb_->addToJsModule(arg.first, node);
+ }
else if (command == COMMAND_MAINCLASS) {
node->setStatus(Node::Main);
}
@@ -262,7 +268,7 @@ void CodeParser::processCommonMetaCommand(const Location& location,
node->setStatus(Node::Preliminary);
}
else if (command == COMMAND_INTERNAL) {
- if (!showInternal) {
+ if (!showInternal_) {
node->setAccess(Node::Private);
node->setStatus(Node::Internal);
if (node->type() == Node::QmlPropertyGroup) {
@@ -295,14 +301,14 @@ void CodeParser::processCommonMetaCommand(const Location& location,
}
else if (command == COMMAND_TITLE) {
node->setTitle(arg.first);
- if (!node->isDocNode() && !node->isCollectionNode())
+ if (!node->isDocumentNode() && !node->isCollectionNode())
location.warning(tr("Ignored '\\%1'").arg(COMMAND_SUBTITLE));
else if (node->isExample())
qdb_->addExampleNode(static_cast<ExampleNode*>(node));
}
else if (command == COMMAND_SUBTITLE) {
node->setSubTitle(arg.first);
- if (!node->isDocNode() && !node->isCollectionNode())
+ if (!node->isDocumentNode() && !node->isCollectionNode())
location.warning(tr("Ignored '\\%1'").arg(COMMAND_SUBTITLE));
}
else if (command == COMMAND_QTVARIABLE) {
@@ -400,8 +406,8 @@ bool CodeParser::isParsingQdoc() const
*/
void CodeParser::checkModuleInclusion(Node* n)
{
- if (n->moduleName().isEmpty()) {
- n->setModuleName(Generator::defaultModuleName());
+ if (n->physicalModuleName().isEmpty()) {
+ n->setPhysicalModuleName(Generator::defaultModuleName());
switch (n->type()) {
case Node::Class:
if (n->access() != Node::Private && !n->doc().isEmpty()) {
diff --git a/src/tools/qdoc/codeparser.h b/src/tools/qdoc/codeparser.h
index 5b3b1192f3..379deb7e23 100644
--- a/src/tools/qdoc/codeparser.h
+++ b/src/tools/qdoc/codeparser.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
@@ -74,7 +74,6 @@ public:
static CodeParser *parserForHeaderFile(const QString &filePath);
static CodeParser *parserForSourceFile(const QString &filePath);
static void setLink(Node* node, Node::LinkType linkType, const QString& arg);
- static const QString& currentOutputSubdirectory() { return currentSubDir_; }
protected:
const QSet<QString>& commonMetaCommands();
@@ -89,9 +88,9 @@ protected:
QDocDatabase* qdb_;
private:
- static QString currentSubDir_;
static QList<CodeParser *> parsers;
- static bool showInternal;
+ static bool showInternal_;
+ static bool singleExec_;
};
QT_END_NAMESPACE
diff --git a/src/tools/qdoc/config.cpp b/src/tools/qdoc/config.cpp
index 51ab341869..5ab3cb0d7d 100644
--- a/src/tools/qdoc/config.cpp
+++ b/src/tools/qdoc/config.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
@@ -98,6 +98,7 @@ QString ConfigStrings::QUOTINGINFORMATION = QStringLiteral("quotinginformation")
QString ConfigStrings::SCRIPTDIRS = QStringLiteral("scriptdirs");
QString ConfigStrings::SCRIPTS = QStringLiteral("scripts");
QString ConfigStrings::SHOWINTERNAL = QStringLiteral("showinternal");
+QString ConfigStrings::SINGLEEXEC = QStringLiteral("singleexec");
QString ConfigStrings::SOURCEDIRS = QStringLiteral("sourcedirs");
QString ConfigStrings::SOURCEENCODING = QStringLiteral("sourceencoding");
QString ConfigStrings::SOURCES = QStringLiteral("sources");
@@ -118,6 +119,7 @@ QString ConfigStrings::FILEEXTENSIONS = QStringLiteral("fileextensions");
QString ConfigStrings::IMAGEEXTENSIONS = QStringLiteral("imageextensions");
QString ConfigStrings::QMLONLY = QStringLiteral("qmlonly");
QString ConfigStrings::QMLTYPESPAGE = QStringLiteral("qmltypespage");
+QString ConfigStrings::WRITEQAPAGES = QStringLiteral("writeqapages");
/*!
An entry in a stack, where each entry is a list
@@ -350,6 +352,10 @@ QString Config::getOutputDir() const
t = getString(CONFIG_OUTPUTDIR);
else
t = overrideOutputDir;
+ if (Generator::singleExec()) {
+ QString project = getString(CONFIG_PROJECT);
+ t += QLatin1Char('/') + project.toLower();
+ }
if (!Generator::useOutputSubdirs()) {
t = t.left(t.lastIndexOf('/'));
QString singleOutputSubdir = getString("HTML.outputsubdir");
@@ -869,6 +875,36 @@ bool Config::isMetaKeyChar(QChar ch)
}
/*!
+ \a fileName is a master qdocconf file. It contains a list of
+ qdocconf files and nothing else. Read the list and return it.
+ */
+QStringList Config::loadMaster(const QString& fileName)
+{
+ Location location = Location::null;
+ QFile fin(fileName);
+ if (!fin.open(QFile::ReadOnly | QFile::Text)) {
+ if (!Config::installDir.isEmpty()) {
+ int prefix = location.filePath().length() - location.fileName().length();
+ fin.setFileName(Config::installDir + "/" + fileName.right(fileName.length() - prefix));
+ }
+ if (!fin.open(QFile::ReadOnly | QFile::Text))
+ location.fatal(tr("Cannot open master qdocconf file '%1': %2").arg(fileName).arg(fin.errorString()));
+ }
+ QTextStream stream(&fin);
+#ifndef QT_NO_TEXTCODEC
+ stream.setCodec("UTF-8");
+#endif
+ QStringList qdocFiles;
+ QString line = stream.readLine();
+ while (!line.isNull()) {
+ qdocFiles.append(line);
+ line = stream.readLine();
+ }
+ fin.close();
+ return qdocFiles;
+}
+
+/*!
Load, parse, and process a qdoc configuration file. This
function is only called by the other load() function, but
this one is recursive, i.e., it calls itself when it sees
@@ -970,8 +1006,8 @@ void Config::load(Location location, const QString& fileName)
SKIP_CHAR();
}
if (!var.isEmpty()) {
- char *val = getenv(var.toLatin1().data());
- if (val == 0) {
+ const QByteArray val = qgetenv(var.toLatin1().data());
+ if (val.isNull()) {
location.fatal(tr("Environment variable '%1' undefined").arg(var));
}
else {
@@ -1078,8 +1114,8 @@ void Config::load(Location location, const QString& fileName)
SKIP_CHAR();
}
if (!var.isEmpty()) {
- char *val = getenv(var.toLatin1().data());
- if (val == 0) {
+ const QByteArray val = qgetenv(var.toLatin1().constData());
+ if (val.isNull()) {
location.fatal(tr("Environment variable '%1' undefined").arg(var));
}
else {
diff --git a/src/tools/qdoc/config.h b/src/tools/qdoc/config.h
index 70b5adfd68..802bcf929d 100644
--- a/src/tools/qdoc/config.h
+++ b/src/tools/qdoc/config.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
@@ -108,6 +108,7 @@ public:
QStringList getExampleQdocFiles(const QSet<QString> &excludedDirs, const QSet<QString> &excludedFiles);
QStringList getExampleImageFiles(const QSet<QString> &excludedDirs, const QSet<QString> &excludedFiles);
+ static QStringList loadMaster(const QString& fileName);
static QStringList getFilesHere(const QString& dir,
const QString& nameFilter,
const Location &location = Location(),
@@ -209,6 +210,7 @@ struct ConfigStrings
static QString SCRIPTDIRS;
static QString SCRIPTS;
static QString SHOWINTERNAL;
+ static QString SINGLEEXEC;
static QString SOURCEDIRS;
static QString SOURCEENCODING;
static QString SOURCES;
@@ -229,6 +231,7 @@ struct ConfigStrings
static QString IMAGEEXTENSIONS;
static QString QMLONLY;
static QString QMLTYPESPAGE;
+ static QString WRITEQAPAGES;
};
#define CONFIG_ALIAS ConfigStrings::ALIAS
@@ -282,6 +285,7 @@ struct ConfigStrings
#define CONFIG_SCRIPTDIRS ConfigStrings::SCRIPTDIRS
#define CONFIG_SCRIPTS ConfigStrings::SCRIPTS
#define CONFIG_SHOWINTERNAL ConfigStrings::SHOWINTERNAL
+#define CONFIG_SINGLEEXEC ConfigStrings::SINGLEEXEC
#define CONFIG_SOURCEDIRS ConfigStrings::SOURCEDIRS
#define CONFIG_SOURCEENCODING ConfigStrings::SOURCEENCODING
#define CONFIG_SOURCES ConfigStrings::SOURCES
@@ -302,6 +306,7 @@ struct ConfigStrings
#define CONFIG_IMAGEEXTENSIONS ConfigStrings::IMAGEEXTENSIONS
#define CONFIG_QMLONLY ConfigStrings::QMLONLY
#define CONFIG_QMLTYPESPAGE ConfigStrings::QMLTYPESPAGE
+#define CONFIG_WRITEQAPAGES ConfigStrings::WRITEQAPAGES
QT_END_NAMESPACE
diff --git a/src/tools/qdoc/cppcodemarker.cpp b/src/tools/qdoc/cppcodemarker.cpp
index 3851ede16c..400c4808ed 100644
--- a/src/tools/qdoc/cppcodemarker.cpp
+++ b/src/tools/qdoc/cppcodemarker.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
@@ -135,7 +135,7 @@ QString CppCodeMarker::markedUpSynopsis(const Node *node,
name = "<@name>" + name + "</@name>";
if ((style == Detailed) && !node->parent()->name().isEmpty() &&
- (node->type() != Node::Property) && !node->isQmlNode())
+ (node->type() != Node::Property) && !node->isQmlNode() && !node->isJsNode())
name.prepend(taggedNode(node->parent()) + "::");
switch (node->type()) {
@@ -307,14 +307,14 @@ QString CppCodeMarker::markedUpQmlItem(const Node* node, bool summary)
QString name = taggedQmlNode(node);
if (summary)
name = linkTag(node,name);
- else if (node->type() == Node::QmlProperty) {
+ else if (node->isQmlProperty() || node->isJsProperty()) {
const QmlPropertyNode* pn = static_cast<const QmlPropertyNode*>(node);
if (pn->isAttached())
name.prepend(pn->element() + QLatin1Char('.'));
}
name = "<@name>" + name + "</@name>";
QString synopsis;
- if (node->type() == Node::QmlProperty) {
+ if (node->isQmlProperty() || node->isJsProperty()) {
const QmlPropertyNode* pn = static_cast<const QmlPropertyNode*>(node);
synopsis = name + " : " + typified(pn->dataType());
}
@@ -1083,50 +1083,50 @@ QString CppCodeMarker::addMarkUp(const QString &in,
/*!
This function is for documenting QML properties. It returns
the list of documentation sections for the children of the
- \a qmlClassNode.
+ \a qmlTypeNode.
*/
-QList<Section> CppCodeMarker::qmlSections(QmlClassNode* qmlClassNode, SynopsisStyle style, Status status)
+QList<Section> CppCodeMarker::qmlSections(QmlTypeNode* qmlTypeNode, SynopsisStyle style, Status status)
{
QList<Section> sections;
- if (qmlClassNode) {
+ if (qmlTypeNode) {
if (style == Summary) {
- FastSection qmlproperties(qmlClassNode,
+ FastSection qmlproperties(qmlTypeNode,
"Properties",
QString(),
"property",
"properties");
- FastSection qmlattachedproperties(qmlClassNode,
+ FastSection qmlattachedproperties(qmlTypeNode,
"Attached Properties",
QString(),
"property",
"properties");
- FastSection qmlsignals(qmlClassNode,
+ FastSection qmlsignals(qmlTypeNode,
"Signals",
QString(),
"signal",
"signals");
- FastSection qmlsignalhandlers(qmlClassNode,
+ FastSection qmlsignalhandlers(qmlTypeNode,
"Signal Handlers",
QString(),
"signal handler",
"signal handlers");
- FastSection qmlattachedsignals(qmlClassNode,
+ FastSection qmlattachedsignals(qmlTypeNode,
"Attached Signals",
QString(),
"signal",
"signals");
- FastSection qmlmethods(qmlClassNode,
+ FastSection qmlmethods(qmlTypeNode,
"Methods",
QString(),
"method",
"methods");
- FastSection qmlattachedmethods(qmlClassNode,
+ FastSection qmlattachedmethods(qmlTypeNode,
"Attached Methods",
QString(),
"method",
"methods");
- QmlClassNode* qcn = qmlClassNode;
+ QmlTypeNode* qcn = qmlTypeNode;
while (qcn != 0) {
NodeList::ConstIterator c = qcn->childNodes().constBegin();
while (c != qcn->childNodes().constEnd()) {
@@ -1134,10 +1134,10 @@ QList<Section> CppCodeMarker::qmlSections(QmlClassNode* qmlClassNode, SynopsisSt
++c;
continue;
}
- if ((*c)->type() == Node::QmlPropertyGroup) {
+ if ((*c)->isQmlPropertyGroup() || (*c)->isJsPropertyGroup()) {
insert(qmlproperties, *c, style, status);
}
- else if ((*c)->type() == Node::QmlProperty) {
+ else if ((*c)->isQmlProperty() || (*c)->isJsProperty()) {
const QmlPropertyNode* pn = static_cast<const QmlPropertyNode*>(*c);
if (pn->isAttached())
insert(qmlattachedproperties,*c,style, status);
@@ -1145,17 +1145,17 @@ QList<Section> CppCodeMarker::qmlSections(QmlClassNode* qmlClassNode, SynopsisSt
insert(qmlproperties,*c,style, status);
}
}
- else if ((*c)->type() == Node::QmlSignal) {
+ else if ((*c)->isQmlSignal() || (*c)->isJsSignal()) {
const FunctionNode* sn = static_cast<const FunctionNode*>(*c);
if (sn->isAttached())
insert(qmlattachedsignals,*c,style, status);
else
insert(qmlsignals,*c,style, status);
}
- else if ((*c)->type() == Node::QmlSignalHandler) {
+ else if ((*c)->isQmlSignalHandler() || (*c)->isJsSignalHandler()) {
insert(qmlsignalhandlers,*c,style, status);
}
- else if ((*c)->type() == Node::QmlMethod) {
+ else if ((*c)->isQmlMethod() || (*c)->isJsMethod()) {
const FunctionNode* mn = static_cast<const FunctionNode*>(*c);
if (mn->isAttached())
insert(qmlattachedmethods,*c,style, status);
@@ -1165,7 +1165,7 @@ QList<Section> CppCodeMarker::qmlSections(QmlClassNode* qmlClassNode, SynopsisSt
++c;
}
if (qcn->qmlBaseNode() != 0) {
- qcn = static_cast<QmlClassNode*>(qcn->qmlBaseNode());
+ qcn = static_cast<QmlTypeNode*>(qcn->qmlBaseNode());
if (!qcn->isAbstract())
qcn = 0;
}
@@ -1181,17 +1181,17 @@ QList<Section> CppCodeMarker::qmlSections(QmlClassNode* qmlClassNode, SynopsisSt
append(sections,qmlattachedmethods);
}
else if (style == Detailed) {
- FastSection qmlproperties(qmlClassNode, "Property Documentation","qmlprop","member","members");
- FastSection qmlattachedproperties(qmlClassNode,"Attached Property Documentation","qmlattprop",
+ FastSection qmlproperties(qmlTypeNode, "Property Documentation","qmlprop","member","members");
+ FastSection qmlattachedproperties(qmlTypeNode,"Attached Property Documentation","qmlattprop",
"member","members");
- FastSection qmlsignals(qmlClassNode,"Signal Documentation","qmlsig","signal","signals");
- FastSection qmlsignalhandlers(qmlClassNode,"Signal Handler Documentation","qmlsighan","signal handler","signal handlers");
- FastSection qmlattachedsignals(qmlClassNode,"Attached Signal Documentation","qmlattsig",
+ FastSection qmlsignals(qmlTypeNode,"Signal Documentation","qmlsig","signal","signals");
+ FastSection qmlsignalhandlers(qmlTypeNode,"Signal Handler Documentation","qmlsighan","signal handler","signal handlers");
+ FastSection qmlattachedsignals(qmlTypeNode,"Attached Signal Documentation","qmlattsig",
"signal","signals");
- FastSection qmlmethods(qmlClassNode,"Method Documentation","qmlmeth","member","members");
- FastSection qmlattachedmethods(qmlClassNode,"Attached Method Documentation","qmlattmeth",
+ FastSection qmlmethods(qmlTypeNode,"Method Documentation","qmlmeth","member","members");
+ FastSection qmlattachedmethods(qmlTypeNode,"Attached Method Documentation","qmlattmeth",
"member","members");
- QmlClassNode* qcn = qmlClassNode;
+ QmlTypeNode* qcn = qmlTypeNode;
while (qcn != 0) {
NodeList::ConstIterator c = qcn->childNodes().constBegin();
while (c != qcn->childNodes().constEnd()) {
@@ -1199,27 +1199,27 @@ QList<Section> CppCodeMarker::qmlSections(QmlClassNode* qmlClassNode, SynopsisSt
++c;
continue;
}
- if ((*c)->type() == Node::QmlPropertyGroup) {
+ if ((*c)->isQmlPropertyGroup() || (*c)->isJsPropertyGroup()) {
insert(qmlproperties,*c,style, status);
}
- else if ((*c)->type() == Node::QmlProperty) {
+ else if ((*c)->isQmlProperty() || (*c)->isJsProperty()) {
const QmlPropertyNode* pn = static_cast<const QmlPropertyNode*>(*c);
if (pn->isAttached())
insert(qmlattachedproperties,*c,style, status);
else
insert(qmlproperties,*c,style, status);
}
- else if ((*c)->type() == Node::QmlSignal) {
+ else if ((*c)->isQmlSignal() || (*c)->isJsSignal()) {
const FunctionNode* sn = static_cast<const FunctionNode*>(*c);
if (sn->isAttached())
insert(qmlattachedsignals,*c,style, status);
else
insert(qmlsignals,*c,style, status);
}
- else if ((*c)->type() == Node::QmlSignalHandler) {
+ else if ((*c)->isQmlSignalHandler() || (*c)->isJsSignalHandler()) {
insert(qmlsignalhandlers,*c,style, status);
}
- else if ((*c)->type() == Node::QmlMethod) {
+ else if ((*c)->isQmlMethod() || (*c)->isJsMethod()) {
const FunctionNode* mn = static_cast<const FunctionNode*>(*c);
if (mn->isAttached())
insert(qmlattachedmethods,*c,style, status);
@@ -1229,7 +1229,7 @@ QList<Section> CppCodeMarker::qmlSections(QmlClassNode* qmlClassNode, SynopsisSt
++c;
}
if (qcn->qmlBaseNode() != 0) {
- qcn = static_cast<QmlClassNode*>(qcn->qmlBaseNode());
+ qcn = static_cast<QmlTypeNode*>(qcn->qmlBaseNode());
if (!qcn->isAbstract())
qcn = 0;
}
@@ -1250,8 +1250,8 @@ QList<Section> CppCodeMarker::qmlSections(QmlClassNode* qmlClassNode, SynopsisSt
members is prepared.
*/
ClassMap* classMap = 0;
- FastSection all(qmlClassNode,QString(),QString(),"member","members");
- QmlClassNode* current = qmlClassNode;
+ FastSection all(qmlTypeNode,QString(),QString(),"member","members");
+ QmlTypeNode* current = qmlTypeNode;
while (current != 0) {
/*
If the QML type is abstract, do not create
@@ -1271,11 +1271,11 @@ QList<Section> CppCodeMarker::qmlSections(QmlClassNode* qmlClassNode, SynopsisSt
}
NodeList::ConstIterator c = current->childNodes().constBegin();
while (c != current->childNodes().constEnd()) {
- if ((*c)->type() == Node::QmlPropertyGroup) {
+ if ((*c)->isQmlPropertyGroup() || (*c)->isJsPropertyGroup()) {
const QmlPropertyGroupNode* qpgn = static_cast<const QmlPropertyGroupNode*>(*c);
NodeList::ConstIterator p = qpgn->childNodes().constBegin();
while (p != qpgn->childNodes().constEnd()) {
- if ((*p)->type() == Node::QmlProperty) {
+ if ((*p)->isQmlProperty() || (*c)->isJsProperty()) {
QString key = (*p)->name();
key = sortName(*p, &key);
all.memberMap.insert(key,*p);
diff --git a/src/tools/qdoc/cppcodemarker.h b/src/tools/qdoc/cppcodemarker.h
index ec2ee124d4..509d130a27 100644
--- a/src/tools/qdoc/cppcodemarker.h
+++ b/src/tools/qdoc/cppcodemarker.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
@@ -50,29 +50,29 @@ public:
CppCodeMarker();
~CppCodeMarker();
- virtual bool recognizeCode(const QString& code);
- virtual bool recognizeExtension(const QString& ext);
- virtual bool recognizeLanguage(const QString& lang);
- virtual Atom::Type atomType() const;
+ virtual bool recognizeCode(const QString& code) Q_DECL_OVERRIDE;
+ virtual bool recognizeExtension(const QString& ext) Q_DECL_OVERRIDE;
+ virtual bool recognizeLanguage(const QString& lang) Q_DECL_OVERRIDE;
+ virtual Atom::Type atomType() const Q_DECL_OVERRIDE;
virtual QString markedUpCode(const QString& code,
const Node *relative,
- const Location &location);
+ const Location &location) Q_DECL_OVERRIDE;
virtual QString markedUpSynopsis(const Node *node,
const Node *relative,
- SynopsisStyle style);
- virtual QString markedUpQmlItem(const Node *node, bool summary);
- virtual QString markedUpName(const Node *node);
- virtual QString markedUpFullName(const Node *node, const Node *relative);
- virtual QString markedUpEnumValue(const QString &enumValue, const Node *relative);
- virtual QString markedUpIncludes(const QStringList& includes);
- virtual QString functionBeginRegExp(const QString& funcName);
- virtual QString functionEndRegExp(const QString& funcName);
+ SynopsisStyle style) Q_DECL_OVERRIDE;
+ virtual QString markedUpQmlItem(const Node *node, bool summary) Q_DECL_OVERRIDE;
+ virtual QString markedUpName(const Node *node) Q_DECL_OVERRIDE;
+ virtual QString markedUpFullName(const Node *node, const Node *relative) Q_DECL_OVERRIDE;
+ virtual QString markedUpEnumValue(const QString &enumValue, const Node *relative) Q_DECL_OVERRIDE;
+ virtual QString markedUpIncludes(const QStringList& includes) Q_DECL_OVERRIDE;
+ virtual QString functionBeginRegExp(const QString& funcName) Q_DECL_OVERRIDE;
+ virtual QString functionEndRegExp(const QString& funcName) Q_DECL_OVERRIDE;
virtual QList<Section> sections(const InnerNode *innerNode,
SynopsisStyle style,
- Status status);
- virtual QList<Section> qmlSections(QmlClassNode* qmlClassNode,
+ Status status) Q_DECL_OVERRIDE;
+ virtual QList<Section> qmlSections(QmlTypeNode* qmlTypeNode,
SynopsisStyle style,
- Status status = Okay);
+ Status status = Okay) Q_DECL_OVERRIDE;
private:
QString addMarkUp(const QString& protectedCode,
diff --git a/src/tools/qdoc/cppcodeparser.cpp b/src/tools/qdoc/cppcodeparser.cpp
index 22aae609ae..6cb86a7515 100644
--- a/src/tools/qdoc/cppcodeparser.cpp
+++ b/src/tools/qdoc/cppcodeparser.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
@@ -285,7 +285,6 @@ const QSet<QString>& CppCodeParser::topicCommands()
<< COMMAND_PROPERTY
<< COMMAND_TYPEDEF
<< COMMAND_VARIABLE
- << COMMAND_QMLCLASS
<< COMMAND_QMLTYPE
<< COMMAND_QMLPROPERTY
<< COMMAND_QMLPROPERTYGROUP
@@ -295,7 +294,17 @@ const QSet<QString>& CppCodeParser::topicCommands()
<< COMMAND_QMLMETHOD
<< COMMAND_QMLATTACHEDMETHOD
<< COMMAND_QMLBASICTYPE
- << COMMAND_QMLMODULE;
+ << COMMAND_QMLMODULE
+ << COMMAND_JSTYPE
+ << COMMAND_JSPROPERTY
+ << COMMAND_JSPROPERTYGROUP
+ << COMMAND_JSATTACHEDPROPERTY
+ << COMMAND_JSSIGNAL
+ << COMMAND_JSATTACHEDSIGNAL
+ << COMMAND_JSMETHOD
+ << COMMAND_JSATTACHEDMETHOD
+ << COMMAND_JSBASICTYPE
+ << COMMAND_JSMODULE;
}
return topicCommands_;
}
@@ -436,37 +445,56 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc,
}
}
else if (command == COMMAND_EXTERNALPAGE) {
- DocNode* dn = new DocNode(qdb_->primaryTreeRoot(), arg.first, Node::ExternalPage, Node::ArticlePage);
+ DocumentNode* dn = new DocumentNode(qdb_->primaryTreeRoot(),
+ arg.first,
+ Node::ExternalPage,
+ Node::ArticlePage);
dn->setLocation(doc.startLocation());
return dn;
}
else if (command == COMMAND_FILE) {
- DocNode* dn = new DocNode(qdb_->primaryTreeRoot(), arg.first, Node::File, Node::NoPageType);
+ DocumentNode* dn = new DocumentNode(qdb_->primaryTreeRoot(),
+ arg.first,
+ Node::File,
+ Node::NoPageType);
dn->setLocation(doc.startLocation());
return dn;
}
else if (command == COMMAND_HEADERFILE) {
- DocNode* dn = new DocNode(qdb_->primaryTreeRoot(), arg.first, Node::HeaderFile, Node::ApiPage);
+ DocumentNode* dn = new DocumentNode(qdb_->primaryTreeRoot(),
+ arg.first,
+ Node::HeaderFile,
+ Node::ApiPage);
dn->setLocation(doc.startLocation());
return dn;
}
else if (command == COMMAND_GROUP) {
- GroupNode* gn = qdb_->addGroup(arg.first);
- gn->setLocation(doc.startLocation());
- gn->markSeen();
- return gn;
+ CollectionNode* cn = qdb_->addGroup(arg.first);
+ cn->setLocation(doc.startLocation());
+ cn->markSeen();
+ return cn;
}
else if (command == COMMAND_MODULE) {
- ModuleNode* mn = qdb_->addModule(arg.first);
- mn->setLocation(doc.startLocation());
- mn->markSeen();
- return mn;
+ CollectionNode* cn = qdb_->addModule(arg.first);
+ cn->setLocation(doc.startLocation());
+ cn->markSeen();
+ return cn;
}
else if (command == COMMAND_QMLMODULE) {
- QmlModuleNode* qmn = qdb_->addQmlModule(arg.first);
- qmn->setLocation(doc.startLocation());
- qmn->markSeen();
- return qmn;
+ QStringList blankSplit = arg.first.split(QLatin1Char(' '));
+ CollectionNode* cn = qdb_->addQmlModule(blankSplit[0]);
+ cn->setLogicalModuleInfo(blankSplit);
+ cn->setLocation(doc.startLocation());
+ cn->markSeen();
+ return cn;
+ }
+ else if (command == COMMAND_JSMODULE) {
+ QStringList blankSplit = arg.first.split(QLatin1Char(' '));
+ CollectionNode* cn = qdb_->addJsModule(blankSplit[0]);
+ cn->setLogicalModuleInfo(blankSplit);
+ cn->setLocation(doc.startLocation());
+ cn->markSeen();
+ return cn;
}
else if (command == COMMAND_PAGE) {
Node::PageType ptype = Node::ArticlePage;
@@ -498,95 +526,80 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc,
tr("Also used here: %1").arg(other));
}
#endif
- DocNode* dn = 0;
+ DocumentNode* dn = 0;
if (ptype == Node::DitaMapPage)
dn = new DitaMapNode(qdb_->primaryTreeRoot(), args[0]);
else
- dn = new DocNode(qdb_->primaryTreeRoot(), args[0], Node::Page, ptype);
+ dn = new DocumentNode(qdb_->primaryTreeRoot(), args[0], Node::Page, ptype);
dn->setLocation(doc.startLocation());
return dn;
}
else if (command == COMMAND_DITAMAP) {
- DocNode* dn = new DitaMapNode(qdb_->primaryTreeRoot(), arg.first);
+ DocumentNode* dn = new DitaMapNode(qdb_->primaryTreeRoot(), arg.first);
dn->setLocation(doc.startLocation());
return dn;
}
- else if ((command == COMMAND_QMLCLASS) || (command == COMMAND_QMLTYPE)) {
- if (command == COMMAND_QMLCLASS)
- doc.startLocation().warning(tr("\\qmlclass is deprecated; use \\qmltype instead"));
- ClassNode* classNode = 0;
- QStringList names = arg.first.split(QLatin1Char(' '));
- if (names.size() > 1) {
- if (names[1] != "0")
- doc.startLocation().warning(tr("\\qmltype no longer has a 2nd argument; "
- "use '\\instantiates <class>' in \\qmltype "
- "comments instead"));
- else
- doc.startLocation().warning(tr("The 0 arg is no longer used for indicating "
- "that the QML type does not instantiate a "
- "C++ class"));
- /*
- If the second argument of the \\qmlclass command
- is 0 we should ignore the C++ class. The second
- argument should only be 0 when you are documenting
- QML in a .qdoc file.
- */
- if (names[1] != "0")
- classNode = qdb_->findClassNode(names[1].split("::"));
- }
-
-#if 0
- const Node* n = qdb_->checkForCollision(names[0]);
- if (n) {
- QString other = n->doc().location().fileName();
- doc.location().warning(tr("Name/title collision detected: '%1' in '\\%2'")
- .arg(names[0]).arg(command),
- tr("Also used here: %1").arg(other));
- }
-#endif
- QmlClassNode* qcn = new QmlClassNode(qdb_->primaryTreeRoot(), names[0]);
- qcn->setClassNode(classNode);
+ else if ((command == COMMAND_QMLTYPE) || (command == COMMAND_JSTYPE)) {
+ QmlTypeNode* qcn = new QmlTypeNode(qdb_->primaryTreeRoot(), arg.first);
+ if (command == COMMAND_JSTYPE)
+ qcn->setGenus(Node::JS);
qcn->setLocation(doc.startLocation());
return qcn;
}
- else if (command == COMMAND_QMLBASICTYPE) {
+ else if ((command == COMMAND_QMLBASICTYPE) || (command == COMMAND_JSBASICTYPE)) {
QmlBasicTypeNode* n = new QmlBasicTypeNode(qdb_->primaryTreeRoot(), arg.first);
+ if (command == COMMAND_JSBASICTYPE)
+ n->setGenus(Node::JS);
n->setLocation(doc.startLocation());
return n;
}
else if ((command == COMMAND_QMLSIGNAL) ||
(command == COMMAND_QMLMETHOD) ||
(command == COMMAND_QMLATTACHEDSIGNAL) ||
- (command == COMMAND_QMLATTACHEDMETHOD)) {
+ (command == COMMAND_QMLATTACHEDMETHOD) ||
+ (command == COMMAND_JSSIGNAL) ||
+ (command == COMMAND_JSMETHOD) ||
+ (command == COMMAND_JSATTACHEDSIGNAL) ||
+ (command == COMMAND_JSATTACHEDMETHOD)) {
QString module;
- QString qmlType;
+ QString qmlTypeName;
QString type;
- if (splitQmlMethodArg(arg.first,type,module,qmlType)) {
- QmlClassNode* qmlClass = qdb_->findQmlType(module,qmlType);
- if (qmlClass) {
+ if (splitQmlMethodArg(arg.first, type, module, qmlTypeName)) {
+ QmlTypeNode* qmlType = qdb_->findQmlType(module, qmlTypeName);
+ if (qmlType) {
bool attached = false;
Node::Type nodeType = Node::QmlMethod;
- if (command == COMMAND_QMLSIGNAL)
+ if ((command == COMMAND_QMLSIGNAL) ||
+ (command == COMMAND_JSSIGNAL))
nodeType = Node::QmlSignal;
- else if (command == COMMAND_QMLATTACHEDSIGNAL) {
+ else if ((command == COMMAND_QMLATTACHEDSIGNAL) ||
+ (command == COMMAND_JSATTACHEDSIGNAL)) {
nodeType = Node::QmlSignal;
attached = true;
}
- else if (command == COMMAND_QMLMETHOD) {
+ else if ((command == COMMAND_QMLMETHOD) ||
+ (command == COMMAND_JSMETHOD)) {
// do nothing
}
- else if (command == COMMAND_QMLATTACHEDMETHOD)
+ else if ((command == COMMAND_QMLATTACHEDMETHOD) ||
+ (command == COMMAND_JSATTACHEDMETHOD))
attached = true;
else
return 0; // never get here.
FunctionNode* fn = makeFunctionNode(doc,
arg.first,
- qmlClass,
+ qmlType,
nodeType,
attached,
command);
- if (fn)
+ if (fn) {
fn->setLocation(doc.startLocation());
+ if ((command == COMMAND_JSSIGNAL) ||
+ (command == COMMAND_JSMETHOD) ||
+ (command == COMMAND_JSATTACHEDSIGNAL) ||
+ (command == COMMAND_JSATTACHEDMETHOD))
+ fn->setGenus(Node::JS);
+ }
return fn;
}
}
@@ -602,19 +615,19 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc,
This function splits the argument into those parts.
A <QML-module> is the QML equivalent of a C++ namespace.
So this function splits \a arg on "::" and stores the
- parts in \a module, \a qmlType, and \a name, and returns
+ parts in \a module, \a qmlTypeName, and \a name, and returns
true. If any part is not found, a qdoc warning is emitted
and false is returned.
*/
bool CppCodeParser::splitQmlPropertyGroupArg(const QString& arg,
QString& module,
- QString& qmlType,
+ QString& qmlTypeName,
QString& name)
{
QStringList colonSplit = arg.split("::");
if (colonSplit.size() == 3) {
module = colonSplit[0];
- qmlType = colonSplit[1];
+ qmlTypeName = colonSplit[1];
name = colonSplit[2];
return true;
}
@@ -634,7 +647,7 @@ bool CppCodeParser::splitQmlPropertyGroupArg(const QString& arg,
was used before the creation of Qt Quick 2 and Qt
Components. A <QML-module> is the QML equivalent of a
C++ namespace. So this function splits \a arg on "::"
- and stores the parts in \a type, \a module, \a qmlType,
+ and stores the parts in \a type, \a module, \a qmlTypeName,
and \a name, and returns \c true. If any part other than
\a module is not found, a qdoc warning is emitted and
false is returned.
@@ -645,7 +658,7 @@ bool CppCodeParser::splitQmlPropertyGroupArg(const QString& arg,
bool CppCodeParser::splitQmlPropertyArg(const QString& arg,
QString& type,
QString& module,
- QString& qmlType,
+ QString& qmlTypeName,
QString& name)
{
QStringList blankSplit = arg.split(QLatin1Char(' '));
@@ -654,13 +667,13 @@ bool CppCodeParser::splitQmlPropertyArg(const QString& arg,
QStringList colonSplit(blankSplit[1].split("::"));
if (colonSplit.size() == 3) {
module = colonSplit[0];
- qmlType = colonSplit[1];
+ qmlTypeName = colonSplit[1];
name = colonSplit[2];
return true;
}
if (colonSplit.size() == 2) {
module.clear();
- qmlType = colonSplit[0];
+ qmlTypeName = colonSplit[0];
name = colonSplit[1];
return true;
}
@@ -681,7 +694,7 @@ bool CppCodeParser::splitQmlPropertyArg(const QString& arg,
<type> <QML-module>::<QML-type>::<name>(<param>, <param>, ...)
This function splits the argument into one of those two
- forms, sets \a module, \a qmlType, and \a name, and returns
+ forms, sets \a module, \a qmlTypeName, and \a name, and returns
true. If the argument doesn't match either form, an error
message is emitted and false is returned.
@@ -691,7 +704,7 @@ bool CppCodeParser::splitQmlPropertyArg(const QString& arg,
bool CppCodeParser::splitQmlMethodArg(const QString& arg,
QString& type,
QString& module,
- QString& qmlType)
+ QString& qmlTypeName)
{
QStringList colonSplit(arg.split("::"));
if (colonSplit.size() > 1) {
@@ -700,22 +713,22 @@ bool CppCodeParser::splitQmlMethodArg(const QString& arg,
type = blankSplit[0];
if (colonSplit.size() > 2) {
module = blankSplit[1];
- qmlType = colonSplit[1];
+ qmlTypeName = colonSplit[1];
}
else {
module.clear();
- qmlType = blankSplit[1];
+ qmlTypeName = blankSplit[1];
}
}
else {
type.clear();
if (colonSplit.size() > 2) {
module = colonSplit[0];
- qmlType = colonSplit[1];
+ qmlTypeName = colonSplit[1];
}
else {
module.clear();
- qmlType = colonSplit[0];
+ qmlTypeName = colonSplit[0];
}
}
return true;
@@ -731,35 +744,42 @@ bool CppCodeParser::splitQmlMethodArg(const QString& arg,
Currently, this function is called only for \e{qmlproperty}
and \e{qmlattachedproperty}.
*/
-void CppCodeParser::processQmlProperties(const Doc& doc, NodeList& nodes, DocList& docs)
+void CppCodeParser::processQmlProperties(const Doc& doc,
+ NodeList& nodes,
+ DocList& docs,
+ bool jsProps)
{
QString arg;
QString type;
QString topic;
QString module;
- QString qmlType;
+ QString qmlTypeName;
QString property;
QmlPropertyNode* qpn = 0;
- QmlClassNode* qmlClass = 0;
+ QmlTypeNode* qmlType = 0;
QmlPropertyGroupNode* qpgn = 0;
Topic qmlPropertyGroupTopic;
const TopicList& topics = doc.topicsUsed();
for (int i=0; i<topics.size(); ++i) {
- if (topics.at(i).topic == COMMAND_QMLPROPERTYGROUP) {
+ if ((topics.at(i).topic == COMMAND_QMLPROPERTYGROUP) ||
+ (topics.at(i).topic == COMMAND_JSPROPERTYGROUP)) {
qmlPropertyGroupTopic = topics.at(i);
break;
}
}
if (qmlPropertyGroupTopic.isEmpty() && topics.size() > 1) {
qmlPropertyGroupTopic = topics.at(0);
- qmlPropertyGroupTopic.topic = COMMAND_QMLPROPERTYGROUP;
+ if (jsProps)
+ qmlPropertyGroupTopic.topic = COMMAND_JSPROPERTYGROUP;
+ else
+ qmlPropertyGroupTopic.topic = COMMAND_QMLPROPERTYGROUP;
arg = qmlPropertyGroupTopic.args;
- if (splitQmlPropertyArg(arg, type, module, qmlType, property)) {
+ if (splitQmlPropertyArg(arg, type, module, qmlTypeName, property)) {
int i = property.indexOf('.');
if (i != -1) {
property = property.left(i);
- qmlPropertyGroupTopic.args = module + "::" + qmlType + "::" + property;
+ qmlPropertyGroupTopic.args = module + "::" + qmlTypeName + "::" + property;
doc.location().warning(tr("No QML property group command found; using \\%1 %2")
.arg(COMMAND_QMLPROPERTYGROUP).arg(qmlPropertyGroupTopic.args));
}
@@ -775,11 +795,13 @@ void CppCodeParser::processQmlProperties(const Doc& doc, NodeList& nodes, DocLis
if (!qmlPropertyGroupTopic.isEmpty()) {
arg = qmlPropertyGroupTopic.args;
- if (splitQmlPropertyGroupArg(arg, module, qmlType, property)) {
- qmlClass = qdb_->findQmlType(module, qmlType);
- if (qmlClass) {
- qpgn = new QmlPropertyGroupNode(qmlClass, property);
+ if (splitQmlPropertyGroupArg(arg, module, qmlTypeName, property)) {
+ qmlType = qdb_->findQmlType(module, qmlTypeName);
+ if (qmlType) {
+ qpgn = new QmlPropertyGroupNode(qmlType, property);
qpgn->setLocation(doc.startLocation());
+ if (jsProps)
+ qpgn->setGenus(Node::JS);
nodes.append(qpgn);
docs.append(doc);
}
@@ -791,22 +813,28 @@ void CppCodeParser::processQmlProperties(const Doc& doc, NodeList& nodes, DocLis
}
topic = topics.at(i).topic;
arg = topics.at(i).args;
- if ((topic == COMMAND_QMLPROPERTY) || (topic == COMMAND_QMLATTACHEDPROPERTY)) {
- bool attached = (topic == COMMAND_QMLATTACHEDPROPERTY);
- if (splitQmlPropertyArg(arg, type, module, qmlType, property)) {
- qmlClass = qdb_->findQmlType(module, qmlType);
- if (qmlClass) {
- if (qmlClass->hasQmlProperty(property, attached) != 0) {
+ if ((topic == COMMAND_QMLPROPERTY) || (topic == COMMAND_QMLATTACHEDPROPERTY) ||
+ (topic == COMMAND_JSPROPERTY) || (topic == COMMAND_JSATTACHEDPROPERTY)) {
+ bool attached = ((topic == COMMAND_QMLATTACHEDPROPERTY) ||
+ (topic == COMMAND_JSATTACHEDPROPERTY));
+ if (splitQmlPropertyArg(arg, type, module, qmlTypeName, property)) {
+ qmlType = qdb_->findQmlType(module, qmlTypeName);
+ if (qmlType) {
+ if (qmlType->hasQmlProperty(property, attached) != 0) {
QString msg = tr("QML property documented multiple times: '%1'").arg(arg);
doc.startLocation().warning(msg);
}
else if (qpgn) {
qpn = new QmlPropertyNode(qpgn, property, type, attached);
qpn->setLocation(doc.startLocation());
+ if (jsProps)
+ qpn->setGenus(Node::JS);
}
else {
- qpn = new QmlPropertyNode(qmlClass, property, type, attached);
+ qpn = new QmlPropertyNode(qmlType, property, type, attached);
qpn->setLocation(doc.startLocation());
+ if (jsProps)
+ qpn->setGenus(Node::JS);
nodes.append(qpn);
docs.append(doc);
}
@@ -931,14 +959,14 @@ void CppCodeParser::processOtherMetaCommand(const Doc& doc,
else if (command == COMMAND_QMLINHERITS) {
if (node->name() == arg)
doc.location().warning(tr("%1 tries to inherit itself").arg(arg));
- else if (node->isQmlType()) {
- QmlClassNode *qmlClass = static_cast<QmlClassNode*>(node);
- qmlClass->setQmlBaseName(arg);
- QmlClassNode::addInheritedBy(arg,node);
+ else if (node->isQmlType() || node->isJsType()) {
+ QmlTypeNode* qmlType = static_cast<QmlTypeNode*>(node);
+ qmlType->setQmlBaseName(arg);
+ QmlTypeNode::addInheritedBy(arg,node);
}
}
else if (command == COMMAND_QMLINSTANTIATES) {
- if (node->isQmlType()) {
+ if (node->isQmlType() || node->isJsType()) {
ClassNode* classNode = qdb_->findClassNode(arg.split("::"));
if (classNode)
node->setClassNode(classNode);
@@ -983,7 +1011,7 @@ void CppCodeParser::processOtherMetaCommand(const Doc& doc,
}
}
else if (command == COMMAND_QMLABSTRACT) {
- if (node->isQmlType())
+ if (node->isQmlType() || node->isJsType())
node->setAbstract(true);
}
else {
@@ -1021,7 +1049,7 @@ void CppCodeParser::reset()
access = Node::Public;
metaness = FunctionNode::Plain;
lastPath_.clear();
- moduleName.clear();
+ physicalModuleName.clear();
}
/*!
@@ -1615,8 +1643,8 @@ bool CppCodeParser::matchClassDecl(InnerNode *parent,
classe->setLocation(location());
if (compat)
classe->setStatus(Node::Compat);
- if (!moduleName.isEmpty())
- classe->setModuleName(moduleName);
+ if (!physicalModuleName.isEmpty())
+ classe->setPhysicalModuleName(physicalModuleName);
classe->setTemplateStuff(templateStuff);
if (match(Tok_Colon) && !matchBaseList(classe, isClass))
@@ -1664,35 +1692,76 @@ bool CppCodeParser::matchNamespaceDecl(InnerNode *parent)
return matched && match(Tok_RightBrace);
}
-bool CppCodeParser::matchUsingDecl()
+/*!
+ Match a C++ \c using clause. Return \c true if the match
+ is successful. Otherwise false.
+
+ If the \c using clause is for a namespace, an open namespace
+ <is inserted for qdoc to look in to find things.
+
+ If the \c using clause is a base class member function, the
+ member function is added to \a parent as an unresolved
+ \c using clause.
+ */
+bool CppCodeParser::matchUsingDecl(InnerNode* parent)
{
+ bool usingNamespace = false;
readToken(); // skip 'using'
- // 'namespace'
- if (tok != Tok_namespace)
- return false;
-
- readToken();
- // identifier
- if (tok != Tok_Ident)
- return false;
+ if (tok == Tok_namespace) {
+ usingNamespace = true;
+ readToken();
+ }
+ int openLeftAngles = 0;
+ int openLeftParens = 0;
+ bool usingOperator = false;
QString name;
- while (tok == Tok_Ident) {
+ while (tok != Tok_Semicolon) {
+ if ((tok != Tok_Ident) && (tok != Tok_Gulbrandsen)) {
+ if (tok == Tok_LeftAngle) {
+ ++openLeftAngles;
+ }
+ else if (tok == Tok_RightAngle) {
+ if (openLeftAngles <= 0)
+ return false;
+ --openLeftAngles;
+ }
+ else if (tok == Tok_Comma) {
+ if (openLeftAngles <= 0)
+ return false;
+ }
+ else if (tok == Tok_operator) {
+ usingOperator = true;
+ }
+ else if (tok == Tok_SomeOperator) {
+ if (!usingOperator)
+ return false;
+ }
+ else if (tok == Tok_LeftParen) {
+ ++openLeftParens;
+ }
+ else if (tok == Tok_RightParen) {
+ if (openLeftParens <= 0)
+ return false;
+ --openLeftParens;
+ }
+ else {
+ return false;
+ }
+ }
name += lexeme();
readToken();
- if (tok == Tok_Semicolon)
- break;
- else if (tok != Tok_Gulbrandsen)
- return false;
- name += "::";
- readToken();
}
- /*
- So far, so good. We have 'using namespace Foo;'.
- */
- qdb_->insertOpenNamespace(name);
+ if (usingNamespace) {
+ // 'using namespace Foo;'.
+ qdb_->insertOpenNamespace(name);
+ }
+ else if (parent && parent->isClass()) {
+ ClassNode* cn = static_cast<ClassNode*>(parent);
+ cn->addUnresolvedUsingClause(name);
+ }
return true;
}
@@ -1933,7 +2002,7 @@ bool CppCodeParser::matchDeclList(InnerNode *parent)
matchNamespaceDecl(parent);
break;
case Tok_using:
- matchUsingDecl();
+ matchUsingDecl(parent);
break;
case Tok_template:
{
@@ -2035,9 +2104,9 @@ bool CppCodeParser::matchDeclList(InnerNode *parent)
case Tok_QT_MODULE:
readToken();
if (match(Tok_LeftParen) && match(Tok_Ident))
- moduleName = previousLexeme();
- if (!moduleName.startsWith("Qt"))
- moduleName.prepend("Qt");
+ physicalModuleName = previousLexeme();
+ if (!physicalModuleName.startsWith("Qt"))
+ physicalModuleName.prepend("Qt");
match(Tok_RightParen);
break;
default:
@@ -2085,6 +2154,7 @@ bool CppCodeParser::matchDocsAndStuff()
Doc doc(start_loc,end_loc,comment,metacommandsAllowed, topicCommandsAllowed);
QString topic;
bool isQmlPropertyTopic = false;
+ bool isJsPropertyTopic = false;
const TopicList& topics = doc.topicsUsed();
if (!topics.isEmpty()) {
@@ -2094,6 +2164,11 @@ bool CppCodeParser::matchDocsAndStuff()
(topic == COMMAND_QMLATTACHEDPROPERTY)) {
isQmlPropertyTopic = true;
}
+ else if ((topic == COMMAND_JSPROPERTY) ||
+ (topic == COMMAND_JSPROPERTYGROUP) ||
+ (topic == COMMAND_JSATTACHEDPROPERTY)) {
+ isJsPropertyTopic = true;
+ }
}
NodeList nodes;
DocList docs;
@@ -2130,9 +2205,9 @@ bool CppCodeParser::matchDocsAndStuff()
.arg(COMMAND_FN).arg(COMMAND_PAGE));
}
}
- else if (isQmlPropertyTopic) {
+ else if (isQmlPropertyTopic || isJsPropertyTopic) {
Doc nodeDoc = doc;
- processQmlProperties(nodeDoc, nodes, docs);
+ processQmlProperties(nodeDoc, nodes, docs, isJsPropertyTopic);
}
else {
ArgList args;
@@ -2174,7 +2249,7 @@ bool CppCodeParser::matchDocsAndStuff()
checkModuleInclusion(*n);
if ((*n)->isInnerNode() && ((InnerNode *)*n)->includes().isEmpty()) {
InnerNode *m = static_cast<InnerNode *>(*n);
- while (m->parent() && m->moduleName().isEmpty()) {
+ while (m->parent() && m->physicalModuleName().isEmpty()) {
m = m->parent();
}
if (m == *n)
@@ -2187,7 +2262,7 @@ bool CppCodeParser::matchDocsAndStuff()
}
}
else if (tok == Tok_using) {
- matchUsingDecl();
+ matchUsingDecl(0);
}
else {
QStringList parentPath;
@@ -2316,7 +2391,7 @@ void CppCodeParser::instantiateIteratorMacro(const QString &container,
matchDeclList(QDocDatabase::qdocDB()->primaryTreeRoot());
}
-void CppCodeParser::createExampleFileNodes(DocNode *dn)
+void CppCodeParser::createExampleFileNodes(DocumentNode *dn)
{
QString examplePath = dn->name();
QString proFileName = examplePath + QLatin1Char('/') + examplePath.split(QLatin1Char('/')).last() + ".pro";
@@ -2384,13 +2459,13 @@ void CppCodeParser::createExampleFileNodes(DocNode *dn)
}
foreach (const QString &exampleFile, exampleFiles) {
- new DocNode(dn,
+ new DocumentNode(dn,
exampleFile.mid(sizeOfBoringPartOfName),
Node::File,
Node::NoPageType);
}
foreach (const QString &imageFile, imageFiles) {
- new DocNode(dn,
+ new DocumentNode(dn,
imageFile.mid(sizeOfBoringPartOfName),
Node::Image,
Node::NoPageType);
diff --git a/src/tools/qdoc/cppcodeparser.h b/src/tools/qdoc/cppcodeparser.h
index 7499575d13..f9ddcab88c 100644
--- a/src/tools/qdoc/cppcodeparser.h
+++ b/src/tools/qdoc/cppcodeparser.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
@@ -65,15 +65,15 @@ public:
CppCodeParser();
~CppCodeParser();
- virtual void initializeParser(const Config& config);
- virtual void terminateParser();
- virtual QString language();
- virtual QStringList headerFileNameFilter();
- virtual QStringList sourceFileNameFilter();
- virtual void parseHeaderFile(const Location& location, const QString& filePath);
- virtual void parseSourceFile(const Location& location, const QString& filePath);
- virtual void doneParsingHeaderFiles();
- virtual void doneParsingSourceFiles();
+ virtual void initializeParser(const Config& config) Q_DECL_OVERRIDE;
+ virtual void terminateParser() Q_DECL_OVERRIDE;
+ virtual QString language() Q_DECL_OVERRIDE;
+ virtual QStringList headerFileNameFilter() Q_DECL_OVERRIDE;
+ virtual QStringList sourceFileNameFilter() Q_DECL_OVERRIDE;
+ virtual void parseHeaderFile(const Location& location, const QString& filePath) Q_DECL_OVERRIDE;
+ virtual void parseSourceFile(const Location& location, const QString& filePath) Q_DECL_OVERRIDE;
+ virtual void doneParsingHeaderFiles() Q_DECL_OVERRIDE;
+ virtual void doneParsingSourceFiles() Q_DECL_OVERRIDE;
protected:
const QSet<QString>& topicCommands();
@@ -81,7 +81,7 @@ protected:
virtual Node* processTopicCommand(const Doc& doc,
const QString& command,
const ArgLocPair& arg);
- void processQmlProperties(const Doc& doc, NodeList& nodes, DocList& docs);
+ void processQmlProperties(const Doc& doc, NodeList& nodes, DocList& docs, bool jsProps);
bool splitQmlPropertyGroupArg(const QString& arg,
QString& module,
QString& element,
@@ -127,7 +127,7 @@ protected:
bool matchClassDecl(InnerNode *parent,
const QString &templateStuff = QString());
bool matchNamespaceDecl(InnerNode *parent);
- bool matchUsingDecl();
+ bool matchUsingDecl(InnerNode* parent);
bool matchEnumItem(InnerNode *parent, EnumNode *enume);
bool matchEnumDecl(InnerNode *parent);
bool matchTypedefDecl(InnerNode *parent);
@@ -148,7 +148,7 @@ protected:
void instantiateIteratorMacro(const QString &container,
const QString &includeFile,
const QString &macroDef);
- void createExampleFileNodes(DocNode *dn);
+ void createExampleFileNodes(DocumentNode *dn);
protected:
QMap<QString, Node::Type> nodeTypeMap;
@@ -156,7 +156,7 @@ protected:
int tok;
Node::Access access;
FunctionNode::Metaness metaness;
- QString moduleName;
+ QString physicalModuleName;
QStringList lastPath_;
QRegExp varComment;
QRegExp sep;
@@ -203,7 +203,6 @@ protected:
#define COMMAND_TYPEDEF Doc::alias("typedef")
#define COMMAND_VARIABLE Doc::alias("variable")
#define COMMAND_QMLABSTRACT Doc::alias("qmlabstract")
-#define COMMAND_QMLCLASS Doc::alias("qmlclass")
#define COMMAND_QMLTYPE Doc::alias("qmltype")
#define COMMAND_QMLPROPERTY Doc::alias("qmlproperty")
#define COMMAND_QMLPROPERTYGROUP Doc::alias("qmlpropertygroup")
@@ -234,6 +233,17 @@ protected:
#define COMMAND_LICENSEDESCRIPTION Doc::alias("licensedescription")
#define COMMAND_RELEASEDATE Doc::alias("releasedate")
#define COMMAND_QTVARIABLE Doc::alias("qtvariable")
+// Some of these are not used currenmtly, but they are included now for completeness.
+#define COMMAND_JSTYPE Doc::alias("jstype")
+#define COMMAND_JSPROPERTY Doc::alias("jsproperty")
+#define COMMAND_JSPROPERTYGROUP Doc::alias("jspropertygroup")
+#define COMMAND_JSATTACHEDPROPERTY Doc::alias("jsattachedproperty")
+#define COMMAND_JSSIGNAL Doc::alias("jssignal")
+#define COMMAND_JSATTACHEDSIGNAL Doc::alias("jsattachedsignal")
+#define COMMAND_JSMETHOD Doc::alias("jsmethod")
+#define COMMAND_JSATTACHEDMETHOD Doc::alias("jsattachedmethod")
+#define COMMAND_JSBASICTYPE Doc::alias("jsbasictype")
+#define COMMAND_JSMODULE Doc::alias("jsmodule")
QT_END_NAMESPACE
diff --git a/src/tools/qdoc/ditaxmlgenerator.cpp b/src/tools/qdoc/ditaxmlgenerator.cpp
deleted file mode 100644
index d9cf56769b..0000000000
--- a/src/tools/qdoc/ditaxmlgenerator.cpp
+++ /dev/null
@@ -1,5993 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the tools applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL21$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** 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 or version 3 as published by the Free
-** Software Foundation and appearing in the file LICENSE.LGPLv21 and
-** LICENSE.LGPLv3 included in the packaging of this file. Please review the
-** following information to ensure the GNU Lesser General Public License
-** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*
- ditaxmlgenerator.cpp
-*/
-
-#include <qdebug.h>
-#include <qlist.h>
-#include <qiterator.h>
-#include <qtextcodec.h>
-#include <quuid.h>
-#include "codemarker.h"
-#include "codeparser.h"
-#include "ditaxmlgenerator.h"
-#include "node.h"
-#include "quoter.h"
-#include "separator.h"
-#include "tree.h"
-#include <ctype.h>
-#include "qdocdatabase.h"
-
-QT_BEGIN_NAMESPACE
-
-#define COMMAND_VERSION Doc::alias("version")
-int DitaXmlGenerator::id = 0;
-
-/*
- The strings in this array must appear in the same order as
- the values in enum DitaXmlGenerator::DitaTag.
- */
-QString DitaXmlGenerator::ditaTags[] =
-{
- "",
- "alt",
- "apiData",
- "apiDef",
- "apiDefItem",
- "apiDesc",
- "apiDetail",
- "apiItemName",
- "APIMap",
- "apiName",
- "apiRef",
- "apiRelation",
- "audience",
- "author",
- "b",
- "body",
- "bodydiv",
- "brand",
- "category",
- "codeblock",
- "colspec",
- "comment",
- "component",
- "copyrholder",
- "copyright",
- "copyryear",
- "created",
- "critdates",
- "cxxAPIMap",
- "cxxClass",
- "cxxClassAbstract",
- "cxxClassAccessSpecifier",
- "cxxClassAPIItemLocation",
- "cxxClassBaseClass",
- "cxxClassDeclarationFile",
- "cxxClassDeclarationFileLine",
- "cxxClassDeclarationFileLineStart",
- "cxxClassDeclarationFileLineEnd",
- "cxxClassDefinition",
- "cxxClassDerivation",
- "cxxClassDerivationAccessSpecifier",
- "cxxClassDerivations",
- "cxxClassDetail",
- "cxxClassNested",
- "cxxClassNestedClass",
- "cxxClassNestedDetail",
- "cxxDefine",
- "cxxDefineAccessSpecifier",
- "cxxDefineAPIItemLocation",
- "cxxDefineDeclarationFile",
- "cxxDefineDeclarationFileLine",
- "cxxDefineDefinition",
- "cxxDefineDetail",
- "cxxDefineNameLookup",
- "cxxDefineParameter",
- "cxxDefineParameterDeclarationName",
- "cxxDefineParameters",
- "cxxDefinePrototype",
- "cxxDefineReimplemented",
- "cxxEnumeration",
- "cxxEnumerationAccessSpecifier",
- "cxxEnumerationAPIItemLocation",
- "cxxEnumerationDeclarationFile",
- "cxxEnumerationDeclarationFileLine",
- "cxxEnumerationDeclarationFileLineStart",
- "cxxEnumerationDeclarationFileLineEnd",
- "cxxEnumerationDefinition",
- "cxxEnumerationDetail",
- "cxxEnumerationNameLookup",
- "cxxEnumerationPrototype",
- "cxxEnumerationScopedName",
- "cxxEnumerator",
- "cxxEnumeratorInitialiser",
- "cxxEnumeratorNameLookup",
- "cxxEnumeratorPrototype",
- "cxxEnumerators",
- "cxxEnumeratorScopedName",
- "cxxFunction",
- "cxxFunctionAccessSpecifier",
- "cxxFunctionAPIItemLocation",
- "cxxFunctionConst",
- "cxxFunctionConstructor",
- "cxxFunctionDeclarationFile",
- "cxxFunctionDeclarationFileLine",
- "cxxFunctionDeclaredType",
- "cxxFunctionDefinition",
- "cxxFunctionDestructor",
- "cxxFunctionDetail",
- "cxxFunctionNameLookup",
- "cxxFunctionParameter",
- "cxxFunctionParameterDeclarationName",
- "cxxFunctionParameterDeclaredType",
- "cxxFunctionParameterDefaultValue",
- "cxxFunctionParameters",
- "cxxFunctionPrototype",
- "cxxFunctionPureVirtual",
- "cxxFunctionReimplemented",
- "cxxFunctionScopedName",
- "cxxFunctionStorageClassSpecifierStatic",
- "cxxFunctionVirtual",
- "cxxTypedef",
- "cxxTypedefAccessSpecifier",
- "cxxTypedefAPIItemLocation",
- "cxxTypedefDeclarationFile",
- "cxxTypedefDeclarationFileLine",
- "cxxTypedefDefinition",
- "cxxTypedefDetail",
- "cxxTypedefNameLookup",
- "cxxTypedefScopedName",
- "cxxVariable",
- "cxxVariableAccessSpecifier",
- "cxxVariableAPIItemLocation",
- "cxxVariableDeclarationFile",
- "cxxVariableDeclarationFileLine",
- "cxxVariableDeclaredType",
- "cxxVariableDefinition",
- "cxxVariableDetail",
- "cxxVariableNameLookup",
- "cxxVariablePrototype",
- "cxxVariableReimplemented",
- "cxxVariableScopedName",
- "cxxVariableStorageClassSpecifierStatic",
- "data",
- "data-about",
- "dd",
- "dl",
- "dlentry",
- "dt",
- "entry",
- "fig",
- "i",
- "image",
- "keyword",
- "keywords",
- "li",
- "link",
- "linktext",
- "lq",
- "map",
- "mapref",
- "metadata",
- "note",
- "ol",
- "othermeta",
- "p",
- "parameter",
- "permissions",
- "ph",
- "platform",
- "pre",
- "prodinfo",
- "prodname",
- "prolog",
- "publisher",
- "qmlAttached",
- "qmlDetail",
- "qmlImportModule",
- "qmlInheritedBy",
- "qmlInherits",
- "qmlInstantiates",
- "qmlMethod",
- "qmlMethodDef",
- "qmlMethodDetail",
- "qmlName",
- "qmlProperty",
- "qmlPropertyDef",
- "qmlPropertyDetail",
- "qmlPropertyGroup",
- "qmlPropertyGroupDef",
- "qmlPropertyGroupDetail",
- "qmlQualifier",
- "qmlSignal",
- "qmlSignalDef",
- "qmlSignalDetail",
- "qmlSignalHandler",
- "qmlSignalHandlerDef",
- "qmlSignalHandlerDetail",
- "qmlSignature",
- "qmlSince",
- "qmlType",
- "qmlTypeDef",
- "qmlTypeDetail",
- "related-links",
- "resourceid",
- "revised",
- "row",
- "section",
- "sectiondiv",
- "shortdesc",
- "simpletable",
- "source",
- "stentry",
- "sthead",
- "strow",
- "sub",
- "sup",
- "table",
- "tbody",
- "tgroup",
- "thead",
- "title",
- "tm",
- "topic",
- "topicmeta",
- "topicref",
- "tt",
- "u",
- "uicontrol",
- "ul",
- "unknown",
- "vrm",
- "vrmlist",
- "xref",
- ""
-};
-
-/*!
- Composes a string to be used as an href attribute in DITA
- XML. It is composed of the file name and the UUID separated
- by a '#'. If this node is a class node, the file name is
- taken from this node; if this node is a function node, the
- file name is taken from the parent node of this node.
- */
-QString DitaXmlGenerator::ditaXmlHref(Node* n)
-{
- QString href;
- if ((n->type() == Node::Function) ||
- (n->type() == Node::Property) ||
- (n->type() == Node::Variable)) {
- href = fileBase(n->parent());
- }
- else {
- href = fileBase(n);
- }
- if (!href.endsWith(".xml") && !href.endsWith(".dita"))
- href += ".dita";
- return href + QLatin1Char('#') + n->guid();
-}
-
-void DitaXmlGenerator::debugPara(const QString& t)
-{
- writeStartTag(DT_p);
- xmlWriter().writeAttribute("outputclass",t);
- xmlWriter().writeCharacters(t);
- writeEndTag(); // </p>
-}
-
-static bool showBrokenLinks = false;
-
-/*!
- Quick, dirty, and very ugly. Unescape \a text
- so QXmlStreamWriter::writeCharacters() can put
- the escapes back in again!
- */
-void DitaXmlGenerator::writeCharacters(const QString& text)
-{
- QString t = text;
- t = t.replace("&lt;","<");
- t = t.replace("&gt;",">");
- t = t.replace("&amp;","&");
- t = t.replace("&quot;","\"");
- xmlWriter().writeCharacters(t);
-}
-
-/*!
- Appends an <xref> element to the current XML stream
- with the \a href attribute and the \a text.
- */
-void DitaXmlGenerator::addLink(const QString& href,
- const QStringRef& text,
- DitaTag t)
-{
- if (!href.isEmpty()) {
- writeStartTag(t);
- // formathtml
- writeHrefAttribute(href);
- writeCharacters(text.toString());
- writeEndTag(); // </t>
- }
- else {
- writeCharacters(text.toString());
- }
-}
-
-/*!
- Push \a t onto the dita tag stack and write the appropriate
- start tag to the DITA XML file.
- */
-void DitaXmlGenerator::writeStartTag(DitaTag t)
-{
- xmlWriter().writeStartElement(ditaTags[t]);
- tagStack.push(t);
-}
-
-/*!
- Pop the current DITA tag off the stack, and write the
- appropriate end tag to the DITA XML file. If \a t is
- not \e DT_NONE (default), then \a t contains the enum
- value of the tag that should be on top of the stack.
-
- If the stack is empty, no end tag is written and false
- is returned. Otherwise, an end tag is written and true
- is returned.
- */
-bool DitaXmlGenerator::writeEndTag(DitaTag t)
-{
- if (tagStack.isEmpty())
- return false;
- DitaTag top = tagStack.pop();
- if (t > DT_NONE && top != t)
- qDebug() << "Expected:" << t << "ACTUAL:" << top;
- xmlWriter().writeEndElement();
- return true;
-}
-
-/*!
- Return the current DITA element tag, the one
- on top of the stack.
- */
-DitaXmlGenerator::DitaTag DitaXmlGenerator::currentTag()
-{
- return tagStack.top();
-}
-
-/*!
- Write the start \a tag. if \a title is not empty, generate
- a GUID from it and write the GUID as the value of the \e{id}
- attribute.
-
- Then if \a outputclass is not empty, write it as the value
- of the \a outputclass attribute.
-
- Fiunally, set the section nesting level to 1 and return 1.
- */
-int DitaXmlGenerator::enterDesc(DitaTag tag, const QString& outputclass, const QString& title)
-{
- writeStartTag(tag);
- if (!title.isEmpty()) {
- writeGuidAttribute(title);
- //Are there cases where the spectitle is required?
- //xmlWriter().writeAttribute("spectitle",title);
- }
- if (!outputclass.isEmpty())
- xmlWriter().writeAttribute("outputclass",outputclass);
- sectionNestingLevel = 1;
- return sectionNestingLevel;
-}
-
-/*!
- If the section nesting level is 0, output a \c{<section>}
- element with an \e id attribute generated from \a title and
- an \e outputclass attribute set to \a outputclass.
- If \a title is null, no \e id attribute is output.
- If \a outputclass is empty, no \e outputclass attribute
- is output.
-
- Finally, increment the section nesting level and return
- the new value.
- */
-int DitaXmlGenerator::enterSection(const QString& outputclass, const QString& title)
-{
- if (sectionNestingLevel == 0) {
- writeStartTag(DT_section);
- if (!title.isEmpty())
- writeGuidAttribute(title);
- if (!outputclass.isEmpty())
- xmlWriter().writeAttribute("outputclass",outputclass);
- }
- else if (!title.isEmpty()) {
- writeStartTag(DT_p);
- writeGuidAttribute(title);
- if (!outputclass.isEmpty())
- xmlWriter().writeAttribute("outputclass",outputclass);
- writeCharacters(title);
- writeEndTag(); // </p>
- }
- return ++sectionNestingLevel;
-}
-
-/*!
- If the section nesting level is greater than 0, decrement
- it. If it becomes 0, output a \c {</section>}. Return the
- decremented section nesting level.
- */
-int DitaXmlGenerator::leaveSection()
-{
- if (sectionNestingLevel > 0) {
- --sectionNestingLevel;
- if (sectionNestingLevel == 0)
- writeEndTag(); // </section> or </apiDesc>
- }
- return sectionNestingLevel;
-}
-
-/*!
- Constructs the DITA XML output generator.
- */
-DitaXmlGenerator::DitaXmlGenerator()
- : inDetailedDescription(false),
- inLegaleseText(false),
- inObsoleteLink(false),
- inTableBody(false),
- noLinks(false),
- obsoleteLinks(false),
- divNestingLevel(0),
- sectionNestingLevel(0),
- tableColumnCount(0),
- funcLeftParen("\\S(\\()"),
- nodeTypeMaps(Node::LastType,0),
- nodeSubtypeMaps(Node::LastSubtype,0),
- pageTypeMaps(Node::OnBeyondZebra,0)
-{
-}
-
-/*!
- Destroys the DITA XML output generator.
- */
-DitaXmlGenerator::~DitaXmlGenerator()
-{
- GuidMaps::iterator i = guidMaps.begin();
- while (i != guidMaps.end()) {
- delete i.value();
- ++i;
- }
-}
-
-/*!
- Initializes the DITA XML output generator's data structures
- from the configuration class \a config.
- */
-void DitaXmlGenerator::initializeGenerator(const Config &config)
-{
- Generator::initializeGenerator(config);
- obsoleteLinks = config.getBool(CONFIG_OBSOLETELINKS);
- setImageFileExtensions(QStringList() << "png" << "jpg" << "jpeg" << "gif");
-
- style = config.getString(DitaXmlGenerator::format() +
- Config::dot +
- DITAXMLGENERATOR_STYLE);
- postHeader = config.getString(DitaXmlGenerator::format() +
- Config::dot +
- DITAXMLGENERATOR_POSTHEADER);
- postPostHeader = config.getString(DitaXmlGenerator::format() +
- Config::dot +
- DITAXMLGENERATOR_POSTPOSTHEADER);
- footer = config.getString(DitaXmlGenerator::format() +
- Config::dot +
- DITAXMLGENERATOR_FOOTER);
- address = config.getString(DitaXmlGenerator::format() +
- Config::dot +
- DITAXMLGENERATOR_ADDRESS);
- pleaseGenerateMacRef = config.getBool(DitaXmlGenerator::format() +
- Config::dot +
- DITAXMLGENERATOR_GENERATEMACREFS);
-
- project = config.getString(CONFIG_PROJECT);
- projectDescription = config.getString(CONFIG_DESCRIPTION);
- if (projectDescription.isEmpty() && !project.isEmpty())
- projectDescription = project + " Reference Documentation";
-
- projectUrl = config.getString(CONFIG_URL);
- tagFile_ = config.getString(CONFIG_TAGFILE);
-
-#ifndef QT_NO_TEXTCODEC
- outputEncoding = config.getString(CONFIG_OUTPUTENCODING);
- if (outputEncoding.isEmpty())
- outputEncoding = QLatin1String("ISO-8859-1");
- outputCodec = QTextCodec::codecForName(outputEncoding.toLocal8Bit());
-#endif
-
- naturalLanguage = config.getString(CONFIG_NATURALLANGUAGE);
- if (naturalLanguage.isEmpty())
- naturalLanguage = QLatin1String("en");
-
- config.subVarsAndValues("dita.metadata.default",metadataDefaults);
- QSet<QString> editionNames = config.subVars(CONFIG_EDITION);
- QSet<QString>::ConstIterator edition = editionNames.constBegin();
- while (edition != editionNames.constEnd()) {
- QString editionName = *edition;
- QStringList editionModules = config.getStringList(CONFIG_EDITION +
- Config::dot +
- editionName +
- Config::dot +
- "modules");
- QStringList editionGroups = config.getStringList(CONFIG_EDITION +
- Config::dot +
- editionName +
- Config::dot +
- "groups");
-
- if (!editionModules.isEmpty())
- editionModuleMap[editionName] = editionModules;
- if (!editionGroups.isEmpty())
- editionGroupMap[editionName] = editionGroups;
-
- ++edition;
- }
-
- stylesheets = config.getStringList(DitaXmlGenerator::format() +
- Config::dot +
- DITAXMLGENERATOR_STYLESHEETS);
- customHeadElements = config.getStringList(DitaXmlGenerator::format() +
- Config::dot +
- DITAXMLGENERATOR_CUSTOMHEADELEMENTS);
- version = config.getString(CONFIG_VERSION);
- vrm = version.split(QLatin1Char('.'));
-}
-
-/*!
- Gracefully terminates the DITA XML output generator.
- */
-void DitaXmlGenerator::terminateGenerator()
-{
- Generator::terminateGenerator();
-}
-
-/*!
- Returns "DITAXML".
- */
-QString DitaXmlGenerator::format()
-{
- return "DITAXML";
-}
-
-/*!
- Calls lookupGuid() to get a GUID for \a text, then writes
- it to the XML stream as an "id" attribute, and returns it.
- */
-QString DitaXmlGenerator::writeGuidAttribute(QString text)
-{
- QString guid = lookupGuid(outFileName(),text);
- xmlWriter().writeAttribute("id",guid);
- return guid;
-}
-
-
-/*!
- Write's the GUID for the \a node to the current XML stream
- as an "id" attribute. If the \a node doesn't yet have a GUID,
- one is generated.
- */
-void DitaXmlGenerator::writeGuidAttribute(Node* node)
-{
- xmlWriter().writeAttribute("id",node->guid());
-}
-
-/*!
- Looks up \a text in the GUID map. If it finds \a text,
- it returns the associated GUID. Otherwise it inserts
- \a text into the map with a new GUID, and it returns
- the new GUID.
- */
-QString DitaXmlGenerator::lookupGuid(QString text)
-{
- QMap<QString, QString>::const_iterator i = name2guidMap.constFind(text);
- if (i != name2guidMap.constEnd())
- return i.value();
- QString guid = Node::cleanId(text);
- name2guidMap.insert(text,guid);
- return guid;
-}
-
-/*!
- First, look up the GUID map for \a fileName. If there isn't
- a GUID map for \a fileName, create one and insert it into
- the map of GUID maps. Then look up \a text in that GUID map.
- If \a text is found, return the associated GUID. Otherwise,
- insert \a text into the GUID map with a new GUID, and return
- the new GUID.
- */
-QString DitaXmlGenerator::lookupGuid(const QString& fileName, const QString& text)
-{
- GuidMap* gm = lookupGuidMap(fileName);
- GuidMap::const_iterator i = gm->constFind(text);
- if (i != gm->constEnd())
- return i.value();
- QString guid = Node::cleanId(text);
- gm->insert(text,guid);
- return guid;
-}
-
-/*!
- Looks up \a fileName in the map of GUID maps. If it finds
- \a fileName, it returns a pointer to the associated GUID
- map. Otherwise it creates a new GUID map and inserts it
- into the map of GUID maps with \a fileName as its key.
- */
-GuidMap* DitaXmlGenerator::lookupGuidMap(const QString& fileName)
-{
- GuidMaps::const_iterator i = guidMaps.constFind(fileName);
- if (i != guidMaps.constEnd())
- return i.value();
- GuidMap* gm = new GuidMap;
- guidMaps.insert(fileName,gm);
- return gm;
-}
-
-/*!
- Traverses the current tree generating all the DITA XML documentation.
- */
-void DitaXmlGenerator::generateDocs()
-{
- if (!runPrepareOnly())
- Generator::generateDocs();
-
- if (!runGenerateOnly()) {
- QString fileBase = project.toLower().simplified().replace(QLatin1Char(' '), QLatin1Char('-'));
- qdb_->generateIndex(outputDir() + QLatin1Char('/') + fileBase + ".index",
- projectUrl,
- projectDescription,
- this,
- true);
- }
-
- if (!runPrepareOnly()) {
- writeDitaMap();
- /*
- Generate the XML tag file, if it was requested.
- */
- qdb_->generateTagFile(tagFile_, this);
- }
-}
-
-static int countTableColumns(const Atom* t)
-{
- int result = 0;
- if (t->type() == Atom::TableHeaderLeft) {
- while (t->type() == Atom::TableHeaderLeft) {
- int count = 0;
- t = t->next();
- while (t->type() != Atom::TableHeaderRight) {
- if (t->type() == Atom::TableItemLeft) {
- for (int i=0; i<t->count(); ++i) {
- QString attr = t->string(i);
- if (!attr.contains('=')) {
- QStringList spans = attr.split(QLatin1Char(','));
- if (spans.size() == 2) {
- count += spans[0].toInt();
- }
- else {
- ++count;
- }
- }
- }
- }
- t = t->next();
- }
- if (count > result)
- result = count;
- t = t->next();
- }
- }
- else if (t->type() == Atom::TableRowLeft) {
- while (t->type() != Atom::TableRowRight) {
- if (t->type() == Atom::TableItemLeft) {
- for (int i=0; i<t->count(); ++i) {
- QString attr = t->string(i);
- if (!attr.contains('=')) {
- QStringList spans = attr.split(QLatin1Char(','));
- if (spans.size() == 2) {
- result += spans[0].toInt();
- }
- else {
- ++result;
- }
- }
- }
- }
- t = t->next();
- }
- }
- return result;
-}
-
-/*!
- Generate html from an instance of Atom.
- */
-int DitaXmlGenerator::generateAtom(const Atom *atom,
- const Node *relative,
- CodeMarker *marker)
-{
- int skipAhead = 0;
- QString hx, str;
- static bool in_para = false;
- QString guid, hc, attr;
-
- switch (atom->type()) {
- case Atom::AbstractLeft:
- break;
- case Atom::AbstractRight:
- break;
- case Atom::AutoLink:
- if (!noLinks && !inLink_ && !inContents_ && !inSectionHeading_) {
- const Node* node = 0;
- QString link = getAutoLink(atom, relative, &node);
- if (!link.isEmpty()) {
- beginLink(link);
- generateLink(atom, marker);
- endLink();
- }
- else {
- writeCharacters(protectEnc(atom->string()));
- }
- }
- else {
- writeCharacters(protectEnc(atom->string()));
- }
- break;
- case Atom::BaseName:
- break;
- case Atom::BriefLeft:
- {
- Node::Type t = relative->type();
- if (inSection()) {
- in_para = true;
- writeStartTag(DT_p);
- xmlWriter().writeAttribute("outputclass","brief");
- }
- else {
- noLinks = true;
- writeStartTag(DT_shortdesc);
- }
- if (t == Node::Property || t == Node::Variable) {
- xmlWriter().writeCharacters("This ");
- if (relative->type() == Node::Property)
- xmlWriter().writeCharacters("property");
- else if (relative->type() == Node::Variable)
- xmlWriter().writeCharacters("variable");
- xmlWriter().writeCharacters(" holds ");
- }
- if (noLinks) {
- atom = atom->next();
- while (atom != 0 && atom->type() != Atom::BriefRight) {
- if (atom->type() == Atom::String ||
- atom->type() == Atom::AutoLink)
- str += atom->string();
- skipAhead++;
- atom = atom->next();
- }
- if (t == Node::Property || t == Node::Variable)
- str[0] = str[0].toLower();
- if (str.endsWith(QLatin1Char('.')))
- str.truncate(str.length() - 1);
- writeCharacters(str + QLatin1Char('.'));
- }
- }
- break;
- case Atom::BriefRight:
- writeEndTag(); // </shortdesc> or </p>
- if (in_para)
- in_para = false;
- noLinks = false;
- break;
- case Atom::C:
- writeStartTag(DT_tt);
- if (inLink_) {
- writeCharacters(protectEnc(plainCode(atom->string())));
- }
- else {
- writeText(atom->string(), relative);
- }
- writeEndTag(); // see writeStartElement() above
- break;
- case Atom::Code:
- {
- writeStartTag(DT_codeblock);
- xmlWriter().writeAttribute("outputclass","cpp");
- writeCharacters("\n");
- writeText(trimmedTrailing(atom->string()), relative);
- writeEndTag(); // </codeblock>
- }
- break;
- case Atom::Qml:
- writeStartTag(DT_codeblock);
- xmlWriter().writeAttribute("outputclass","qml");
- writeCharacters("\n");
- writeText(trimmedTrailing(atom->string()), relative);
- writeEndTag(); // </codeblock>
- break;
- case Atom::CodeNew:
- writeStartTag(DT_p);
- xmlWriter().writeCharacters("you can rewrite it as");
- writeEndTag(); // </p>
- writeStartTag(DT_codeblock);
- writeCharacters("\n");
- writeText(trimmedTrailing(atom->string()), relative);
- writeEndTag(); // </codeblock>
- break;
- case Atom::CodeOld:
- writeStartTag(DT_p);
- xmlWriter().writeCharacters("For example, if you have code like");
- writeEndTag(); // </p>
- // fallthrough
- case Atom::CodeBad:
- writeStartTag(DT_codeblock);
- writeCharacters("\n");
- writeCharacters(trimmedTrailing(plainCode(atom->string())));
- writeEndTag(); // </codeblock>
- break;
- case Atom::DivLeft:
- {
- bool inStartElement = false;
- attr = atom->string();
- DitaTag t = currentTag();
- if ((t == DT_section) || (t == DT_sectiondiv)) {
- writeStartTag(DT_sectiondiv);
- divNestingLevel++;
- inStartElement = true;
- }
- else if ((t == DT_body) || (t == DT_bodydiv)) {
- writeStartTag(DT_bodydiv);
- divNestingLevel++;
- inStartElement = true;
- }
- if (!attr.isEmpty()) {
- if (attr.contains('=')) {
- int index = 0;
- int from = 0;
- QString values;
- while (index >= 0) {
- index = attr.indexOf('"',from);
- if (index >= 0) {
- ++index;
- from = index;
- index = attr.indexOf('"',from);
- if (index > from) {
- if (!values.isEmpty())
- values.append(' ');
- values += attr.mid(from,index-from);
- from = index+1;
- }
- }
- }
- attr = values;
- }
- }
- if (inStartElement)
- xmlWriter().writeAttribute("outputclass", attr);
- }
- break;
- case Atom::DivRight:
- if ((currentTag() == DT_sectiondiv) || (currentTag() == DT_bodydiv)) {
- writeEndTag(); // </sectiondiv>, </bodydiv>, or </p>
- if (divNestingLevel > 0)
- --divNestingLevel;
- }
- break;
- case Atom::FootnoteLeft:
- // ### For now
- if (in_para) {
- writeEndTag(); // </p>
- in_para = false;
- }
- xmlWriter().writeCharacters("<!-- ");
- break;
- case Atom::FootnoteRight:
- // ### For now
- xmlWriter().writeCharacters("-->");
- break;
- case Atom::FormatElse:
- case Atom::FormatEndif:
- case Atom::FormatIf:
- break;
- case Atom::FormattingLeft:
- {
- DitaTag t = DT_LAST;
- if (atom->string() == ATOM_FORMATTING_BOLD)
- t = DT_b;
- else if (atom->string() == ATOM_FORMATTING_PARAMETER)
- t = DT_i;
- else if (atom->string() == ATOM_FORMATTING_ITALIC)
- t = DT_i;
- else if (atom->string() == ATOM_FORMATTING_TELETYPE)
- t = DT_tt;
- else if (atom->string().startsWith("span ")) {
- t = DT_keyword;
- }
- else if (atom->string() == ATOM_FORMATTING_UICONTROL)
- t = DT_uicontrol;
- else if (atom->string() == ATOM_FORMATTING_UNDERLINE)
- t = DT_u;
- else if (atom->string() == ATOM_FORMATTING_INDEX)
- t = DT_comment;
- else if (atom->string() == ATOM_FORMATTING_SUBSCRIPT)
- t = DT_sub;
- else if (atom->string() == ATOM_FORMATTING_SUPERSCRIPT)
- t = DT_sup;
- else
- qDebug() << "DT_LAST";
- writeStartTag(t);
- if (atom->string() == ATOM_FORMATTING_PARAMETER) {
- if (atom->next() != 0 && atom->next()->type() == Atom::String) {
- QRegExp subscriptRegExp("([a-z]+)_([0-9n])");
- if (subscriptRegExp.exactMatch(atom->next()->string())) {
- xmlWriter().writeCharacters(subscriptRegExp.cap(1));
- writeStartTag(DT_sub);
- xmlWriter().writeCharacters(subscriptRegExp.cap(2));
- writeEndTag(); // </sub>
- skipAhead = 1;
- }
- }
- }
- else if (t == DT_keyword) {
- QString attr = atom->string().mid(5);
- if (!attr.isEmpty()) {
- if (attr.contains('=')) {
- int index = 0;
- int from = 0;
- QString values;
- while (index >= 0) {
- index = attr.indexOf('"',from);
- if (index >= 0) {
- ++index;
- from = index;
- index = attr.indexOf('"',from);
- if (index > from) {
- if (!values.isEmpty())
- values.append(' ');
- values += attr.mid(from,index-from);
- from = index+1;
- }
- }
- }
- attr = values;
- }
- }
- xmlWriter().writeAttribute("outputclass", attr);
- }
- }
- break;
- case Atom::FormattingRight:
- if (atom->string() == ATOM_FORMATTING_LINK) {
- endLink();
- }
- else {
- writeEndTag(); // ?
- }
- break;
- case Atom::AnnotatedList:
- {
- GroupNode* gn = qdb_->getGroup(atom->string());
- if (gn)
- generateAnnotatedList(relative, marker, gn->members());
- }
- break;
- case Atom::GeneratedList:
- if (atom->string() == "annotatedclasses") {
- generateAnnotatedList(relative, marker, qdb_->getCppClasses());
- }
- else if (atom->string() == "classes") {
- generateCompactList(Generic, relative, qdb_->getCppClasses(), true, QStringLiteral("Q"));
- }
- else if (atom->string() == "qmlclasses") {
- generateCompactList(Generic, relative, qdb_->getQmlTypes(), true, QStringLiteral(""));
- }
- else if (atom->string().contains("classesbymodule")) {
- QString arg = atom->string().trimmed();
- QString moduleName = atom->string().mid(atom->string().indexOf("classesbymodule") + 15).trimmed();
- QDocDatabase* qdb = QDocDatabase::qdocDB();
- ModuleNode* mn = qdb->findModule(moduleName);
- if (mn) {
- NodeMap m;
- mn->getMemberClasses(m);
- if (!m.isEmpty()) {
- generateAnnotatedList(relative, marker, m);
- }
- }
- }
- else if (atom->string() == "classhierarchy") {
- generateClassHierarchy(relative, qdb_->getCppClasses());
- }
- else if (atom->string() == "compatclasses") {
- // "compatclasses" is no longer used. Delete this at some point.
- // mws 03/10/2013
- generateCompactList(Generic, relative, qdb_->getCompatibilityClasses(), false, QStringLiteral("Q"));
- }
- else if (atom->string() == "obsoleteclasses") {
- generateCompactList(Generic, relative, qdb_->getObsoleteClasses(), false, QStringLiteral("Q"));
- }
- else if (atom->string() == "obsoleteqmltypes") {
- generateCompactList(Generic, relative, qdb_->getObsoleteQmlTypes(), false, QStringLiteral(""));
- }
- else if (atom->string() == "obsoletecppmembers") {
- generateCompactList(Obsolete, relative, qdb_->getClassesWithObsoleteMembers(), false, QStringLiteral("Q"));
- }
- else if (atom->string() == "obsoleteqmlmembers") {
- generateCompactList(Obsolete, relative, qdb_->getQmlTypesWithObsoleteMembers(), false, QStringLiteral(""));
- }
- else if (atom->string() == "functionindex") {
- generateFunctionIndex(relative);
- }
- else if (atom->string() == "legalese") {
- generateLegaleseList(relative, marker);
- }
- else if (atom->string() == "mainclasses") {
- // "mainclasses" is no longer used. Delete this at some point.
- // mws 03/10/2013
- generateCompactList(Generic, relative, qdb_->getMainClasses(), true, QStringLiteral("Q"));
- }
- else if (atom->string() == "services") {
- // "services" is no longer used. Delete this at some point.
- // mws 03/10/2013
- generateCompactList(Generic, relative, qdb_->getServiceClasses(), false, QStringLiteral("Q"));
- }
- else if (atom->string() == "overviews") {
- generateOverviewList(relative);
- }
- else if (atom->string() == "namespaces") {
- generateAnnotatedList(relative, marker, qdb_->getNamespaces());
- }
- else if (atom->string() == "related") {
- if (relative && relative->isCollectionNode()) {
- const CollectionNode* cn = static_cast<const CollectionNode *>(relative);
- if (cn)
- generateAnnotatedList(cn, marker, cn->members());
- }
- }
- break;
- case Atom::SinceList:
- {
- const NodeMultiMap& nsmap = qdb_->getSinceMap(atom->string());
- const NodeMap& ncmap = qdb_->getClassMap(atom->string());
- const NodeMap& nqcmap = qdb_->getQmlTypeMap(atom->string());
- if (!nsmap.isEmpty()) {
- QList<Section> sections;
- QList<Section>::ConstIterator s;
-
- for (int i=0; i<LastSinceType; ++i)
- sections.append(Section(sinceTitle(i),QString(),QString(),QString()));
-
- NodeMultiMap::const_iterator n = nsmap.constBegin();
- while (n != nsmap.constEnd()) {
- const Node* node = n.value();
- switch (node->type()) {
- case Node::QmlType:
- sections[QmlClass].appendMember((Node*)node);
- break;
- 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::QmlSignalHandler:
- sections[QmlSignalHandler].appendMember((Node*)node);
- break;
- case Node::QmlMethod:
- sections[QmlMethod].appendMember((Node*)node);
- break;
- default:
- break;
- }
- ++n;
- }
-
- writeStartTag(DT_ul);
- s = sections.constBegin();
- while (s != sections.constEnd()) {
- if (!(*s).members.isEmpty()) {
- QString li = outFileName() + QLatin1Char('#') + Doc::canonicalTitle((*s).name);
- writeXrefListItem(li, (*s).name);
- }
- ++s;
- }
- writeEndTag(); // </ul>
-
- int idx = 0;
- s = sections.constBegin();
- while (s != sections.constEnd()) {
- if (!(*s).members.isEmpty()) {
- writeStartTag(DT_p);
- writeGuidAttribute(Doc::canonicalTitle((*s).name));
- xmlWriter().writeAttribute("outputclass","h3");
- writeCharacters(protectEnc((*s).name));
- writeEndTag(); // </p>
- if (idx == Class)
- generateCompactList(Generic, 0, ncmap, false, QString("Q"));
- else if (idx == QmlClass)
- generateCompactList(Generic, 0, nqcmap, false, 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();
- writeStartTag(DT_p);
- xmlWriter().writeCharacters("Class ");
- writeStartTag(DT_xref);
- // formathtml
- xmlWriter().writeAttribute("href",linkForNode(pmap.key(), 0));
- QStringList pieces = pmap.key()->fullName().split("::");
- writeCharacters(protectEnc(pieces.last()));
- writeEndTag(); // </xref>
- xmlWriter().writeCharacters(":");
- writeEndTag(); // </p>
-
- generateSection(nlist, 0, marker, CodeMarker::Summary);
- ++pmap;
- }
- }
- else {
- generateSection(s->members, 0, marker, CodeMarker::Summary);
- }
- }
- ++idx;
- ++s;
- }
- }
- }
- break;
- case Atom::BR:
- // DITA XML can't do <br>
- break;
- case Atom::HR: //<p outputclass="horizontal-rule" />
- writeStartTag(DT_p);
- xmlWriter().writeAttribute("outputclass","horizontal-rule");
- writeEndTag(); // </p>
- break;
- case Atom::Image:
- case Atom::InlineImage:
- {
- QString fileName = imageFileName(relative, atom->string());
- QString text;
- if (atom->next() != 0)
- text = atom->next()->string();
- if (fileName.isEmpty()) {
- relative->location().warning(tr("Missing image: %1").arg(protectEnc(atom->string())));
- QString images = "images";
- if (!atom->string().isEmpty() && atom->string()[0] != '/')
- images.append(QLatin1Char('/'));
- fileName = images + atom->string();
- }
- if (relative && relative->isExample()) {
- const ExampleNode* cen = static_cast<const ExampleNode*>(relative);
- if (cen->imageFileName().isEmpty()) {
- ExampleNode* en = const_cast<ExampleNode*>(cen);
- en->setImageFileName(fileName);
- }
- }
-
- if (currentTag() != DT_xref && atom->type() != Atom::InlineImage)
- writeStartTag(DT_fig);
- writeStartTag(DT_image);
- writeHrefAttribute(protectEnc(fileName));
- if (atom->type() == Atom::Image) {
- xmlWriter().writeAttribute("placement","break");
- xmlWriter().writeAttribute("align","center");
- }
- if (!text.isEmpty()) {
- writeStartTag(DT_alt);
- writeCharacters(protectEnc(text));
- writeEndTag(); // </alt>
- }
- writeEndTag(); // </image>
- if (currentTag() != DT_xref && atom->type() != Atom::InlineImage)
- writeEndTag(); // </fig>
- }
- break;
- case Atom::ImageText:
- // nothing
- break;
- case Atom::ImportantLeft:
- writeStartTag(DT_note);
- xmlWriter().writeAttribute("type","important");
- break;
- case Atom::ImportantRight:
- writeEndTag(); // </note>
- break;
- case Atom::NoteLeft:
- writeStartTag(DT_note);
- xmlWriter().writeAttribute("type","note");
- break;
- case Atom::NoteRight:
- writeEndTag(); // </note>
- break;
- case Atom::LegaleseLeft:
- inLegaleseText = true;
- break;
- case Atom::LegaleseRight:
- inLegaleseText = false;
- break;
- case Atom::LineBreak:
- //xmlWriter().writeEmptyElement("br");
- break;
- case Atom::Link:
- {
- const Node *node = 0;
- QString link = getLink(atom, relative, &node);
- if (link.isEmpty() && !noLinkErrors())
- relative->doc().location().warning(tr("Can't link to '%1'").arg(atom->string()));
- else if (!inSectionHeading_)
- beginLink(link);
- skipAhead = 1;
- }
- break;
- case Atom::GuidLink:
- {
- beginLink(atom->string());
- skipAhead = 1;
- }
- break;
- case Atom::LinkNode:
- {
- const Node* node = CodeMarker::nodeForString(atom->string());
- beginLink(linkForNode(node, relative));
- skipAhead = 1;
- }
- break;
- case Atom::ListLeft:
- if (in_para) {
- writeEndTag(); // </p>
- in_para = false;
- }
- if (atom->string() == ATOM_LIST_BULLET) {
- writeStartTag(DT_ul);
- }
- else if (atom->string() == ATOM_LIST_TAG) {
- writeStartTag(DT_dl);
- }
- else if (atom->string() == ATOM_LIST_VALUE) {
- threeColumnEnumValueTable_ = isThreeColumnEnumValueTable(atom);
- if (threeColumnEnumValueTable_) {
- writeStartTag(DT_simpletable);
- xmlWriter().writeAttribute("outputclass","valuelist");
- writeStartTag(DT_sthead);
- writeStartTag(DT_stentry);
- xmlWriter().writeCharacters("Constant");
- writeEndTag(); // </stentry>
- writeStartTag(DT_stentry);
- xmlWriter().writeCharacters("Value");
- writeEndTag(); // </stentry>
- writeStartTag(DT_stentry);
- xmlWriter().writeCharacters("Description");
- writeEndTag(); // </stentry>
- writeEndTag(); // </sthead>
- }
- else {
- writeStartTag(DT_simpletable);
- xmlWriter().writeAttribute("outputclass","valuelist");
- writeStartTag(DT_sthead);
- writeStartTag(DT_stentry);
- xmlWriter().writeCharacters("Constant");
- writeEndTag(); // </stentry>
- writeStartTag(DT_stentry);
- xmlWriter().writeCharacters("Value");
- writeEndTag(); // </stentry>
- writeEndTag(); // </sthead>
- }
- }
- else {
- writeStartTag(DT_ol);
- if (atom->string() == ATOM_LIST_UPPERALPHA)
- xmlWriter().writeAttribute("outputclass","upperalpha");
- else if (atom->string() == ATOM_LIST_LOWERALPHA)
- xmlWriter().writeAttribute("outputclass","loweralpha");
- else if (atom->string() == ATOM_LIST_UPPERROMAN)
- xmlWriter().writeAttribute("outputclass","upperroman");
- else if (atom->string() == ATOM_LIST_LOWERROMAN)
- xmlWriter().writeAttribute("outputclass","lowerroman");
- else // (atom->string() == ATOM_LIST_NUMERIC)
- xmlWriter().writeAttribute("outputclass","numeric");
- if (atom->next() != 0 && atom->next()->string().toInt() != 1) {
- /*
- This attribute is not supported in DITA, and at the
- moment, including it is causing a validation error
- wherever it is used. I think it is only used in the
- qdoc manual.
- */
- //xmlWriter().writeAttribute("start",atom->next()->string());
- }
- }
- break;
- case Atom::ListItemNumber:
- // nothing
- break;
- case Atom::ListTagLeft:
- if (atom->string() == ATOM_LIST_TAG) {
- writeStartTag(DT_dt);
- }
- else { // (atom->string() == ATOM_LIST_VALUE)
- writeStartTag(DT_strow);
- writeStartTag(DT_stentry);
- writeStartTag(DT_tt);
- writeCharacters(protectEnc(plainCode(marker->markedUpEnumValue(atom->next()->string(),
- relative))));
- writeEndTag(); // </tt>
- writeEndTag(); // </stentry>
- writeStartTag(DT_stentry);
-
- QString itemValue;
- if (relative->type() == Node::Enum) {
- const EnumNode *enume = static_cast<const EnumNode *>(relative);
- itemValue = enume->itemValue(atom->next()->string());
- }
-
- if (itemValue.isEmpty())
- xmlWriter().writeCharacters("?");
- else {
- writeStartTag(DT_tt);
- writeCharacters(protectEnc(itemValue));
- writeEndTag(); // </tt>
- }
- skipAhead = 1;
- }
- break;
- case Atom::ListTagRight:
- if (atom->string() == ATOM_LIST_TAG)
- writeEndTag(); // </dt>
- break;
- case Atom::ListItemLeft:
- if (atom->string() == ATOM_LIST_TAG) {
- writeStartTag(DT_dd);
- }
- else if (atom->string() == ATOM_LIST_VALUE) {
- if (threeColumnEnumValueTable_) {
- writeEndTag(); // </stentry>
- writeStartTag(DT_stentry);
- }
- }
- else {
- writeStartTag(DT_li);
- }
- if (matchAhead(atom, Atom::ParaLeft))
- skipAhead = 1;
- break;
- case Atom::ListItemRight:
- if (atom->string() == ATOM_LIST_TAG) {
- writeEndTag(); // </dd>
- }
- else if (atom->string() == ATOM_LIST_VALUE) {
- writeEndTag(); // </stentry>
- writeEndTag(); // </strow>
- }
- else {
- writeEndTag(); // </li>
- }
- break;
- case Atom::ListRight:
- if (atom->string() == ATOM_LIST_BULLET) {
- writeEndTag(); // </ul>
- }
- else if (atom->string() == ATOM_LIST_TAG) {
- writeEndTag(); // </dl>
- }
- else if (atom->string() == ATOM_LIST_VALUE) {
- writeEndTag(); // </simpletable>
- }
- else {
- writeEndTag(); // </ol>
- }
- break;
- case Atom::Nop:
- // nothing
- break;
- case Atom::ParaLeft:
- writeStartTag(DT_p);
- if (inLegaleseText)
- xmlWriter().writeAttribute("outputclass","legalese");
- in_para = true;
- break;
- case Atom::ParaRight:
- endLink();
- if (in_para) {
- writeEndTag(); // </p>
- in_para = false;
- }
- break;
- case Atom::QuotationLeft:
- writeStartTag(DT_lq);
- break;
- case Atom::QuotationRight:
- writeEndTag(); // </lq>
- break;
- case Atom::RawString:
- if (atom->string() == " ")
- break;
- if (atom->string().startsWith(QLatin1Char('&')))
- writeCharacters(atom->string());
- else if (atom->string() == "<sup>*</sup>") {
- writeStartTag(DT_sup);
- writeCharacters("*");
- writeEndTag(); // </sup>
- }
- else if (atom->string() == "<sup>&reg;</sup>") {
- writeStartTag(DT_tm);
- xmlWriter().writeAttribute("tmtype","reg");
- writeEndTag(); // </tm>
- }
- else {
- writeStartTag(DT_pre);
- xmlWriter().writeAttribute("outputclass","raw-html");
- writeCharacters(atom->string());
- writeEndTag(); // </pre>
- }
- break;
- case Atom::SectionLeft:
- enterSection("details",QString());
- break;
- case Atom::SectionRight:
- leaveSection();
- break;
- case Atom::SectionHeadingLeft:
- {
- writeStartTag(DT_p);
- QString id = Text::sectionHeading(atom).toString();
- id = stripMarkup(id);
- id = Doc::canonicalTitle(id);
- writeGuidAttribute(id);
- hx = QLatin1Char('h') + QString::number(atom->string().toInt() + hOffset(relative));
- xmlWriter().writeAttribute("outputclass",hx);
- inSectionHeading_ = true;
- }
- break;
- case Atom::SectionHeadingRight:
- writeEndTag(); // </title> (see case Atom::SectionHeadingLeft)
- inSectionHeading_ = false;
- break;
- case Atom::SidebarLeft:
- // nothing
- break;
- case Atom::SidebarRight:
- // nothing
- break;
- case Atom::String:
- if (inLink_ && !inContents_ && !inSectionHeading_) {
- generateLink(atom, marker);
- }
- else {
- writeCharacters(atom->string());
- }
- break;
- case Atom::TableLeft:
- {
- QString attr;
- if ((atom->count() > 0) && (atom->string(0) == "borderless"))
- attr = "borderless";
- else if ((atom->count() > 1) && (atom->string(1) == "borderless"))
- attr = "borderless";
- if (in_para) {
- writeEndTag(); // </p>
- in_para = false;
- }
- writeStartTag(DT_table);
- if (!attr.isEmpty())
- xmlWriter().writeAttribute("outputclass",attr);
- numTableRows_ = 0;
- if (tableColumnCount != 0) {
- qDebug() << "ERROR: Nested tables!";
- tableColumnCount = 0;
- }
- tableColumnCount = countTableColumns(atom->next());
- writeStartTag(DT_tgroup);
- xmlWriter().writeAttribute("cols",QString::number(tableColumnCount));
- for (int i = 0; i < tableColumnCount; i++) {
- writeStartTag(DT_colspec);
- xmlWriter().writeAttribute("colname", QStringLiteral("col%1").arg(i));
- xmlWriter().writeAttribute("colnum", QString::number(i));
- xmlWriter().writeAttribute("colwidth", QStringLiteral("1*"));
- writeEndTag(); // DT_colspec
- }
- inTableHeader_ = false;
- inTableBody = false;
- }
- break;
- case Atom::TableRight:
- writeEndTag(); // </tbody>
- writeEndTag(); // </tgroup>
- writeEndTag(); // </table>
- inTableHeader_ = false;
- inTableBody = false;
- tableColumnCount = 0;
- currentColumn = 0;
- break;
- case Atom::TableHeaderLeft:
- if (inTableBody) {
- writeEndTag(); // </tbody>
- writeEndTag(); // </tgroup>
- writeEndTag(); // </table>
- inTableHeader_ = false;
- inTableBody = false;
- tableColumnCount = 0;
- writeStartTag(DT_table);
- numTableRows_ = 0;
- tableColumnCount = countTableColumns(atom);
- writeStartTag(DT_tgroup);
- xmlWriter().writeAttribute("cols",QString::number(tableColumnCount));
- }
- currentColumn = 0;
- writeStartTag(DT_thead);
- xmlWriter().writeAttribute("valign","top");
- writeStartTag(DT_row);
- xmlWriter().writeAttribute("valign","top");
- inTableHeader_ = true;
- inTableBody = false;
- break;
- case Atom::TableHeaderRight:
- writeEndTag(); // </row>
- if (matchAhead(atom, Atom::TableHeaderLeft)) {
- skipAhead = 1;
- writeStartTag(DT_row);
- xmlWriter().writeAttribute("valign","top");
- }
- else {
- writeEndTag(); // </thead>
- inTableHeader_ = false;
- inTableBody = true;
- writeStartTag(DT_tbody);
- }
- break;
- case Atom::TableRowLeft:
- if (!inTableHeader_ && !inTableBody) {
- inTableBody = true;
- writeStartTag(DT_tbody);
- }
- currentColumn = 0;
- writeStartTag(DT_row);
- attr = atom->string();
- if (!attr.isEmpty()) {
- if (attr.contains('=')) {
- int index = 0;
- int from = 0;
- QString values;
- while (index >= 0) {
- index = attr.indexOf('"',from);
- if (index >= 0) {
- ++index;
- from = index;
- index = attr.indexOf('"',from);
- if (index > from) {
- if (!values.isEmpty())
- values.append(' ');
- values += attr.mid(from,index-from);
- from = index+1;
- }
- }
- }
- attr = values;
- }
- xmlWriter().writeAttribute("outputclass", attr);
- }
- xmlWriter().writeAttribute("valign","top");
- break;
- case Atom::TableRowRight:
- writeEndTag(); // </row>
- break;
- case Atom::TableItemLeft:
- {
- QString values;
- writeStartTag(DT_entry);
- for (int i=0; i<atom->count(); ++i) {
- attr = atom->string(i);
- if (attr.contains('=')) {
- int index = 0;
- int from = 0;
- while (index >= 0) {
- index = attr.indexOf('"',from);
- if (index >= 0) {
- ++index;
- from = index;
- index = attr.indexOf('"',from);
- if (index > from) {
- if (!values.isEmpty())
- values.append(' ');
- values += attr.mid(from,index-from);
- from = index+1;
- }
- }
- }
- }
- else {
- QStringList spans = attr.split(QLatin1Char(','));
- if (spans.size() == 2) {
- if (spans[0].toInt()>1) {
- xmlWriter().writeAttribute("namest",QStringLiteral("col%1").arg(currentColumn));
- xmlWriter().writeAttribute("nameend",QStringLiteral("col%1")
- .arg(currentColumn + (spans[0].toInt() - 1)));
- }
- if (spans[1].toInt()>1)
- xmlWriter().writeAttribute("morerows",spans[1].simplified());
- currentColumn += spans[0].toInt();
- }
- }
- }
- if (!values.isEmpty())
- xmlWriter().writeAttribute("outputclass",values);
- if (matchAhead(atom, Atom::ParaLeft))
- skipAhead = 1;
- }
- break;
- case Atom::TableItemRight:
- if (inTableHeader_) {
- writeEndTag(); // </entry>
- }
- else {
- writeEndTag(); // </entry>
- }
- if (matchAhead(atom, Atom::ParaLeft))
- skipAhead = 1;
- break;
- case Atom::TableOfContents:
- {
- int numColumns = 1;
- const Node* node = relative;
-
- Doc::Sections sectionUnit = Doc::Section4;
- QStringList params = atom->string().split(QLatin1Char(','));
- QString columnText = params.at(0);
- QStringList pieces = columnText.split(QLatin1Char(' '), QString::SkipEmptyParts);
- if (pieces.size() >= 2) {
- columnText = pieces.at(0);
- pieces.pop_front();
- QString path = pieces.join(' ').trimmed();
- node = qdb_->findNodeForTarget(path, relative);
- if (!node)
- relative->doc().location().warning(tr("Cannot link to '%1'").arg(path));
- }
-
- if (params.size() == 2) {
- numColumns = qMax(columnText.toInt(), numColumns);
- sectionUnit = (Doc::Sections)params.at(1).toInt();
- }
-
- if (node)
- generateTableOfContents(node,
- marker,
- sectionUnit,
- numColumns,
- relative);
- }
- break;
- case Atom::Target:
- if (in_para) {
- writeEndTag(); // </p>
- in_para = false;
- }
- writeStartTag(DT_p);
- writeGuidAttribute(Doc::canonicalTitle(atom->string()));
- xmlWriter().writeAttribute("outputclass","target");
- //xmlWriter().writeCharacters(protectEnc(atom->string()));
- writeEndTag(); // </p>
- break;
- case Atom::UnhandledFormat:
- writeStartTag(DT_b);
- xmlWriter().writeAttribute("outputclass","error");
- xmlWriter().writeCharacters("<Missing DITAXML>");
- writeEndTag(); // </b>
- break;
- case Atom::UnknownCommand:
- writeStartTag(DT_b);
- xmlWriter().writeAttribute("outputclass","error unknown-command");
- writeCharacters(protectEnc(atom->string()));
- writeEndTag(); // </b>
- break;
- case Atom::QmlText:
- case Atom::EndQmlText:
- // don't do anything with these. They are just tags.
- break;
- default:
- // unknownAtom(atom);
- break;
- }
- return skipAhead;
-}
-
-/*!
- Generate a <cxxClass> element (and all the stuff inside it)
- for the C++ class represented by \a innerNode. \a marker is
- for marking up the code. I don't know what that means exactly.
- */
-void
-DitaXmlGenerator::generateClassLikeNode(InnerNode* inner, CodeMarker* marker)
-{
- QList<Section>::ConstIterator s;
-
- QString title;
- QString rawTitle;
- QString fullTitle;
- if (inner->type() == Node::Namespace) {
- const NamespaceNode* nsn = const_cast<NamespaceNode*>(static_cast<const NamespaceNode*>(inner));
- rawTitle = inner->plainName();
- fullTitle = inner->plainFullName();
- title = rawTitle + " Namespace";
-
- /*
- Note: Because the C++ specialization we are using
- has no <cxxNamespace> element, we are using the
- <cxxClass> element with an outputclass attribute
- set to "namespace" .
- */
- generateHeader(inner, fullTitle);
- generateBrief(inner, marker); // <shortdesc>
- writeProlog(inner);
-
- writeStartTag(DT_cxxClassDetail);
- writeStartTag(DT_cxxClassDefinition);
- writeLocation(nsn);
- writeEndTag(); // <cxxClassDefinition>
-
- enterDesc(DT_apiDesc,QString(),title);
- generateStatus(nsn, marker);
- generateThreadSafeness(nsn, marker);
- generateSince(nsn, marker);
-
- enterSection(QString(), QString());
- generateBody(nsn, marker);
- generateAlsoList(nsn, marker);
- leaveSection();
- leaveSection(); // </apiDesc>
-
- bool needOtherSection = false;
- QList<Section> summarySections;
- summarySections = marker->sections(inner, CodeMarker::Summary, CodeMarker::Okay);
- if (!summarySections.isEmpty()) {
- enterSection("redundant",QString());
- s = summarySections.constBegin();
- while (s != summarySections.constEnd()) {
- if (s->members.isEmpty() && s->reimpMembers.isEmpty()) {
- if (!s->inherited.isEmpty())
- needOtherSection = true;
- }
- else {
- QString attr;
- if (!s->members.isEmpty()) {
- writeStartTag(DT_p);
- attr = cleanRef((*s).name).toLower() + " h2";
- xmlWriter().writeAttribute("outputclass",attr);
- writeCharacters(protectEnc((*s).name));
- writeEndTag(); // </title>
- generateSection(s->members, inner, marker, CodeMarker::Summary);
- generateSectionInheritedList(*s, inner);
- }
- if (!s->reimpMembers.isEmpty()) {
- QString name = QString("Reimplemented ") + (*s).name;
- attr = cleanRef(name).toLower() + " h2";
- writeStartTag(DT_p);
- xmlWriter().writeAttribute("outputclass",attr);
- writeCharacters(protectEnc(name));
- writeEndTag(); // </title>
- generateSection(s->reimpMembers, inner, marker, CodeMarker::Summary);
- generateSectionInheritedList(*s, inner);
- }
- }
- ++s;
- }
- if (needOtherSection) {
- writeStartTag(DT_p);
- xmlWriter().writeAttribute("outputclass","h3");
- xmlWriter().writeCharacters("Additional Inherited Members");
- writeEndTag(); // </title>
- s = summarySections.constBegin();
- while (s != summarySections.constEnd()) {
- if (s->members.isEmpty())
- generateSectionInheritedList(*s, inner);
- ++s;
- }
- }
- leaveSection();
- }
-
- writeEndTag(); // </cxxClassDetail>
-
- // not included: <related-links>
- // not included: <cxxClassNested>
-
- QList<Section> detailSections;
- detailSections = marker->sections(inner, CodeMarker::Detailed, CodeMarker::Okay);
- s = detailSections.constBegin();
- while (s != detailSections.constEnd()) {
- if ((*s).name == "Classes") {
- writeNestedClasses((*s),nsn);
- break;
- }
- ++s;
- }
-
- s = detailSections.constBegin();
- while (s != detailSections.constEnd()) {
- if ((*s).name == "Function Documentation") {
- writeFunctions((*s),nsn,marker);
- }
- else if ((*s).name == "Type Documentation") {
- writeEnumerations((*s),marker);
- writeTypedefs((*s),marker);
- }
- else if ((*s).name == "Namespaces") {
- qDebug() << "Nested namespaces" << outFileName();
- }
- else if ((*s).name == "Macro Documentation") {
- //writeMacros((*s),marker);
- }
- ++s;
- }
-
- generateLowStatusMembers(inner,marker,CodeMarker::Obsolete);
- generateLowStatusMembers(inner,marker,CodeMarker::Compat);
- writeEndTag(); // </cxxClass>
- }
- else if (inner->type() == Node::Class) {
- const ClassNode* cn = const_cast<ClassNode*>(static_cast<const ClassNode*>(inner));
- rawTitle = inner->plainName();
- fullTitle = inner->plainFullName();
- title = rawTitle + " Class";
-
- generateHeader(inner, fullTitle);
- generateBrief(inner, marker); // <shortdesc>
- writeProlog(inner);
-
- writeStartTag(DT_cxxClassDetail);
- writeStartTag(DT_cxxClassDefinition);
- writeStartTag(DT_cxxClassAccessSpecifier);
- xmlWriter().writeAttribute("value",inner->accessString());
- writeEndTag(); // <cxxClassAccessSpecifier>
- if (cn->isAbstract()) {
- writeStartTag(DT_cxxClassAbstract);
- xmlWriter().writeAttribute("name","abstract");
- xmlWriter().writeAttribute("value","abstract");
- writeEndTag(); // </cxxClassAbstract>
- }
- writeDerivations(cn); // <cxxClassDerivations>
-
- // not included: <cxxClassTemplateParameters>
-
- writeLocation(cn);
- writeEndTag(); // <cxxClassDefinition>
-
- enterDesc(DT_apiDesc,QString(),title);
- generateStatus(cn, marker);
- generateInherits(cn, marker);
- generateInheritedBy(cn, marker);
- generateThreadSafeness(cn, marker);
- generateSince(cn, marker);
- enterSection(QString(), QString());
- generateBody(cn, marker);
- generateAlsoList(cn, marker);
- leaveSection();
- leaveSection(); // </apiDesc>
-
- bool needOtherSection = false;
- QList<Section> summarySections;
- summarySections = marker->sections(inner, CodeMarker::Summary, CodeMarker::Okay);
- if (!summarySections.isEmpty()) {
- enterSection("redundant",QString());
- s = summarySections.constBegin();
- while (s != summarySections.constEnd()) {
- if (s->members.isEmpty() && s->reimpMembers.isEmpty()) {
- if (!s->inherited.isEmpty())
- needOtherSection = true;
- }
- else {
- QString attr;
- if (!s->members.isEmpty()) {
- writeStartTag(DT_p);
- attr = cleanRef((*s).name).toLower() + " h2";
- xmlWriter().writeAttribute("outputclass",attr);
- writeCharacters(protectEnc((*s).name));
- writeEndTag(); // </p>
- generateSection(s->members, inner, marker, CodeMarker::Summary);
- generateSectionInheritedList(*s, inner);
- }
- if (!s->reimpMembers.isEmpty()) {
- QString name = QString("Reimplemented ") + (*s).name;
- attr = cleanRef(name).toLower() + " h2";
- writeStartTag(DT_p);
- xmlWriter().writeAttribute("outputclass",attr);
- writeCharacters(protectEnc(name));
- writeEndTag(); // </p>
- generateSection(s->reimpMembers, inner, marker, CodeMarker::Summary);
- generateSectionInheritedList(*s, inner);
- }
- }
- ++s;
- }
- if (needOtherSection) {
- writeStartTag(DT_p);
- xmlWriter().writeAttribute("outputclass","h3");
- xmlWriter().writeCharacters("Additional Inherited Members");
- writeEndTag(); // </p>
- s = summarySections.constBegin();
- while (s != summarySections.constEnd()) {
- if (s->members.isEmpty())
- generateSectionInheritedList(*s, inner);
- ++s;
- }
- }
- leaveSection();
- }
-
- // not included: <example> or <apiImpl>
-
- writeEndTag(); // </cxxClassDetail>
-
- // not included: <related-links>
- // not included: <cxxClassNested>
-
- QList<Section> detailSections;
- detailSections = marker->sections(inner, CodeMarker::Detailed, CodeMarker::Okay);
- s = detailSections.constBegin();
- while (s != detailSections.constEnd()) {
- if ((*s).name == "Member Function Documentation") {
- writeFunctions((*s),cn,marker);
- }
- else if ((*s).name == "Member Type Documentation") {
- writeEnumerations((*s),marker);
- writeTypedefs((*s),marker);
- }
- else if ((*s).name == "Member Variable Documentation") {
- writeDataMembers((*s),marker);
- }
- else if ((*s).name == "Property Documentation") {
- writeProperties((*s),marker);
- }
- else if ((*s).name == "Macro Documentation") {
- //writeMacros((*s),marker);
- }
- else if ((*s).name == "Related Non-Members") {
- QString attribute("related-non-member");
- writeFunctions((*s),cn,marker,attribute);
- }
- ++s;
- }
-
- generateLowStatusMembers(inner,marker,CodeMarker::Obsolete);
- generateLowStatusMembers(inner,marker,CodeMarker::Compat);
- writeEndTag(); // </cxxClass>
- }
- else if (inner->isHeaderFile()) {
- const DocNode* dn = const_cast<DocNode*>(static_cast<const DocNode*>(inner));
- rawTitle = inner->plainName();
- fullTitle = inner->plainFullName();
- title = rawTitle;
-
- /*
- Note: Because the C++ specialization we are using
- has no <cxxHeaderFile> element, we are using the
- <cxxClass> element with an outputclass attribute
- set to "headerfile" .
- */
- generateHeader(inner, fullTitle);
- generateBrief(inner, marker); // <shortdesc>
- writeProlog(inner);
-
- writeStartTag(DT_cxxClassDetail);
- enterDesc(DT_apiDesc,QString(),title);
- generateStatus(dn, marker);
- generateThreadSafeness(dn, marker);
- generateSince(dn, marker);
- generateSince(dn, marker);
- enterSection(QString(), QString());
- generateBody(dn, marker);
- generateAlsoList(dn, marker);
- leaveSection();
- leaveSection(); // </apiDesc>
-
- bool needOtherSection = false;
- QList<Section> summarySections;
- summarySections = marker->sections(inner, CodeMarker::Summary, CodeMarker::Okay);
- if (!summarySections.isEmpty()) {
- enterSection("redundant",QString());
- s = summarySections.constBegin();
- while (s != summarySections.constEnd()) {
- if (s->members.isEmpty() && s->reimpMembers.isEmpty()) {
- if (!s->inherited.isEmpty())
- needOtherSection = true;
- }
- else {
- QString attr;
- if (!s->members.isEmpty()) {
- writeStartTag(DT_p);
- attr = cleanRef((*s).name).toLower() + " h2";
- xmlWriter().writeAttribute("outputclass",attr);
- writeCharacters(protectEnc((*s).name));
- writeEndTag(); // </p>
- generateSection(s->members, inner, marker, CodeMarker::Summary);
- generateSectionInheritedList(*s, inner);
- }
- if (!s->reimpMembers.isEmpty()) {
- QString name = QString("Reimplemented ") + (*s).name;
- attr = cleanRef(name).toLower() + " h2";
- writeStartTag(DT_p);
- xmlWriter().writeAttribute("outputclass",attr);
- writeCharacters(protectEnc(name));
- writeEndTag(); // </p>
- generateSection(s->reimpMembers, inner, marker, CodeMarker::Summary);
- generateSectionInheritedList(*s, inner);
- }
- }
- ++s;
- }
- if (needOtherSection) {
- enterSection("additional-inherited-members redundant",QString());
- writeStartTag(DT_p);
- xmlWriter().writeAttribute("outputclass","h3");
- xmlWriter().writeCharacters("Additional Inherited Members");
- writeEndTag(); // </p>
- s = summarySections.constBegin();
- while (s != summarySections.constEnd()) {
- if (s->members.isEmpty())
- generateSectionInheritedList(*s, inner);
- ++s;
- }
- }
- leaveSection();
- }
-
- writeEndTag(); // </cxxClassDetail>
-
- // not included: <related-links>
- // not included: <cxxClassNested>
-
- QList<Section> detailSections;
- detailSections = marker->sections(inner, CodeMarker::Detailed, CodeMarker::Okay);
- s = detailSections.constBegin();
- while (s != detailSections.constEnd()) {
- if ((*s).name == "Classes") {
- writeNestedClasses((*s),dn);
- break;
- }
- ++s;
- }
-
- s = detailSections.constBegin();
- while (s != detailSections.constEnd()) {
- if ((*s).name == "Function Documentation") {
- writeFunctions((*s),dn,marker);
- }
- else if ((*s).name == "Type Documentation") {
- writeEnumerations((*s),marker);
- writeTypedefs((*s),marker);
- }
- else if ((*s).name == "Namespaces") {
- qDebug() << "Nested namespaces" << outFileName();
- }
- else if ((*s).name == "Macro Documentation") {
- //writeMacros((*s),marker);
- }
- ++s;
- }
- generateLowStatusMembers(inner,marker,CodeMarker::Obsolete);
- generateLowStatusMembers(inner,marker,CodeMarker::Compat);
- writeEndTag(); // </cxxClass>
- }
- else if (inner->isQmlType()) {
- QmlClassNode* qcn = const_cast<QmlClassNode*>(static_cast<const QmlClassNode*>(inner));
- ClassNode* cn = qcn->classNode();
- rawTitle = inner->plainName();
- fullTitle = inner->plainFullName();
- title = rawTitle + " Type";
- Node::clearPropertyGroupCount();
-
- generateHeader(inner, fullTitle);
- generateBrief(inner, marker); // <shortdesc>
- writeProlog(inner);
-
- writeStartTag(DT_qmlTypeDetail);
- generateQmlModuleDef(qcn);
- generateQmlInherits(qcn,marker);
- generateQmlInheritedBy(qcn, marker);
- generateQmlInstantiates(qcn,marker);
- generateQmlSince(qcn);
-
- enterDesc(DT_apiDesc,QString(),title);
- enterSection(QString(), QString());
- generateBody(qcn, marker);
- if (cn) {
- generateQmlText(cn->doc().body(), cn, marker, qcn->name());
- generateAlsoList(cn, marker);
- }
- leaveSection();
- leaveSection(); // </apiDesc>
- writeEndTag(); // </qmlTypeDetail>
-
- QList<Section> members = marker->qmlSections(qcn,CodeMarker::Detailed);
- if (!members.isEmpty()) {
- s = members.constBegin();
- while (s != members.constEnd()) {
- if (!s->members.isEmpty()) {
- NodeList::ConstIterator m = (*s).members.constBegin();
- while (m != (*s).members.constEnd()) {
- generateDetailedQmlMember(*m, qcn, marker);
- ++m;
- }
- }
- ++s;
- }
- }
- writeEndTag(); // </apiRef>
- }
-}
-
-/*!
- Generate the DITA page for a qdoc file that doesn't map
- to an underlying c++ file.
- */
-void DitaXmlGenerator::generateQmlBasicTypePage(QmlBasicTypeNode* qbtn, CodeMarker* marker)
-{
- QList<Section> sections;
- QList<Section>::const_iterator s;
- QString fullTitle = "QML Basic Type: " + qbtn->fullTitle();
-
- generateHeader(qbtn, fullTitle);
- generateBrief(qbtn, marker); // <shortdesc>
- writeProlog(qbtn);
-
- writeStartTag(DT_body);
- enterSection(QString(), QString());
-
- if (!qbtn->doc().isEmpty()) {
- generateBody(qbtn, marker);
- generateAlsoList(qbtn, marker);
- }
- leaveSection(); // </section>
- if (!writeEndTag()) { // </body>
- qbtn->doc().location().warning(tr("Pop of empty XML tag stack; generating DITA for '%1'").arg(qbtn->name()));
- return;
- }
- writeRelatedLinks(qbtn);
- writeEndTag(); // </topic>
-}
-
-/*!
- Write a list item for a \a link with the given \a text.
- */
-void DitaXmlGenerator::writeXrefListItem(const QString& link, const QString& text)
-{
- writeStartTag(DT_li);
- writeStartTag(DT_xref);
- // formathtml
- writeHrefAttribute(link);
- writeCharacters(text);
- writeEndTag(); // </xref>
- writeEndTag(); // </li>
-}
-
-/*!
- Generate the DITA page for a qdoc file that doesn't map
- to an underlying c++ file.
- */
-void DitaXmlGenerator::generateDocNode(DocNode* dn, CodeMarker* marker)
-{
- /*
- If the dn node is a page node, and if the page type
- is DITA map page, write the node's contents as a dita
- map and return without doing anything else.
- */
- if (dn->subType() == Node::Page && dn->pageType() == Node::DitaMapPage) {
- const DitaMapNode* dmn = static_cast<const DitaMapNode*>(dn);
- writeDitaMap(dmn);
- return;
- }
-
- QList<Section> sections;
- QList<Section>::const_iterator s;
- QString fullTitle = dn->fullTitle();
-
- generateHeader(dn, fullTitle);
- generateBrief(dn, marker); // <shortdesc>
- writeProlog(dn);
-
- writeStartTag(DT_body);
- enterSection(QString(), QString());
-
- if (dn->doc().isEmpty()) {
- if (dn->subType() == Node::File) {
- Text text;
- Quoter quoter;
- writeStartTag(DT_p);
- xmlWriter().writeAttribute("outputclass", "small-subtitle");
- text << dn->subTitle();
- generateText(text, dn, marker);
- writeEndTag(); // </p>
- Doc::quoteFromFile(dn->doc().location(), quoter, dn->name());
- QString code = quoter.quoteTo(dn->location(), QString(), QString());
- text.clear();
- text << Atom(Atom::Code, code);
- generateText(text, dn, marker);
- }
- }
- else {
- generateBody(dn, marker);
- generateAlsoList(dn, marker);
- }
- leaveSection(); // </section>
- if (!writeEndTag()) { // </body>
- dn->doc().location().warning(tr("Pop of empty XML tag stack; generating DITA for '%1'").arg(dn->name()));
- return;
- }
- writeRelatedLinks(dn);
- writeEndTag(); // </topic>
-}
-
-/*!
- Generate the DITA XML file for a group, module, or QML module.
- */
-void DitaXmlGenerator::generateCollectionNode(CollectionNode* cn, CodeMarker* marker)
-{
- QList<Section> sections;
- QList<Section>::const_iterator s;
- QString fullTitle = cn->fullTitle();
-
- generateHeader(cn, fullTitle);
- generateBrief(cn, marker); // <shortdesc>
- writeProlog(cn);
-
- writeStartTag(DT_body);
- enterSection(QString(), QString());
- if (cn->isModule()) {
- generateStatus(cn, marker);
- NodeMap nm;
- cn->getMemberNamespaces(nm);
- if (!nm.isEmpty()) {
- enterSection("h2","Namespaces");
- generateAnnotatedList(cn, marker, nm);
- leaveSection();
- }
- nm.clear();
- cn->getMemberClasses(nm);
- if (!nm.isEmpty()) {
- enterSection("h2","Classes");
- generateAnnotatedList(cn, marker, nm);
- leaveSection();
- }
- nm.clear();
- }
-
- if (!cn->doc().isEmpty()) {
- if (cn->isModule()) {
- enterSection(QString(), QString());
- generateBody(cn, marker);
- leaveSection();
- }
- else {
- generateBody(cn, marker);
- }
- generateAlsoList(cn, marker);
- generateAnnotatedList(cn, marker, cn->members());
- }
- leaveSection(); // </section>
- if (!writeEndTag()) { // </body>
- cn->doc().location().warning(tr("Pop of empty XML tag stack; generating DITA for '%1'").arg(cn->name()));
- return;
- }
- writeRelatedLinks(cn);
- writeEndTag(); // </topic>
-}
-
-/*!
- This function writes a \e{<link>} element inside a
- \e{<related-links>} element.
-
- \sa writeRelatedLinks()
- */
-void DitaXmlGenerator::writeLink(const Node* node,
- const QString& text,
- const QString& role)
-{
- if (node) {
- QString link = fileName(node) + QLatin1Char('#') + node->guid();
- if (link.endsWith(QLatin1Char('#')))
- qDebug() << "LINK ENDS WITH #:" << link << outFileName();
- writeStartTag(DT_link);
- writeHrefAttribute(link);
- xmlWriter().writeAttribute("role", role);
- writeStartTag(DT_linktext);
- writeCharacters(text);
- writeEndTag(); // </linktext>
- writeEndTag(); // </link>
- }
-}
-
-/*!
- This function writes a \e{<related-links>} element, which
- contains the \c{next}, \c{previous}, and \c{start}
- links for topic pages that have them. Note that the
- value of the \e role attribute is \c{parent} for the
- \c{start} link.
- */
-void DitaXmlGenerator::writeRelatedLinks(const Node* node)
-{
- const Node* linkNode = 0;
- QPair<QString,QString> linkPair;
- if (node && !node->links().empty()) {
- writeStartTag(DT_relatedLinks);
- if (node->links().contains(Node::PreviousLink)) {
- linkPair = node->links()[Node::PreviousLink];
- linkNode = qdb_->findNodeForTarget(linkPair.first, node);
- if (!linkNode)
- node->doc().location().warning(tr("Cannot link to '%1'").arg(linkPair.first));
- if (linkNode && linkNode->isDocNode()) {
- const DocNode *docNode = static_cast<const DocNode*>(linkNode);
- linkPair.second = docNode->title();
- }
- writeLink(linkNode, linkPair.second, "previous");
- }
- if (node->links().contains(Node::NextLink)) {
- linkPair = node->links()[Node::NextLink];
- linkNode = qdb_->findNodeForTarget(linkPair.first, node);
- if (!linkNode)
- node->doc().location().warning(tr("Cannot link to '%1'").arg(linkPair.first));
- if (linkNode && linkNode->isDocNode()) {
- const DocNode *docNode = static_cast<const DocNode*>(linkNode);
- linkPair.second = docNode->title();
- }
- writeLink(linkNode, linkPair.second, "next");
- }
- if (node->links().contains(Node::StartLink)) {
- linkPair = node->links()[Node::StartLink];
- linkNode = qdb_->findNodeForTarget(linkPair.first, node);
- if (!linkNode)
- node->doc().location().warning(tr("Cannot link to '%1'").arg(linkPair.first));
- if (linkNode && linkNode->isDocNode()) {
- const DocNode *docNode = static_cast<const DocNode*>(linkNode);
- linkPair.second = docNode->title();
- }
- writeLink(linkNode, linkPair.second, "parent");
- }
- writeEndTag(); // </related-links>
- }
-}
-
-/*!
- Returns "dita" for this subclass of class Generator.
- */
-QString DitaXmlGenerator::fileExtension() const
-{
- return "dita";
-}
-
-/*!
- Writes an XML file header to the current XML stream. This
- depends on which kind of DITA XML file is being generated,
- which is determined by the \a node type and subtype and the
- \a subpage flag.
- */
-void DitaXmlGenerator::generateHeader(const Node* node, const QString& name)
-{
- if (!node)
- return;
-
- DitaTag mainTag = DT_cxxClass;
- DitaTag nameTag = DT_apiName;
- QString doctype;
- QString dtd;
- QString base;
- QString version;
- QString outputclass;
-
- if (node->isClass()) {
- mainTag = DT_cxxClass;
- nameTag = DT_apiName;
- dtd = "dtd/cxxClass.dtd";
- version = "0.7.0";
- doctype = "<!DOCTYPE " + ditaTags[mainTag] +
- " PUBLIC \"-//NOKIA//DTD DITA C++ API Class Reference Type v" +
- version + "//EN\" \"" + dtd + "\">";
- }
- else if (node->isNamespace()) {
- mainTag = DT_cxxClass;
- nameTag = DT_apiName;
- dtd = "dtd/cxxClass.dtd";
- version = "0.7.0";
- doctype = "<!DOCTYPE " + ditaTags[mainTag] +
- " PUBLIC \"-//NOKIA//DTD DITA C++ API Class Reference Type v" +
- version + "//EN\" \"" + dtd + "\">";
- outputclass = "namespace";
- }
- else if (node->isCollectionNode()) {
- mainTag = DT_topic;
- nameTag = DT_title;
- dtd = "dtd/topic.dtd";
- doctype = "<!DOCTYPE " + ditaTags[mainTag] +
- " PUBLIC \"-//OASIS//DTD DITA Topic//EN\" \"" + dtd + "\">";
- switch (node->type()) {
- case Node::Group:
- outputclass = "group";
- break;
- case Node::Module:
- outputclass = "module";
- break;
- case Node::QmlModule:
- outputclass = "qmlmodule";
- break;
- default:
- outputclass = "page";
- }
- }
- else if (node->isDocNode()) {
- if (node->isHeaderFile()) {
- mainTag = DT_cxxClass;
- nameTag = DT_apiName;
- dtd = "dtd/cxxClass.dtd";
- version = "0.7.0";
- doctype = "<!DOCTYPE " + ditaTags[mainTag] +
- " PUBLIC \"-//NOKIA//DTD DITA C++ API Class Reference Type v" +
- version + "//EN\" \"" + dtd + "\">";
- outputclass = "headerfile";
- }
- else if (node->isQmlType()) {
- mainTag = DT_qmlType;
- nameTag = DT_apiName;
- dtd = "dtd/qmlType.dtd";
- version = "0.1.0";
- doctype = "<!DOCTYPE " + ditaTags[mainTag] +
- " PUBLIC \"-//NOKIA//DTD DITA QML Type" +
- "//EN\" \"" + dtd + "\">";
- outputclass = "QML-type";
- }
- else {
- mainTag = DT_topic;
- nameTag = DT_title;
- dtd = "dtd/topic.dtd";
- doctype = "<!DOCTYPE " + ditaTags[mainTag] +
- " PUBLIC \"-//OASIS//DTD DITA Topic//EN\" \"" + dtd + "\">";
- switch (node->subType()) {
- case Node::Page:
- outputclass = node->pageTypeString();
- break;
- case Node::Example:
- outputclass = "example";
- break;
- case Node::File:
- outputclass = "file";
- break;
- case Node::Image: // not used
- outputclass = "image";
- break;
- case Node::ExternalPage: // not used
- outputclass = "externalpage";
- break;
- default:
- outputclass = "page";
- }
- }
- }
-
- xmlWriter().writeDTD(doctype);
- xmlWriter().writeComment(node->doc().location().fileName());
- writeStartTag(mainTag);
- QString id = node->guid();
- xmlWriter().writeAttribute("id",id);
- if (!outputclass.isEmpty())
- xmlWriter().writeAttribute("outputclass",outputclass);
- writeStartTag(nameTag); // <title> or <apiName>
- if (!name.isEmpty())
- writeCharacters(name);
- else
- writeCharacters(node->name());
- writeEndTag(); // </title> or </apiName>
-}
-
-/*!
- Outputs the \e brief command as a <shortdesc> element.
- */
-void DitaXmlGenerator::generateBrief(const Node* node, CodeMarker* marker)
-{
- Text brief = node->doc().briefText(true); // zzz
- if (!brief.isEmpty()) {
- generateText(brief, node, marker);
- }
-}
-
-/*!
- zzz
- Generates a table of contents beginning at \a node.
- Currently just returns without writing anything.
- */
-void DitaXmlGenerator::generateTableOfContents(const Node* node,
- CodeMarker* marker,
- Doc::Sections sectionUnit,
- int numColumns,
- const Node* relative)
-
-{
- return;
- if (!node->doc().hasTableOfContents())
- return;
- QList<Atom *> toc = node->doc().tableOfContents();
- if (toc.isEmpty())
- return;
-
- QString nodeName;
- if (node != relative)
- nodeName = node->name();
-
- QStringList sectionNumber;
- int columnSize = 0;
-
- QString tdTag;
- if (numColumns > 1) {
- tdTag = "<td>"; /* width=\"" + QString::number((100 + numColumns - 1) / numColumns) + "%\">";*/
- out() << "<table class=\"toc\">\n<tr class=\"topAlign\">"
- << tdTag << '\n';
- }
-
- // disable nested links in table of contents
- inContents_ = true;
- inLink_ = true;
-
- for (int i = 0; i < toc.size(); ++i) {
- Atom *atom = toc.at(i);
-
- int nextLevel = atom->string().toInt();
- if (nextLevel > (int)sectionUnit)
- continue;
-
- if (sectionNumber.size() < nextLevel) {
- do {
- out() << "<ul>";
- sectionNumber.append("1");
- } while (sectionNumber.size() < nextLevel);
- }
- else {
- while (sectionNumber.size() > nextLevel) {
- out() << "</ul>\n";
- sectionNumber.removeLast();
- }
- sectionNumber.last() = QString::number(sectionNumber.last().toInt() + 1);
- }
- int numAtoms;
- Text headingText = Text::sectionHeading(atom);
-
- if (sectionNumber.size() == 1 && columnSize > toc.size() / numColumns) {
- out() << "</ul></td>" << tdTag << "<ul>\n";
- columnSize = 0;
- }
- out() << "<li>";
- out() << "<xref href=\""
- << nodeName
- << '#'
- << Doc::canonicalTitle(headingText.toString())
- << "\">";
- generateAtomList(headingText.firstAtom(), node, marker, true, numAtoms);
- out() << "</xref></li>\n";
-
- ++columnSize;
- }
- while (!sectionNumber.isEmpty()) {
- out() << "</ul>\n";
- sectionNumber.removeLast();
- }
-
- if (numColumns > 1)
- out() << "</td></tr></table>\n";
-
- inContents_ = false;
- inLink_ = false;
-}
-
-void DitaXmlGenerator::generateLowStatusMembers(InnerNode* inner,
- CodeMarker* marker,
- CodeMarker::Status status)
-{
- QString attribute;
- if (status == CodeMarker::Compat)
- attribute = "Qt3-support";
- else if (status == CodeMarker::Obsolete)
- attribute = "obsolete";
- else
- return;
-
- QList<Section> sections = marker->sections(inner, CodeMarker::Detailed, status);
- QMutableListIterator<Section> j(sections);
- while (j.hasNext()) {
- if (j.next().members.size() == 0)
- j.remove();
- }
- if (sections.isEmpty())
- return;
-
- if (status == CodeMarker::Obsolete)
- inner->setObsoleteLink(fileBase(inner) + "-obsolete." + fileExtension());
-
- QList<Section>::ConstIterator s = sections.constBegin();
- while (s != sections.constEnd()) {
- if ((*s).name == "Member Function Documentation") {
- writeFunctions((*s),inner,marker,attribute);
- }
- else if ((*s).name == "Member Type Documentation") {
- writeEnumerations((*s),marker,attribute);
- writeTypedefs((*s),marker,attribute);
- }
- else if ((*s).name == "Member Variable Documentation") {
- writeDataMembers((*s),marker,attribute);
- }
- else if ((*s).name == "Property Documentation") {
- writeProperties((*s),marker,attribute);
- }
- else if ((*s).name == "Macro Documentation") {
- //writeMacros((*s),marker,attribute);
- }
- ++s;
- }
-}
-
-/*!
- Write the XML for the class hierarchy to the current XML stream.
- */
-void DitaXmlGenerator::generateClassHierarchy(const Node* relative, NodeMap& classMap)
-{
- if (classMap.isEmpty())
- return;
-
- NodeMap topLevel;
- NodeMap::Iterator c = classMap.begin();
- while (c != classMap.end()) {
- ClassNode* classe = static_cast<ClassNode*>(*c);
- if (classe->baseClasses().isEmpty())
- topLevel.insert(classe->name(), classe);
- ++c;
- }
-
- QStack<NodeMap > stack;
- stack.push(topLevel);
-
- writeStartTag(DT_ul);
- while (!stack.isEmpty()) {
- if (stack.top().isEmpty()) {
- stack.pop();
- writeEndTag(); // </ul>
- if (!stack.isEmpty())
- writeEndTag(); // </li>
- }
- else {
- ClassNode* child = static_cast<ClassNode*>(*stack.top().begin());
- writeStartTag(DT_li);
- generateFullName(child, relative);
- writeEndTag(); // </li>
- stack.top().erase(stack.top().begin());
-
- NodeMap newTop;
- foreach (const RelatedClass &d, child->derivedClasses()) {
- if (d.node_ && d.access_ != Node::Private && !d.node_->doc().isEmpty())
- newTop.insert(d.node_->name(), d.node_);
- }
- if (!newTop.isEmpty()) {
- stack.push(newTop);
- writeStartTag(DT_li);
- writeStartTag(DT_ul);
- }
- }
- }
-}
-
-/*!
- Output an annotated list of the nodes in \a nodeMap.
- A two-column table is output.
- */
-void DitaXmlGenerator::generateAnnotatedList(const Node* relative,
- CodeMarker* marker,
- const NodeMap& nodeMap)
-{
- if (nodeMap.isEmpty())
- return;
- NodeList nl;
- NodeMap::const_iterator i = nodeMap.begin();
- while (i != nodeMap.end()) {
- nl.append(i.value());
- ++i;
- }
- generateAnnotatedList(relative, marker, nl);
-}
-
-/*!
- Write XML for the contents of the \a nodes to the current
- XML stream.
- */
-void DitaXmlGenerator::generateAnnotatedList(const Node* relative,
- CodeMarker* marker,
- const NodeList& nodes)
-{
- if (nodes.isEmpty())
- return;
- bool allInternal = true;
- foreach (const Node* node, nodes) {
- if (!node->isInternal() && node->status() != Node::Obsolete) {
- allInternal = false;
- }
- }
- if (allInternal)
- return;
-
- writeStartTag(DT_table);
- xmlWriter().writeAttribute("outputclass","annotated");
- writeStartTag(DT_tgroup);
- xmlWriter().writeAttribute("cols","2");
- writeStartTag(DT_tbody);
-
- foreach (const Node* node, nodes) {
- if (node->isInternal() || node->status() == Node::Obsolete)
- continue;
-
- writeStartTag(DT_row);
- writeStartTag(DT_entry);
- writeStartTag(DT_p);
- generateFullName(node, relative);
- writeEndTag(); // </p>
- writeEndTag(); // <entry>
-
- if (!node->isDocNode()) {
- Text brief = node->doc().trimmedBriefText(node->name());
- if (!brief.isEmpty()) {
- writeStartTag(DT_entry);
- writeStartTag(DT_p);
- generateText(brief, node, marker);
- writeEndTag(); // </p>
- writeEndTag(); // <entry>
- }
- else if (!node->reconstitutedBrief().isEmpty()) {
- writeStartTag(DT_entry);
- writeStartTag(DT_p);
- writeCharacters(node->reconstitutedBrief());
- writeEndTag(); // </p>
- writeEndTag(); // <entry>
- }
- }
- else {
- writeStartTag(DT_entry);
- writeStartTag(DT_p);
- if (!node->reconstitutedBrief().isEmpty()) {
- writeCharacters(node->reconstitutedBrief());
- }
- else
- writeCharacters(protectEnc(node->doc().briefText().toString()));
- writeEndTag(); // </p>
- writeEndTag(); // <entry>
- }
- writeEndTag(); // </row>
- }
- writeEndTag(); // </tbody>
- writeEndTag(); // </tgroup>
- writeEndTag(); // </table>
-}
-
-/*!
- 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 DitaXmlGenerator::generateCompactList(ListType , // currently not needed for DITA
- const Node* relative,
- const NodeMap& classMap,
- bool includeAlphabet,
- QString commonPrefix)
-{
- const int NumParagraphs = 37; // '0' to '9', 'A' to 'Z', '_'
-
- if (classMap.isEmpty())
- return;
-
- /*
- If commonPrefix is not empty, then the caller knows what
- the common prefix is and has passed it in, so just use that
- one. But if the commonPrefix is empty (it normally is), then
- compute a common prefix using this simple algorithm. Note we
- assume the prefix length is 1, i.e. we will have a single
- character as the common prefix.
- */
- int commonPrefixLen = commonPrefix.length();
- if (commonPrefixLen == 0) {
- QVector<int> count(26);
- for (int i=0; i<26; ++i)
- count[i] = 0;
-
- NodeMap::const_iterator iter = classMap.constBegin();
- while (iter != classMap.constEnd()) {
- if (!iter.key().contains("::")) {
- QChar c = iter.key()[0];
- if ((c >= 'A') && (c <= 'Z')) {
- int idx = c.unicode() - QChar('A').unicode();
- ++count[idx];
- }
- }
- ++iter;
- }
- int highest = 0;
- int idx = -1;
- for (int i=0; i<26; ++i) {
- if (count[i] > highest) {
- highest = count[i];
- idx = i;
- }
- }
- idx += QChar('A').unicode();
- QChar common(idx);
- commonPrefix = common;
- commonPrefixLen = 1;
- }
-
- /*
- 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 NodeMap.
- */
- NodeMap paragraph[NumParagraphs+1];
- QString paragraphName[NumParagraphs+1];
- QSet<char> usedParagraphNames;
-
- NodeMap::ConstIterator c = classMap.constBegin();
- while (c != classMap.constEnd()) {
- 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(idx).toLower();
- else
- key = pieces.last().toLower();
-
- int paragraphNr = NumParagraphs - 1;
-
- if (key[0].digitValue() != -1) {
- paragraphNr = key[0].digitValue();
- }
- else if (key[0] >= QLatin1Char('a') && key[0] <= QLatin1Char('z')) {
- paragraphNr = 10 + key[0].unicode() - 'a';
- }
-
- paragraphName[paragraphNr] = key[0].toUpper();
- usedParagraphNames.insert(key[0].toLower().cell());
- paragraph[paragraphNr].insert(key, c.value());
- ++c;
- }
-
- /*
- Each paragraph j has a size: paragraph[j].count(). In the
- discussion, we will assume paragraphs 0 to 5 will have sizes
- 3, 1, 4, 1, 5, 9.
-
- We now want to compute the paragraph offset. Paragraphs 0 to 6
- start at offsets 0, 3, 4, 8, 9, 14, 23.
- */
- int paragraphOffset[NumParagraphs + 1]; // 37 + 1
- paragraphOffset[0] = 0;
- for (int i=0; i<NumParagraphs; i++) // i = 0..36
- paragraphOffset[i+1] = paragraphOffset[i] + paragraph[i].count();
-
- int curParNr = 0;
- int curParOffset = 0;
- QMap<QChar,QString> cmap;
-
- /*
- Output the alphabet as a row of links.
- */
- if (includeAlphabet) {
- writeStartTag(DT_p);
- xmlWriter().writeAttribute("outputclass","alphabet");
- for (int i = 0; i < 26; i++) {
- QChar ch('a' + i);
- if (usedParagraphNames.contains(char('a' + i))) {
- writeStartTag(DT_xref);
- // formathtml
- QString guid = lookupGuid(outFileName(),QString(ch));
- QString attr = outFileName() + QString("#%1").arg(guid);
- xmlWriter().writeAttribute("href", attr);
- xmlWriter().writeCharacters(QString(ch.toUpper()));
- writeEndTag(); // </xref>
- }
- }
- writeEndTag(); // </p>
- }
-
- /*
- Output a <p> element to contain all the <dl> elements.
- */
- writeStartTag(DT_p);
- xmlWriter().writeAttribute("outputclass","compactlist");
-
- for (int i=0; i<classMap.count()-1; i++) {
- while ((curParNr < NumParagraphs) &&
- (curParOffset == paragraph[curParNr].count())) {
- ++curParNr;
- curParOffset = 0;
- }
-
- /*
- Starting a new paragraph means starting a new <dl>.
- */
- if (curParOffset == 0) {
- if (i > 0) {
- writeEndTag(); // </dlentry>
- writeEndTag(); // </dl>
- }
- writeStartTag(DT_dl);
- writeStartTag(DT_dlentry);
- writeStartTag(DT_dt);
- if (includeAlphabet) {
- QChar c = paragraphName[curParNr][0].toLower();
- writeGuidAttribute(QString(c));
- }
- xmlWriter().writeAttribute("outputclass","sublist-header");
- xmlWriter().writeCharacters(paragraphName[curParNr]);
- writeEndTag(); // </dt>
- }
-
- /*
- Output a <dd> for the current offset in the current paragraph.
- */
- writeStartTag(DT_dd);
- if ((curParNr < NumParagraphs) &&
- !paragraphName[curParNr].isEmpty()) {
- NodeMap::Iterator it;
- it = paragraph[curParNr].begin();
- for (int i=0; i<curParOffset; i++)
- ++it;
-
- /*
- Previously, we used generateFullName() for this, but we
- require some special formatting.
- */
- writeStartTag(DT_xref);
- // formathtml
- writeHrefAttribute(linkForNode(it.value(), relative));
-
- QStringList pieces;
- if (it.value()->isQmlType())
- pieces << it.value()->name();
- else
- pieces = it.value()->fullName(relative).split("::");
- xmlWriter().writeCharacters(protectEnc(pieces.last()));
- writeEndTag(); // </xref>
- if (pieces.size() > 1) {
- xmlWriter().writeCharacters(" (");
- generateFullName(it.value()->parent(),relative);
- xmlWriter().writeCharacters(")");
- }
- }
- writeEndTag(); // </dd>
- curParOffset++;
- }
- writeEndTag(); // </dlentry>
- writeEndTag(); // </dl>
- writeEndTag(); // </p>
-}
-
-/*!
- Write XML for a function index to the current XML stream.
- */
-void DitaXmlGenerator::generateFunctionIndex(const Node* relative)
-{
- writeStartTag(DT_p);
- xmlWriter().writeAttribute("outputclass","alphabet");
- for (int i = 0; i < 26; i++) {
- QChar ch('a' + i);
- writeStartTag(DT_xref);
- // formathtml
- QString guid = lookupGuid(outFileName(),QString(ch));
- QString attr = outFileName() + QString("#%1").arg(guid);
- xmlWriter().writeAttribute("href", attr);
- xmlWriter().writeCharacters(QString(ch.toUpper()));
- writeEndTag(); // </xref>
-
- }
- writeEndTag(); // </p>
-
- char nextLetter = 'a';
- char currentLetter;
-
- writeStartTag(DT_ul);
- NodeMapMap& funcIndex = qdb_->getFunctionIndex();
- NodeMapMap::ConstIterator f = funcIndex.constBegin();
- while (f != funcIndex.constEnd()) {
- writeStartTag(DT_li);
- currentLetter = f.key()[0].unicode();
- while (islower(currentLetter) && currentLetter >= nextLetter) {
- writeStartTag(DT_p);
- writeGuidAttribute(QString(nextLetter));
- xmlWriter().writeAttribute("outputclass","target");
- xmlWriter().writeCharacters(QString(nextLetter));
- writeEndTag(); // </p>
- nextLetter++;
- }
- xmlWriter().writeCharacters(protectEnc(f.key()));
- xmlWriter().writeCharacters(":");
-
- NodeMap::ConstIterator s = (*f).constBegin();
- while (s != (*f).constEnd()) {
- generateFullName((*s)->parent(), relative, *s);
- ++s;
- }
- writeEndTag(); // </li>
- ++f;
- }
- writeEndTag(); // </ul>
-}
-
-/*!
- Write the legalese texts as XML to the current XML stream.
- */
-void DitaXmlGenerator::generateLegaleseList(const Node* relative, CodeMarker* marker)
-{
- TextToNodeMap& legaleseTexts = qdb_->getLegaleseTexts();
- TextToNodeMap::ConstIterator it = legaleseTexts.constBegin();
- while (it != legaleseTexts.constEnd()) {
- Text text = it.key();
- generateText(text, relative, marker);
- writeStartTag(DT_ul);
- do {
- writeStartTag(DT_li);
- generateFullName(it.value(), relative);
- writeEndTag(); // </li>
- ++it;
- } while (it != legaleseTexts.constEnd() && it.key() == text);
- writeEndTag(); //</ul>
- }
-}
-
-/*!
- Generate the text for the QML item described by \a node
- and write it to the current XML stream.
- */
-void DitaXmlGenerator::generateQmlItem(const Node* node,
- const Node* relative,
- CodeMarker* marker,
- bool summary)
-{
- QString marked = marker->markedUpQmlItem(node,summary);
- QRegExp tag("(<[^@>]*>)");
- if (marked.indexOf(tag) != -1) {
- QString tmp = protectEnc(marked.mid(tag.pos(1), tag.cap(1).length()));
- marked.replace(tag.pos(1), tag.cap(1).length(), tmp);
- }
- marked.replace(QRegExp("<@param>([a-z]+)_([1-9n])</@param>"),
- "<i>\\1<sub>\\2</sub></i>");
- if (summary) {
- marked.remove("<@type>");
- marked.remove("</@type>");
- }
- writeText(marked, relative);
-}
-
-/*!
- Write the XML for the overview list to the current XML stream.
- */
-void DitaXmlGenerator::generateOverviewList(const Node* relative)
-{
- CNMap groups;
- CNMap modules;
- CNMap qmlModules;
- QRegExp singleDigit("\\b([0-9])\\b");
-
- qdb_->mergeCollections(Node::Group, groups, relative);
- qdb_->mergeCollections(Node::Module, modules, relative);
- qdb_->mergeCollections(Node::QmlModule, qmlModules, relative);
-
- QStringList keys = groups.uniqueKeys();
- foreach (QString key, keys) {
- GroupNode* gn = static_cast<GroupNode*>(groups.value(key));
- if (gn) {
- writeStartTag(DT_p);
- xmlWriter().writeAttribute("outputclass","h3");
- writeStartTag(DT_xref);
- // formathtml
- xmlWriter().writeAttribute("href",linkForNode(gn, relative));
- writeCharacters(protectEnc(gn->fullTitle()));
- writeEndTag(); // </xref>
- writeEndTag(); // </p>
-
- if (gn->members().isEmpty())
- continue;
-
- NodeMap nm;
- foreach (Node* member, gn->members()) {
- if (member->isInternal() || member->isExample() || member->isExternalPage() ||
- member->isObsolete())
- continue;
- // not interested either in individual (Qt Designer etc.) manual chapters
- if (member->links().contains(Node::ContentsLink))
- continue;
- QString sortKey = member->fullTitle().toLower();
- if (sortKey.startsWith("the "))
- sortKey.remove(0, 4);
- sortKey.replace(singleDigit, "0\\1");
- nm.insert(sortKey, member);
- }
-
- writeStartTag(DT_ul);
- QStringList titles = nm.keys();
- foreach (QString t, titles) {
- Node* member = nm.value(t);
- QString title = member->fullTitle();
- if (title.startsWith("The "))
- title.remove(0, 4);
- writeStartTag(DT_li);
- writeStartTag(DT_xref);
- // formathtml
- xmlWriter().writeAttribute("href",linkForNode(member, relative));
- writeCharacters(protectEnc(title));
- writeEndTag(); // </xref>
- writeEndTag(); // </li>
- }
- writeEndTag(); // </ul>
- }
- }
-}
-
-/*!
- Write the XML for a standard section of a page, e.g.
- "Public Functions" or "Protected Slots." The section
- is written too the current XML stream as a table.
- */
-void DitaXmlGenerator::generateSection(const NodeList& nl,
- const Node* relative,
- CodeMarker* marker,
- CodeMarker::SynopsisStyle style)
-{
- if (!nl.isEmpty()) {
- writeStartTag(DT_ul);
- NodeList::ConstIterator m = nl.constBegin();
- while (m != nl.constEnd()) {
- if ((*m)->access() != Node::Private) {
- writeStartTag(DT_li);
- QString marked = getMarkedUpSynopsis(*m, relative, marker, style);
- writeText(marked, relative);
- writeEndTag(); // </li>
- }
- ++m;
- }
- writeEndTag(); // </ul>
- }
-}
-
-/*!
- Writes the "inherited from" list to the current XML stream.
- */
-void DitaXmlGenerator::generateSectionInheritedList(const Section& section, const Node* relative)
-{
- if (section.inherited.isEmpty())
- return;
- writeStartTag(DT_ul);
- QList<QPair<InnerNode*,int> >::ConstIterator p = section.inherited.constBegin();
- while (p != section.inherited.constEnd()) {
- writeStartTag(DT_li);
- QString text;
- text.setNum((*p).second);
- text += QLatin1Char(' ');
- if ((*p).second == 1)
- text += section.singularMember;
- else
- text += section.pluralMember;
- text += " inherited from ";
- writeCharacters(text);
- writeStartTag(DT_xref);
- // formathtml
- // zzz
- text = fileName((*p).first) + QLatin1Char('#');
- text += DitaXmlGenerator::cleanRef(section.name.toLower());
- xmlWriter().writeAttribute("href",text);
- text = protectEnc((*p).first->plainFullName(relative));
- writeCharacters(text);
- writeEndTag(); // </xref>
- writeEndTag(); // </li>
- ++p;
- }
- writeEndTag(); // </ul>
-}
-
-/*!
- Get the synopsis from the \a node using the \a relative
- node if needed, and mark up the synopsis using \a marker.
- Use the style to decide which kind of sysnopsis to build,
- normally \c Summary or \c Detailed. Return the marked up
- string.
- */
-QString DitaXmlGenerator::getMarkedUpSynopsis(const Node* node,
- const Node* relative,
- CodeMarker* marker,
- CodeMarker::SynopsisStyle style)
-{
- QString marked = marker->markedUpSynopsis(node, relative, style);
- QRegExp tag("(<[^@>]*>)");
- if (marked.indexOf(tag) != -1) {
- QString tmp = protectEnc(marked.mid(tag.pos(1), tag.cap(1).length()));
- marked.replace(tag.pos(1), tag.cap(1).length(), tmp);
- }
- marked.replace(QRegExp("<@param>([a-z]+)_([1-9n])</@param>"),
- "<i> \\1<sub>\\2</sub></i>");
- if (style == CodeMarker::Summary) {
- marked.remove("<@name>"); // was "<b>"
- marked.remove("</@name>"); // was "</b>"
- }
-
- if (style == CodeMarker::Subpage) {
- QRegExp extraRegExp("<@extra>.*</@extra>");
- extraRegExp.setMinimal(true);
- marked.remove(extraRegExp);
- }
-
- if (style != CodeMarker::Detailed) {
- marked.remove("<@type>");
- marked.remove("</@type>");
- }
- return marked;
-}
-
-/*!
- Renamed from highlightedCode() in the html generator. Gets the text
- from \a markedCode , and then the text is written to the current XML
- stream.
- */
-void DitaXmlGenerator::writeText(const QString& markedCode, const Node* relative)
-{
- QString src = markedCode;
- QString text;
- QStringRef arg;
- QStringRef par1;
-
- const QChar charLangle = '<';
- const QChar charAt = '@';
-
- /*
- First strip out all the extraneous markup. The table
- below contains the markup we want to keep. Everything
- else that begins with "<@" or "</@" is stripped out.
- */
- static const QString spanTags[] = {
- "<@link ", "<@link ",
- "<@type>", "<@type>",
- "<@headerfile>", "<@headerfile>",
- "<@func>", "<@func>",
- "<@func ", "<@func ",
- "<@param>", "<@param>",
- "<@extra>", "<@extra>",
- "</@link>", "</@link>",
- "</@type>", "</@type>",
- "</@headerfile>", "</@headerfile>",
- "</@func>", "</@func>",
- "</@param>", "</@param>",
- "</@extra>", "</@extra>"
- };
- for (int i = 0, n = src.size(); i < n;) {
- if (src.at(i) == charLangle) {
- bool handled = false;
- for (int k = 0; k != 13; ++k) {
- const QString & tag = spanTags[2 * k];
- if (tag == QStringRef(&src, i, tag.length())) {
- text += spanTags[2 * k + 1];
- i += tag.length();
- handled = true;
- break;
- }
- }
- if (!handled) {
- ++i;
- if (src.at(i) == charAt ||
- (src.at(i) == QLatin1Char('/') && src.at(i + 1) == charAt)) {
- // drop 'our' unknown tags (the ones still containing '@')
- while (i < n && src.at(i) != QLatin1Char('>'))
- ++i;
- ++i;
- }
- else {
- // retain all others
- text += charLangle;
- }
- }
- }
- else {
- text += src.at(i);
- ++i;
- }
- }
-
- // replace all <@link> tags: "(<@link node=\"([^\"]+)\">).*(</@link>)"
- // replace all "(<@(type|headerfile|func)(?: +[^>]*)?>)(.*)(</@\\2>)" tags
- src = text;
- text = QString();
- static const QString markTags[] = {
- // 0 1 2 3 4 5
- "link", "type", "headerfile", "func", "param", "extra"
- };
-
- for (int i = 0, n = src.size(); i < n;) {
- if (src.at(i) == charLangle && src.at(i + 1) == charAt) {
- i += 2;
- for (int k = 0; k != 6; ++k) {
- if (parseArg(src, markTags[k], &i, n, &arg, &par1)) {
- const Node* n = 0;
- switch (k) {
- case 0: // <@link>
- if (!text.isEmpty()) {
- writeCharacters(text);
- text.clear();
- }
- n = CodeMarker::nodeForString(par1.toString());
- addLink(linkForNode(n, relative), arg);
- break;
- case 4: // <@param>
- if (!text.isEmpty()) {
- writeCharacters(text);
- text.clear();
- }
- writeStartTag(DT_i);
- //writeCharacters(" " + arg.toString());
- writeCharacters(arg.toString());
- writeEndTag(); // </i>
- break;
- case 5: // <@extra>
- if (!text.isEmpty()) {
- writeCharacters(text);
- text.clear();
- }
- writeStartTag(DT_tt);
- writeCharacters(arg.toString());
- writeEndTag(); // </tt>
- break;
- case 3:
- if (!text.isEmpty()) {
- writeCharacters(text);
- text.clear();
- }
- par1 = QStringRef();
- n = qdb_->findFunctionNode(arg.toString(), relative, Node::DontCare);
- addLink(linkForNode(n, relative), arg);
- break;
- case 1:
- case 2:
- default:
- if (!text.isEmpty()) {
- writeCharacters(text);
- text.clear();
- }
- par1 = QStringRef();
- n = qdb_->findTypeNode(arg.toString(), relative);
- if (n && n->isQmlBasicType()) {
- if (relative && relative->isQmlType())
- addLink(linkForNode(n, relative), arg);
- else
- writeCharacters(arg.toString());
- }
- else
- addLink(linkForNode(n, relative), arg); // (zzz) Is this correct for all cases?
- break;
- } // switch
- break;
- }
- }
- }
- else
- text += src.at(i++);
- }
- if (!text.isEmpty())
- writeCharacters(text);
-}
-
-void DitaXmlGenerator::generateLink(const Atom* atom, CodeMarker* marker)
-{
- static QRegExp camelCase("[A-Z][A-Z][a-z]|[a-z][A-Z0-9]|_");
-
- if (funcLeftParen.indexIn(atom->string()) != -1 && marker->recognizeLanguage("Cpp")) {
- // hack for C++: move () outside of link
- int k = funcLeftParen.pos(1);
- writeCharacters(protectEnc(atom->string().left(k)));
- if (link_.isEmpty()) {
- if (showBrokenLinks)
- writeEndTag(); // </i>
- }
- else
- writeEndTag(); // </xref>
- inLink_ = false;
- writeCharacters(protectEnc(atom->string().mid(k)));
- }
- else if (marker->recognizeLanguage("Java")) {
- // hack for Java: remove () and use <tt> when appropriate
- bool func = atom->string().endsWith("()");
- bool tt = (func || atom->string().contains(camelCase));
- if (tt)
- writeStartTag(DT_tt);
- if (func)
- writeCharacters(protectEnc(atom->string().left(atom->string().length() - 2)));
- else
- writeCharacters(protectEnc(atom->string()));
- writeEndTag(); // </tt>
- }
- else
- writeCharacters(protectEnc(atom->string()));
-}
-
-QString DitaXmlGenerator::cleanRef(const QString& ref)
-{
- QString clean;
-
- if (ref.isEmpty())
- return clean;
-
- clean.reserve(ref.size() + 20);
- const QChar c = ref[0];
- const uint u = c.unicode();
-
- if ((u >= 'a' && u <= 'z') ||
- (u >= 'A' && u <= 'Z') ||
- (u >= '0' && u <= '9')) {
- clean += c;
- }
- else if (u == '~') {
- clean += "dtor.";
- }
- else if (u == '_') {
- clean += "underscore.";
- }
- else {
- clean += QLatin1Char('A');
- }
-
- for (int i = 1; i < (int) ref.length(); i++) {
- const QChar c = ref[i];
- const uint u = c.unicode();
- if ((u >= 'a' && u <= 'z') ||
- (u >= 'A' && u <= 'Z') ||
- (u >= '0' && u <= '9') || u == '-' ||
- u == '_' || u == ':' || u == '.') {
- clean += c;
- }
- else if (c.isSpace()) {
- clean += QLatin1Char('-');
- }
- else if (u == '!') {
- clean += "-not";
- }
- else if (u == '&') {
- clean += "-and";
- }
- else if (u == '<') {
- clean += "-lt";
- }
- else if (u == '=') {
- clean += "-eq";
- }
- else if (u == '>') {
- clean += "-gt";
- }
- else if (u == '#') {
- clean += QLatin1Char('#');
- }
- else {
- clean += QLatin1Char('-');
- clean += QString::number((int)u, 16);
- }
- }
- return clean;
-}
-
-QString DitaXmlGenerator::registerRef(const QString& ref)
-{
- QString clean = DitaXmlGenerator::cleanRef(ref);
-
- for (;;) {
- QString& prevRef = refMap[clean.toLower()];
- if (prevRef.isEmpty()) {
- prevRef = ref;
- break;
- }
- else if (prevRef == ref)
- break;
- clean += QLatin1Char('x');
- }
- return clean;
-}
-
-/*!
- Calls protect() with the \a string. Returns the result.
- */
-QString DitaXmlGenerator::protectEnc(const QString& string)
-{
-#ifndef QT_NO_TEXTCODEC
- return protect(string, outputEncoding);
-#else
- return protect(string);
-#endif
-}
-
-QString DitaXmlGenerator::protect(const QString& string, const QString& ) //outputEncoding)
-{
-#define APPEND(x) \
- if (xml.isEmpty()) { \
- xml = string; \
- xml.truncate(i); \
-} \
- xml += (x);
-
- QString xml;
- int n = string.length();
-
- for (int i = 0; i < n; ++i) {
- QChar ch = string.at(i);
-
- if (ch == QLatin1Char('&')) {
- APPEND("&amp;");
- }
- else if (ch == QLatin1Char('<')) {
- APPEND("&lt;");
- }
- else if (ch == QLatin1Char('>')) {
- APPEND("&gt;");
- }
- else if (ch == QLatin1Char('"')) {
- APPEND("&quot;");
- }
- else {
- if (!xml.isEmpty())
- xml += ch;
- }
- }
-
- if (!xml.isEmpty())
- return xml;
- return string;
-
-#undef APPEND
-}
-
-/*!
- Constructs a file name appropriate for the \a node
- and returns the file name.
- */
-QString DitaXmlGenerator::fileBase(const Node* node) const
-{
- QString result;
- result = Generator::fileBase(node);
- return result;
-}
-
-QString DitaXmlGenerator::guidForNode(const Node* node)
-{
- switch (node->type()) {
- case Node::Namespace:
- case Node::Class:
- default:
- break;
- case Node::Enum:
- return node->guid();
- case Node::Typedef:
- {
- const TypedefNode* tdn = static_cast<const TypedefNode*>(node);
- if (tdn->associatedEnum())
- return guidForNode(tdn->associatedEnum());
- }
- return node->guid();
- case Node::Function:
- {
- const FunctionNode* fn = static_cast<const FunctionNode*>(node);
- if (fn->associatedProperty()) {
- return guidForNode(fn->associatedProperty());
- }
- else {
- QString ref = fn->name();
- if (fn->overloadNumber() != 1) {
- ref += QLatin1Char('-') + QString::number(fn->overloadNumber());
- }
- }
- return fn->guid();
- }
- case Node::Document:
- break;
- case Node::QmlPropertyGroup:
- case Node::QmlProperty:
- case Node::Property:
- return node->guid();
- case Node::QmlSignal:
- return node->guid();
- case Node::QmlSignalHandler:
- return node->guid();
- case Node::QmlMethod:
- return node->guid();
- case Node::Variable:
- return node->guid();
- }
- return QString();
-}
-
-/*!
- Constructs a file name appropriate for the \a node and returns
- it. If the \a node is not a not an external page, an image, or
- a ditamap, call fileName() in the base class, Generator.
- */
-QString DitaXmlGenerator::fileName(const Node* node)
-{
- if (node->isDocNode()) {
- if (static_cast<const DocNode*>(node)->pageType() == Node::DitaMapPage)
- return node->name();
- if (static_cast<const DocNode*>(node)->subType() == Node::ExternalPage)
- return node->name();
- if (static_cast<const DocNode*>(node)->subType() == Node::Image)
- return node->name();
- }
- return Generator::fileName(node);
-}
-
-/*!
- This function is called for links, i.e. for words that
- are marked with the qdoc link command. For autolinks
- that are not marked with the qdoc link command, qdoc
- calls getAutoLink().
-
- Return the link represented by the \a atom, and set \a node
- to point to the target node for that link. \a relative points
- to the node holding the qdoc comment where the link command
- was found.
- */
-QString DitaXmlGenerator::getLink(const Atom *atom, const Node *relative, const Node** node)
-{
- const QString& t = atom->string();
- if (t.at(0) == QChar('h')) {
- if (t.startsWith("http:") || t.startsWith("https:"))
- return t;
- }
- else if (t.at(0) == QChar('f')) {
- if (t.startsWith("file:") || t.startsWith("ftp:"))
- return t;
- }
- else if (t.at(0) == QChar('m')) {
- if (t.startsWith("mailto:"))
- return t;
- }
-
- QString ref;
-
- *node = qdb_->findNodeForAtom(atom, relative, ref);
- if (!(*node))
- return QString();
-
- QString url = (*node)->url();
- if (!url.isEmpty()) {
- if (ref.isEmpty())
- return url;
- int hashtag = url.lastIndexOf(QChar('#'));
- if (hashtag != -1)
- url.truncate(hashtag);
- return url + "#" + ref;
- }
- /*
- Given that *node is not null, we now cconstruct a link
- to the page that *node represents, and then if we found
- a target on that page, we connect the target to the link
- with '#'.
- */
- QString link = linkForNode(*node, relative);
- if (*node && (*node)->subType() == Node::Image)
- link = "images/used-in-examples/" + link;
- if (!ref.isEmpty()) {
- int hashtag = link.lastIndexOf(QChar('#'));
- if (hashtag != -1)
- link.truncate(hashtag);
- link += QLatin1Char('#') + ref;
- }
- return link;
-}
-
-/*!
- This function is called for autolinks, i.e. for words that
- are not marked with the qdoc link command that qdoc has
- reason to believe should be links. For links marked with
- the qdoc link command, qdoc calls getLink().
-
- Return the link represented by the \a atom, and set \a node
- to point to the target node for that link. \a relative points
- to the node holding the qdoc comment where the link command
- was found.
- */
-QString DitaXmlGenerator::getAutoLink(const Atom *atom, const Node *relative, const Node** node)
-{
- QString ref;
- QString link;
-
- *node = qdb_->findNodeForAtom(atom, relative, ref);
- if (!(*node))
- return QString();
-
- QString url = (*node)->url();
- if (!url.isEmpty()) {
- if (ref.isEmpty())
- return url;
- int hashtag = url.lastIndexOf(QChar('#'));
- if (hashtag != -1)
- url.truncate(hashtag);
- return url + "#" + ref;
- }
-
- link = linkForNode(*node, relative);
- if (!ref.isEmpty())
- link += QLatin1Char('#') + ref;
- return link;
-}
-
-
-QString DitaXmlGenerator::linkForNode(const Node* node, const Node* relative)
-{
- if (node == 0 || node == relative)
- return QString();
- if (!node->url().isEmpty())
- return node->url();
- if (fileBase(node).isEmpty())
- return QString();
- if (node->access() == Node::Private)
- return QString();
-
- QString fn = fileName(node);
- if (node && relative && node->parent() != relative) {
- if (node->parent()->isQmlType() && relative->isQmlType()) {
- if (node->parent()->isAbstract()) {
- /*
- This is a bit of a hack. What we discover with
- the three 'if' statements immediately above,
- is that node's parent is marked \qmlabstract
- but the link appears in a qdoc comment for a
- subclass of the node's parent. This means the
- link should refer to the file for the relative
- node, not the file for node.
- */
- fn = fileName(relative);
- }
- }
- }
- QString link = fn;
-
- if (!node->isInnerNode() || node->type() == Node::QmlPropertyGroup) {
- QString guid = guidForNode(node);
- if (relative && fn == fileName(relative) && guid == guidForNode(relative)) {
- return QString();
- }
- link += QLatin1Char('#');
- link += guid;
- }
- /*
- If the output is going to subdirectories, then if the
- two nodes will be output to different directories, then
- the link must go up to the parent directory and then
- back down into the other subdirectory.
- */
- if (node && relative && (node != relative)) {
- if (useOutputSubdirs() && node->outputSubdirectory() != relative->outputSubdirectory())
- link.prepend(QString("../" + node->outputSubdirectory() + QLatin1Char('/')));
- }
- return link;
-}
-
-void DitaXmlGenerator::generateFullName(const Node* apparentNode,
- const Node* relative,
- const Node* actualNode)
-{
- if (actualNode == 0)
- actualNode = apparentNode;
- writeStartTag(DT_xref);
- // formathtml
- QString href = linkForNode(actualNode, relative);
- writeHrefAttribute(href);
- writeCharacters(protectEnc(apparentNode->fullName(relative)));
- writeEndTag(); // </xref>
-}
-
-/*!
- We're writing an attribute that indicates that the text
- data is a heading, hence, h1, h2, h3... etc, and we must
- decide which number to use.
- */
-int DitaXmlGenerator::hOffset(const Node* node)
-{
- switch (node->type()) {
- case Node::Namespace:
- case Node::Class:
- return 2;
- case Node::QmlType:
- case Node::Document:
- return 1;
- case Node::Enum:
- case Node::Typedef:
- case Node::Function:
- case Node::Property:
- default:
- return 3;
- }
-}
-
-bool DitaXmlGenerator::isThreeColumnEnumValueTable(const Atom* atom)
-{
- while (atom != 0 && !(atom->type() == Atom::ListRight && atom->string() == ATOM_LIST_VALUE)) {
- if (atom->type() == Atom::ListItemLeft && !matchAhead(atom, Atom::ListItemRight))
- return true;
- atom = atom->next();
- }
- return false;
-}
-
-const QPair<QString,QString> DitaXmlGenerator::anchorForNode(const Node* node)
-{
- QPair<QString,QString> anchorPair;
- anchorPair.first = Generator::fileName(node);
- if (node->type() == Node::Document) {
- const DocNode *docNode = static_cast<const DocNode*>(node);
- anchorPair.second = docNode->title();
- }
-
- return anchorPair;
-}
-
-void DitaXmlGenerator::generateStatus(const Node* node, CodeMarker* marker)
-{
- Text text;
-
- switch (node->status()) {
- case Node::Obsolete:
- if (node->isInnerNode())
- Generator::generateStatus(node, marker);
- break;
- case Node::Compat:
- // Porting to Qt 4 no longer supported
- break;
- default:
- Generator::generateStatus(node, marker);
- }
-}
-
-void DitaXmlGenerator::beginLink(const QString& link)
-{
- link_ = link;
- if (link_.isEmpty())
- return;
- writeStartTag(DT_xref);
- // formathtml
- writeHrefAttribute(link_);
- inLink_ = true;
-}
-
-void DitaXmlGenerator::endLink()
-{
- if (inLink_) {
- if (link_.isEmpty()) {
- if (showBrokenLinks)
- writeEndTag(); // </i>
- }
- else {
- if (inObsoleteLink) {
- writeStartTag(DT_sup);
- xmlWriter().writeCharacters("(obsolete)");
- writeEndTag(); // </sup>
- }
- writeEndTag(); // </xref>
- }
- }
- inLink_ = false;
- inObsoleteLink = false;
-}
-
-/*!
- Generates the summary for the \a section. Only used for
- sections of QML element documentation.
-
- Currently handles only the QML property group.
- */
-void DitaXmlGenerator::generateQmlSummary(const Section& section,
- const Node* relative,
- CodeMarker* marker)
-{
- if (!section.members.isEmpty()) {
- writeStartTag(DT_ul);
- NodeList::ConstIterator m;
- m = section.members.constBegin();
- while (m != section.members.constEnd()) {
- writeStartTag(DT_li);
- generateQmlItem(*m,relative,marker,true);
- writeEndTag(); // </li>
- ++m;
- }
- writeEndTag(); // </ul>
- }
-}
-
-/*!
- Writes the QML property \a qpn to the current DITA XML file.
- Assumes that the correct start tag has already been written,
- but nothing has been written inside that tag. This function
- begins by writing the GUID id attribute for the property.
- */
-void DitaXmlGenerator::startQmlProperty(QmlPropertyNode* qpn,
- const InnerNode* relative,
- CodeMarker* marker)
-{
- writeStartTag(DT_qmlProperty);
- writeGuidAttribute((Node*)qpn);
- writeStartTag(DT_apiName);
- writeCharacters(qpn->name());
- writeEndTag(); // </apiName>
- generateBrief(qpn, marker); // <shortdesc>
- writeStartTag(DT_qmlPropertyDetail);
- writeStartTag(DT_qmlPropertyDef);
- if (!qpn->isReadOnlySet())
- qpn->setReadOnly(!qpn->isWritable());
- if (qpn->isReadOnly()) {
- writeStartTag(DT_qmlQualifier);
- xmlWriter().writeAttribute("name","read-only");
- xmlWriter().writeAttribute("value","read-only");
- writeEndTag(); // </qmlQualifier>
- }
- if (qpn->isDefault()) {
- writeStartTag(DT_qmlQualifier);
- xmlWriter().writeAttribute("name","default");
- xmlWriter().writeAttribute("value","default");
- writeEndTag(); // </qmlQualifier>
- }
- if (qpn->isAttached()) {
- writeStartTag(DT_qmlAttached);
- xmlWriter().writeAttribute("name","attached");
- xmlWriter().writeAttribute("value","yes");
- writeEndTag(); // </qmlAttached>
- }
- writeStartTag(DT_apiData);
- generateQmlItem(qpn, relative, marker, false);
- writeEndTag(); // </apiData>
- writeEndTag(); // </qmlPropertyDef>
-}
-
-/*!
- Outputs the DITA detailed documentation for a section
- on a QML element reference page.
- */
-void DitaXmlGenerator::generateDetailedQmlMember(Node* node,
- const InnerNode* relative,
- CodeMarker* marker)
-{
- QString marked;
- QmlPropertyNode* qpn = 0;
-
- if (node->type() == Node::QmlPropertyGroup) {
- const QmlPropertyGroupNode* qpgn = static_cast<const QmlPropertyGroupNode*>(node);
- NodeList::ConstIterator p = qpgn->childNodes().constBegin();
- if (qpgn->childNodes().size() == 1) {
- qpn = static_cast<QmlPropertyNode*>(*p);
- startQmlProperty(qpn,relative,marker);
- writeApiDesc(node, marker, node->title());
- writeEndTag(); // </qmlPropertyDetail>
- writeEndTag(); // </qmlProperty>
- }
- else {
- writeStartTag(DT_qmlPropertyGroup);
- QString id = "id-qml-propertygroup-" + node->name();
- id.replace('.','-');
- xmlWriter().writeAttribute("id",id);
- writeStartTag(DT_apiName);
- //writeCharacters("...");
- writeEndTag(); // </apiName>
- writeStartTag(DT_qmlPropertyGroupDetail);
- writeApiDesc(node, marker, node->title());
- writeEndTag(); // </qmlPropertyGroupDetail>
- while (p != qpgn->childNodes().constEnd()) {
- if ((*p)->type() == Node::QmlProperty) {
- qpn = static_cast<QmlPropertyNode*>(*p);
- startQmlProperty(qpn,relative,marker);
- writeEndTag(); // </qmlPropertyDetail>
- writeEndTag(); // </qmlProperty>
- }
- ++p;
- }
- writeEndTag(); // </qmlPropertyGroup
- }
- }
- else if (node->type() == Node::QmlProperty) {
- qpn = static_cast<QmlPropertyNode*>(node);
- startQmlProperty(qpn,relative,marker);
- writeApiDesc(node, marker, node->title());
- writeEndTag(); // </qmlPropertyDetail>
- writeEndTag(); // </qmlProperty>
- }
- else if (node->type() == Node::QmlSignal)
- writeQmlRef(DT_qmlSignal,node,relative,marker);
- else if (node->type() == Node::QmlSignalHandler)
- writeQmlRef(DT_qmlSignalHandler,node,relative,marker);
- else if (node->type() == Node::QmlMethod)
- writeQmlRef(DT_qmlMethod,node,relative,marker);
-}
-
-/*!
- Outputs the DITA detailed documentation for a section
- on a QML element reference page.
- */
-void DitaXmlGenerator::writeQmlRef(DitaTag tag,
- Node* node,
- const InnerNode* relative,
- CodeMarker* marker)
-{
- writeStartTag(tag);
- Node* n = const_cast<Node*>(node);
- writeGuidAttribute(n);
- writeStartTag(DT_apiName);
- writeCharacters(n->name());
- writeEndTag(); // </apiName>
- writeStartTag((DitaTag)((int)tag+2));
- writeStartTag((DitaTag)((int)tag+1));
- writeStartTag(DT_apiData);
- QString marked = getMarkedUpSynopsis(n, relative, marker, CodeMarker::Detailed);
- writeText(marked, relative);
- writeEndTag(); // </apiData>
- if (node->isAttached()) {
- writeStartTag(DT_qmlAttached);
- xmlWriter().writeAttribute("name","attached");
- xmlWriter().writeAttribute("value","yes");
- writeEndTag(); // </qmlAttached>
- }
- writeEndTag(); // </qmlXxxDef>
- writeApiDesc(node, marker, node->title());
- writeEndTag(); // </qmlXxxDetail>
- writeEndTag(); // tag
-}
-
-/*!
- This generates a <qmlTypeDef> in which the
- QML module name and version number are specified.
- */
-void DitaXmlGenerator::generateQmlModuleDef(QmlClassNode* qcn)
-{
- writeStartTag(DT_qmlImportModule);
- writeStartTag(DT_apiItemName);
- writeCharacters(qcn->qmlModuleName());
- writeEndTag(); // </apiItemName>
- writeStartTag(DT_apiData);
- writeCharacters(qcn->qmlModuleVersion());
- writeEndTag(); // </apiData>
- writeEndTag(); // </qmlImportModule>
-}
-
-/*!
- Output the "Inherits" line for the QML element,
- if there should be one.
- */
-void DitaXmlGenerator::generateQmlInherits(QmlClassNode* qcn, CodeMarker* marker)
-{
- if (!qcn)
- return;
- QmlClassNode* base = qcn->qmlBaseNode();
- while (base && base->isInternal()) {
- base = base->qmlBaseNode();
- }
- if (base) {
- writeStartTag(DT_qmlInherits);
- //writeStartTag(DT_qmlTypeDef);
- //xmlWriter().writeAttribute("outputclass","inherits");
- writeStartTag(DT_apiData);
- Text text;
- text << Atom(Atom::LinkNode,CodeMarker::stringForNode(base));
- text << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK);
- text << Atom(Atom::String, base->name());
- text << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK);
- generateText(text, qcn, marker);
- writeEndTag(); // </apiData>
- writeEndTag(); // </qmlInherits>
- }
-}
-
-/*!
- Output the "Inherit by" list for the QML element,
- if it is inherited by any other elements.
- */
-void DitaXmlGenerator::generateQmlInheritedBy(const QmlClassNode* qcn, CodeMarker* marker)
-{
- if (qcn) {
- NodeList subs;
- QmlClassNode::subclasses(qcn->name(),subs);
- if (!subs.isEmpty()) {
- writeStartTag(DT_qmlInheritedBy);
- //writeStartTag(DT_qmlTypeDef);
- //xmlWriter().writeAttribute("outputclass","inherited-by");
- writeStartTag(DT_apiData);
- Text text;
- appendSortedQmlNames(text,qcn,subs);
- text << Atom::ParaRight;
- generateText(text, qcn, marker);
- writeEndTag(); // </apiData>
- writeEndTag(); // </qmlIneritedBy>
- }
- }
-}
-
-/*!
- Output the "[Xxx instantiates the C++ class QmlGraphicsXxx]"
- line for the QML element, if there should be one.
-
- If there is no class node, or if the class node status
- is set to Node::Internal, do nothing.
- */
-void DitaXmlGenerator::generateQmlInstantiates(QmlClassNode* qcn, CodeMarker* marker)
-{
- ClassNode* cn = qcn->classNode();
- if (cn && (cn->status() != Node::Internal)) {
- writeStartTag(DT_qmlInstantiates);
- //writeStartTag(DT_qmlTypeDef);
- //xmlWriter().writeAttribute("outputclass","instantiates");
- writeStartTag(DT_apiData);
- Text text;
- text << Atom(Atom::LinkNode,CodeMarker::stringForNode(cn));
- text << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK);
- text << Atom(Atom::String, cn->name());
- text << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK);
- generateText(text, qcn, marker);
- writeEndTag(); // </apiData>
- writeEndTag(); // </qmlInstantiates>
- }
-}
-
-/*!
- Generate a <qmlXxxDef> for the "since" version string, if there is one.
- */
-void DitaXmlGenerator::generateQmlSince(const Node* node)
-{
- if (!node->since().isEmpty()) {
- writeStartTag(DT_qmlSince);
- //writeStartTag(DT_qmlTypeDef);
- //xmlWriter().writeAttribute("outputclass","since");
- writeStartTag(DT_apiItemName);
- QStringList pieces = node->since().split(QLatin1Char(' '));
- writeCharacters(pieces[0]);
- writeEndTag(); // </apiItemName>
- writeStartTag(DT_apiData);
- if (pieces.size() > 1)
- writeCharacters(pieces[1]);
- writeEndTag(); // </apiData>
- writeEndTag(); // </qmlSince>
- }
-}
-
-/*!
- Output the "[QmlGraphicsXxx is instantiated by QML Type Xxx]"
- line for the class, if there should be one.
-
- If there is no QML element, or if the class node status
- is set to Node::Internal, do nothing.
- */
-void DitaXmlGenerator::generateInstantiatedBy(ClassNode* cn, CodeMarker* marker)
-{
- if (cn && cn->status() != Node::Internal && cn->qmlElement() != 0) {
- const QmlClassNode* qcn = cn->qmlElement();
- writeStartTag(DT_p);
- xmlWriter().writeAttribute("outputclass","instantiated-by");
- Text text;
- text << "[";
- text << Atom(Atom::LinkNode,CodeMarker::stringForNode(cn));
- text << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK);
- text << Atom(Atom::String, cn->name());
- text << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK);
- text << " is instantiated by QML Type ";
- text << Atom(Atom::LinkNode,CodeMarker::stringForNode(qcn));
- text << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK);
- text << Atom(Atom::String, qcn->name());
- text << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK);
- text << "]";
- generateText(text, cn, marker);
- writeEndTag(); // </p>
- }
-}
-
-/*!
- Return the full qualification of the node \a n, but without
- the name of \a n itself. e.g. A::B::C
- */
-QString DitaXmlGenerator::fullQualification(const Node* n)
-{
- QString fq;
- InnerNode* in = n->parent();
- while (in) {
- if ((in->type() == Node::Class) ||
- (in->type() == Node::Namespace)) {
- if (in->name().isEmpty())
- break;
- if (fq.isEmpty())
- fq = in->name();
- else
- fq = in->name() + "::" + fq;
- }
- else
- break;
- in = in->parent();
- }
- return fq;
-}
-
-/*!
- Outputs the <cxxClassDerivations> element.
- \code
- <cxxClassDerivations>
- <cxxClassDerivation>
- ...
- </cxxClassDerivation>
- ...
- </cxxClassDerivations>
- \endcode
-
- The <cxxClassDerivation> element is:
-
- \code
- <cxxClassDerivation>
- <cxxClassDerivationAccessSpecifier value="public"/>
- <cxxClassBaseClass href="class_base">Base</cxxClassBaseClass>
- </cxxClassDerivation>
- \endcode
- */
-void DitaXmlGenerator::writeDerivations(const ClassNode* cn)
-{
- QList<RelatedClass>::ConstIterator r;
-
- if (!cn->baseClasses().isEmpty()) {
- writeStartTag(DT_cxxClassDerivations);
- r = cn->baseClasses().constBegin();
- while (r != cn->baseClasses().constEnd()) {
- ClassNode* bcn = (*r).node_;
- if (bcn) {
- writeStartTag(DT_cxxClassDerivation);
- writeStartTag(DT_cxxClassDerivationAccessSpecifier);
- xmlWriter().writeAttribute("value",(*r).accessString());
- writeEndTag(); // </cxxClassDerivationAccessSpecifier>
-
- // not included: <cxxClassDerivationVirtual>
-
- writeStartTag(DT_cxxClassBaseClass);
- QString attr = fileName(bcn) + QLatin1Char('#') + bcn->guid();
- xmlWriter().writeAttribute("href",attr);
- writeCharacters(bcn->plainFullName());
- writeEndTag(); // </cxxClassBaseClass>
-
- // not included: <ClassBaseStruct> or <cxxClassBaseUnion>
-
- writeEndTag(); // </cxxClassDerivation>
-
- // not included: <cxxStructDerivation>
- }
- ++r;
- }
- writeEndTag(); // </cxxClassDerivations>
- }
-}
-
-/*!
- Writes a <cxxXXXAPIItemLocation> element, depending on the
- type of the node \a n, which can be a class, function, enum,
- typedef, or property.
- */
-void DitaXmlGenerator::writeLocation(const Node* n)
-{
- DitaTag s1, s2, s3a, s3b;
- s1 = DT_cxxClassAPIItemLocation;
- s2 = DT_cxxClassDeclarationFile;
- s3a = DT_cxxClassDeclarationFileLineStart;
- s3b = DT_cxxClassDeclarationFileLineEnd;
- if (n->type() == Node::Class || n->type() == Node::Namespace) {
- s1 = DT_cxxClassAPIItemLocation;
- s2 = DT_cxxClassDeclarationFile;
- s3a = DT_cxxClassDeclarationFileLineStart;
- s3b = DT_cxxClassDeclarationFileLineEnd;
- }
- else if (n->type() == Node::Function) {
- FunctionNode* fn = const_cast<FunctionNode*>(static_cast<const FunctionNode*>(n));
- if (fn->isMacro()) {
- s1 = DT_cxxDefineAPIItemLocation;
- s2 = DT_cxxDefineDeclarationFile;
- s3a = DT_cxxDefineDeclarationFileLine;
- s3b = DT_NONE;
- }
- else {
- s1 = DT_cxxFunctionAPIItemLocation;
- s2 = DT_cxxFunctionDeclarationFile;
- s3a = DT_cxxFunctionDeclarationFileLine;
- s3b = DT_NONE;
- }
- }
- else if (n->type() == Node::Enum) {
- s1 = DT_cxxEnumerationAPIItemLocation;
- s2 = DT_cxxEnumerationDeclarationFile;
- s3a = DT_cxxEnumerationDeclarationFileLineStart;
- s3b = DT_cxxEnumerationDeclarationFileLineEnd;
- }
- else if (n->type() == Node::Typedef) {
- s1 = DT_cxxTypedefAPIItemLocation;
- s2 = DT_cxxTypedefDeclarationFile;
- s3a = DT_cxxTypedefDeclarationFileLine;
- s3b = DT_NONE;
- }
- else if ((n->type() == Node::Property) ||
- (n->type() == Node::Variable)) {
- s1 = DT_cxxVariableAPIItemLocation;
- s2 = DT_cxxVariableDeclarationFile;
- s3a = DT_cxxVariableDeclarationFileLine;
- s3b = DT_NONE;
- }
- writeStartTag(s1);
- writeStartTag(s2);
- xmlWriter().writeAttribute("name","filePath");
- xmlWriter().writeAttribute("value",n->location().filePath());
- writeEndTag(); // <s2>
- writeStartTag(s3a);
- xmlWriter().writeAttribute("name","lineNumber");
- QString lineNr;
- xmlWriter().writeAttribute("value",lineNr.setNum(n->location().lineNo()));
- writeEndTag(); // </s3a>
- if (s3b != DT_NONE) {
- writeStartTag(s3b);
- xmlWriter().writeAttribute("name","lineNumber");
- QString lineNr;
- xmlWriter().writeAttribute("value",lineNr.setNum(n->location().lineNo()));
- writeEndTag(); // </s3b>
- }
- writeEndTag(); // </cxx<s1>ApiItemLocation>
-}
-
-/*!
- Write the <cxxFunction> elements.
- */
-void DitaXmlGenerator::writeFunctions(const Section& s,
- const InnerNode* parent,
- CodeMarker* marker,
- const QString& attribute)
-{
- NodeList::ConstIterator m = s.members.constBegin();
- while (m != s.members.constEnd()) {
- if ((*m)->type() == Node::Function) {
- FunctionNode* fn = const_cast<FunctionNode*>(static_cast<const FunctionNode*>(*m));
- writeStartTag(DT_cxxFunction);
- xmlWriter().writeAttribute("id",fn->guid());
- if (fn->metaness() == FunctionNode::Signal)
- xmlWriter().writeAttribute("otherprops","signal");
- else if (fn->metaness() == FunctionNode::Slot)
- xmlWriter().writeAttribute("otherprops","slot");
- if (!attribute.isEmpty())
- xmlWriter().writeAttribute("outputclass",attribute);
- writeStartTag(DT_apiName);
- writeCharacters(fn->name());
- writeEndTag(); // </apiName>
- generateBrief(fn,marker);
-
- // not included: <prolog>
-
- writeStartTag(DT_cxxFunctionDetail);
- writeStartTag(DT_cxxFunctionDefinition);
- writeStartTag(DT_cxxFunctionAccessSpecifier);
- xmlWriter().writeAttribute("value",fn->accessString());
- writeEndTag(); // <cxxFunctionAccessSpecifier>
-
- // not included: <cxxFunctionStorageClassSpecifierExtern>
-
- if (fn->isStatic()) {
- writeStartTag(DT_cxxFunctionStorageClassSpecifierStatic);
- xmlWriter().writeAttribute("name","static");
- xmlWriter().writeAttribute("value","static");
- writeEndTag(); // <cxxFunctionStorageClassSpecifierStatic>
- }
-
- // not included: <cxxFunctionStorageClassSpecifierMutable>,
-
- if (fn->isConst()) {
- writeStartTag(DT_cxxFunctionConst);
- xmlWriter().writeAttribute("name","const");
- xmlWriter().writeAttribute("value","const");
- writeEndTag(); // <cxxFunctionConst>
- }
-
- // not included: <cxxFunctionExplicit>
- // <cxxFunctionInline
-
- if (fn->virtualness() != FunctionNode::NonVirtual) {
- writeStartTag(DT_cxxFunctionVirtual);
- xmlWriter().writeAttribute("name","virtual");
- xmlWriter().writeAttribute("value","virtual");
- writeEndTag(); // <cxxFunctionVirtual>
- if (fn->virtualness() == FunctionNode::PureVirtual) {
- writeStartTag(DT_cxxFunctionPureVirtual);
- xmlWriter().writeAttribute("name","pure virtual");
- xmlWriter().writeAttribute("value","pure virtual");
- writeEndTag(); // <cxxFunctionPureVirtual>
- }
- }
-
- if (fn->name() == parent->name()) {
- writeStartTag(DT_cxxFunctionConstructor);
- xmlWriter().writeAttribute("name","constructor");
- xmlWriter().writeAttribute("value","constructor");
- writeEndTag(); // <cxxFunctionConstructor>
- }
- else if (fn->name()[0] == QChar('~')) {
- writeStartTag(DT_cxxFunctionDestructor);
- xmlWriter().writeAttribute("name","destructor");
- xmlWriter().writeAttribute("value","destructor");
- writeEndTag(); // <cxxFunctionDestructor>
- }
- else {
- writeStartTag(DT_cxxFunctionDeclaredType);
- QString src = marker->typified(fn->returnType());
- replaceTypesWithLinks(fn,parent,src);
- writeEndTag(); // <cxxFunctionDeclaredType>
- }
-
- // not included: <cxxFunctionReturnType>
-
- QString fq = fullQualification(fn);
- if (!fq.isEmpty()) {
- writeStartTag(DT_cxxFunctionScopedName);
- writeCharacters(fq);
- writeEndTag(); // <cxxFunctionScopedName>
- }
- writeStartTag(DT_cxxFunctionPrototype);
- writeCharacters(fn->signature(true));
- writeEndTag(); // <cxxFunctionPrototype>
-
- QString fnl = fn->signature(false);
- int idx = fnl.indexOf(' ');
- if (idx < 0)
- idx = 0;
- else
- ++idx;
- fnl = fn->parent()->name() + "::" + fnl.mid(idx);
- writeStartTag(DT_cxxFunctionNameLookup);
- writeCharacters(fnl);
- writeEndTag(); // <cxxFunctionNameLookup>
-
- if (!fn->isInternal() && fn->isReimp() && fn->reimplementedFrom() != 0) {
- FunctionNode* rfn = (FunctionNode*)fn->reimplementedFrom();
- if (rfn && !rfn->isInternal()) {
- writeStartTag(DT_cxxFunctionReimplemented);
- xmlWriter().writeAttribute("href",ditaXmlHref(rfn));
- writeCharacters(rfn->plainFullName());
- writeEndTag(); // </cxxFunctionReimplemented>
- }
- }
- writeParameters(fn,parent,marker);
- writeLocation(fn);
- writeEndTag(); // <cxxFunctionDefinition>
-
- writeApiDesc(fn, marker, QString());
- // generateAlsoList(inner, marker);
-
- // not included: <example> or <apiImpl>
-
- writeEndTag(); // </cxxFunctionDetail>
- writeEndTag(); // </cxxFunction>
-
- if (fn->metaness() == FunctionNode::Ctor ||
- fn->metaness() == FunctionNode::Dtor ||
- fn->overloadNumber() != 1) {
- }
- }
- ++m;
- }
-}
-
-static const QString typeTag("type");
-static const QChar charLangle = '<';
-static const QChar charAt = '@';
-
-/*!
- This function replaces class and enum names with <apiRelation>
- elements, i.e. links.
- */
-void DitaXmlGenerator::replaceTypesWithLinks(const Node* n, const InnerNode* parent, QString& src)
-{
- QStringRef arg;
- QStringRef par1;
- int srcSize = src.size();
- QString text;
- for (int i=0; i<srcSize;) {
- if (src.at(i) == charLangle && src.at(i+1) == charAt) {
- if (!text.isEmpty()) {
- writeCharacters(text);
- text.clear();
- }
- i += 2;
- if (parseArg(src, typeTag, &i, srcSize, &arg, &par1)) {
- const Node* tn = qdb_->findTypeNode(arg.toString(), parent);
- if (tn) {
- //Do not generate a link from a C++ function to a QML Basic Type (such as int)
- if (n->isFunction() && tn->isQmlBasicType())
- writeCharacters(arg.toString());
- else
- addLink(linkForNode(tn,parent),arg,DT_apiRelation);
- }
- else {
- // Write simple arguments, like void and bool,
- // which do not have a Qt defined target.
- writeCharacters(arg.toString());
- }
- }
- }
- else {
- text += src.at(i++);
- }
- }
- if (!text.isEmpty()) {
- writeCharacters(text);
- text.clear();
- }
-}
-
-/*!
- This function writes the <cxxFunctionParameters> element.
- */
-void DitaXmlGenerator::writeParameters(const FunctionNode* fn,
- const InnerNode* parent,
- CodeMarker* marker)
-{
- const QList<Parameter>& parameters = fn->parameters();
- if (!parameters.isEmpty()) {
- writeStartTag(DT_cxxFunctionParameters);
- QList<Parameter>::ConstIterator p = parameters.constBegin();
- while (p != parameters.constEnd()) {
- writeStartTag(DT_cxxFunctionParameter);
- writeStartTag(DT_cxxFunctionParameterDeclaredType);
- QString src = marker->typified((*p).leftType());
- replaceTypesWithLinks(fn,parent,src);
- //writeCharacters((*p).leftType());
- if (!(*p).rightType().isEmpty())
- writeCharacters((*p).rightType());
- writeEndTag(); // <cxxFunctionParameterDeclaredType>
- writeStartTag(DT_cxxFunctionParameterDeclarationName);
- writeCharacters((*p).name());
- writeEndTag(); // <cxxFunctionParameterDeclarationName>
-
- // not included: <cxxFunctionParameterDefinitionName>
-
- if (!(*p).defaultValue().isEmpty()) {
- writeStartTag(DT_cxxFunctionParameterDefaultValue);
- writeCharacters((*p).defaultValue());
- writeEndTag(); // <cxxFunctionParameterDefaultValue>
- }
-
- // not included: <apiDefNote>
-
- writeEndTag(); // <cxxFunctionParameter>
- ++p;
- }
- writeEndTag(); // <cxxFunctionParameters>
- }
-}
-
-/*!
- This function writes the enum types.
- */
-void DitaXmlGenerator::writeEnumerations(const Section& s,
- CodeMarker* marker,
- const QString& attribute)
-{
- NodeList::ConstIterator m = s.members.constBegin();
- while (m != s.members.constEnd()) {
- if ((*m)->type() == Node::Enum) {
- const EnumNode* en = static_cast<const EnumNode*>(*m);
- writeStartTag(DT_cxxEnumeration);
- xmlWriter().writeAttribute("id",en->guid());
- if (!attribute.isEmpty())
- xmlWriter().writeAttribute("outputclass",attribute);
- writeStartTag(DT_apiName);
- writeCharacters(en->name());
- writeEndTag(); // </apiName>
- generateBrief(en,marker);
-
- // not included <prolog>
-
- writeStartTag(DT_cxxEnumerationDetail);
- writeStartTag(DT_cxxEnumerationDefinition);
- writeStartTag(DT_cxxEnumerationAccessSpecifier);
- xmlWriter().writeAttribute("value",en->accessString());
- writeEndTag(); // <cxxEnumerationAccessSpecifier>
-
- QString fq = fullQualification(en);
- if (!fq.isEmpty()) {
- writeStartTag(DT_cxxEnumerationScopedName);
- writeCharacters(fq);
- writeEndTag(); // <cxxEnumerationScopedName>
- }
- const QList<EnumItem>& items = en->items();
- if (!items.isEmpty()) {
- writeStartTag(DT_cxxEnumerationPrototype);
- writeCharacters(en->name());
- xmlWriter().writeCharacters(" = { ");
- QList<EnumItem>::ConstIterator i = items.constBegin();
- while (i != items.constEnd()) {
- writeCharacters((*i).name());
- if (!(*i).value().isEmpty()) {
- xmlWriter().writeCharacters(" = ");
- writeCharacters((*i).value());
- }
- ++i;
- if (i != items.constEnd())
- xmlWriter().writeCharacters(", ");
- }
- xmlWriter().writeCharacters(" }");
- writeEndTag(); // <cxxEnumerationPrototype>
- }
-
- writeStartTag(DT_cxxEnumerationNameLookup);
- writeCharacters(en->parent()->name() + "::" + en->name());
- writeEndTag(); // <cxxEnumerationNameLookup>
-
- // not included: <cxxEnumerationReimplemented>
-
- if (!items.isEmpty()) {
- writeStartTag(DT_cxxEnumerators);
- QList<EnumItem>::ConstIterator i = items.constBegin();
- while (i != items.constEnd()) {
- writeStartTag(DT_cxxEnumerator);
- writeStartTag(DT_apiName);
- writeCharacters((*i).name());
- writeEndTag(); // </apiName>
-
- QString fq = fullQualification(en->parent());
- if (!fq.isEmpty()) {
- writeStartTag(DT_cxxEnumeratorScopedName);
- writeCharacters(fq + "::" + (*i).name());
- writeEndTag(); // <cxxEnumeratorScopedName>
- }
- writeStartTag(DT_cxxEnumeratorPrototype);
- writeCharacters((*i).name());
- writeEndTag(); // <cxxEnumeratorPrototype>
- writeStartTag(DT_cxxEnumeratorNameLookup);
- writeCharacters(en->parent()->name() + "::" + (*i).name());
- writeEndTag(); // <cxxEnumeratorNameLookup>
-
- if (!(*i).value().isEmpty()) {
- writeStartTag(DT_cxxEnumeratorInitialiser);
- if ((*i).value().toInt(0,16) == 0)
- xmlWriter().writeAttribute("value", "0");
- else
- xmlWriter().writeAttribute("value", (*i).value());
- writeEndTag(); // <cxxEnumeratorInitialiser>
- }
-
- // not included: <cxxEnumeratorAPIItemLocation>
-#if 0
- if (!(*i).text().isEmpty()) {
- writeStartTag(DT_apiDesc);
- generateText((*i).text(), en, marker);
- writeEndTag(); // </apiDesc>
- }
-#endif
- writeEndTag(); // <cxxEnumerator>
- ++i;
- }
- writeEndTag(); // <cxxEnumerators>
- }
-
- writeLocation(en);
- writeEndTag(); // <cxxEnumerationDefinition>
-
- writeApiDesc(en, marker, QString());
-
- // not included: <example> or <apiImpl>
-
- writeEndTag(); // </cxxEnumerationDetail>
-
- // not included: <related-links>
-
- writeEndTag(); // </cxxEnumeration>
- }
- ++m;
- }
-}
-
-/*!
- This function writes the output for the \typedef commands.
- */
-void DitaXmlGenerator::writeTypedefs(const Section& s,
- CodeMarker* marker,
- const QString& attribute)
-
-{
- NodeList::ConstIterator m = s.members.constBegin();
- while (m != s.members.constEnd()) {
- if ((*m)->type() == Node::Typedef) {
- const TypedefNode* tn = static_cast<const TypedefNode*>(*m);
- writeStartTag(DT_cxxTypedef);
- xmlWriter().writeAttribute("id",tn->guid());
- if (!attribute.isEmpty())
- xmlWriter().writeAttribute("outputclass",attribute);
- writeStartTag(DT_apiName);
- writeCharacters(tn->name());
- writeEndTag(); // </apiName>
- generateBrief(tn,marker);
-
- // not included: <prolog>
-
- writeStartTag(DT_cxxTypedefDetail);
- writeStartTag(DT_cxxTypedefDefinition);
- writeStartTag(DT_cxxTypedefAccessSpecifier);
- xmlWriter().writeAttribute("value",tn->accessString());
- writeEndTag(); // <cxxTypedefAccessSpecifier>
-
- // not included: <cxxTypedefDeclaredType>
-
- QString fq = fullQualification(tn);
- if (!fq.isEmpty()) {
- writeStartTag(DT_cxxTypedefScopedName);
- writeCharacters(fq);
- writeEndTag(); // <cxxTypedefScopedName>
- }
-
- // not included: <cxxTypedefPrototype>
-
- writeStartTag(DT_cxxTypedefNameLookup);
- writeCharacters(tn->parent()->name() + "::" + tn->name());
- writeEndTag(); // <cxxTypedefNameLookup>
-
- // not included: <cxxTypedefReimplemented>
-
- writeLocation(tn);
- writeEndTag(); // <cxxTypedefDefinition>
-
- writeApiDesc(tn, marker, QString());
-
- // not included: <example> or <apiImpl>
-
- writeEndTag(); // </cxxTypedefDetail>
-
- // not included: <related-links>
-
- writeEndTag(); // </cxxTypedef>
- }
- ++m;
- }
-}
-
-/*!
- This function writes the output for the \property commands.
- This is the Q_PROPERTYs.
- */
-void DitaXmlGenerator::writeProperties(const Section& s,
- CodeMarker* marker,
- const QString& attribute)
-{
- NodeList::ConstIterator m = s.members.constBegin();
- while (m != s.members.constEnd()) {
- if ((*m)->type() == Node::Property) {
- const PropertyNode* pn = static_cast<const PropertyNode*>(*m);
- writeStartTag(DT_cxxVariable);
- xmlWriter().writeAttribute("id",pn->guid());
- if (!attribute.isEmpty())
- xmlWriter().writeAttribute("outputclass",attribute);
- writeStartTag(DT_apiName);
- writeCharacters(pn->name());
- writeEndTag(); // </apiName>
- generateBrief(pn,marker);
-
- // not included: <prolog>
-
- writeStartTag(DT_cxxVariableDetail);
- writeStartTag(DT_cxxVariableDefinition);
- writeStartTag(DT_cxxVariableAccessSpecifier);
- xmlWriter().writeAttribute("value",pn->accessString());
- writeEndTag(); // <cxxVariableAccessSpecifier>
-
- // not included: <cxxVariableStorageClassSpecifierExtern>,
- // <cxxVariableStorageClassSpecifierStatic>,
- // <cxxVariableStorageClassSpecifierMutable>,
- // <cxxVariableConst>, <cxxVariableVolatile>
-
- if (!pn->qualifiedDataType().isEmpty()) {
- writeStartTag(DT_cxxVariableDeclaredType);
- writeCharacters(pn->qualifiedDataType());
- writeEndTag(); // <cxxVariableDeclaredType>
- }
- QString fq = fullQualification(pn);
- if (!fq.isEmpty()) {
- writeStartTag(DT_cxxVariableScopedName);
- writeCharacters(fq);
- writeEndTag(); // <cxxVariableScopedName>
- }
-
- writeStartTag(DT_cxxVariablePrototype);
- xmlWriter().writeCharacters("Q_PROPERTY(");
- writeCharacters(pn->qualifiedDataType());
- xmlWriter().writeCharacters(" ");
- writeCharacters(pn->name());
- writePropertyParameter("READ",pn->getters());
- writePropertyParameter("WRITE",pn->setters());
- writePropertyParameter("RESET",pn->resetters());
- writePropertyParameter("NOTIFY",pn->notifiers());
- if (pn->isDesignable() != pn->designableDefault()) {
- xmlWriter().writeCharacters(" DESIGNABLE ");
- if (!pn->runtimeDesignabilityFunction().isEmpty())
- writeCharacters(pn->runtimeDesignabilityFunction());
- else
- xmlWriter().writeCharacters(pn->isDesignable() ? "true" : "false");
- }
- if (pn->isScriptable() != pn->scriptableDefault()) {
- xmlWriter().writeCharacters(" SCRIPTABLE ");
- if (!pn->runtimeScriptabilityFunction().isEmpty())
- writeCharacters(pn->runtimeScriptabilityFunction());
- else
- xmlWriter().writeCharacters(pn->isScriptable() ? "true" : "false");
- }
- if (pn->isWritable() != pn->writableDefault()) {
- xmlWriter().writeCharacters(" STORED ");
- xmlWriter().writeCharacters(pn->isStored() ? "true" : "false");
- }
- if (pn->isUser() != pn->userDefault()) {
- xmlWriter().writeCharacters(" USER ");
- xmlWriter().writeCharacters(pn->isUser() ? "true" : "false");
- }
- if (pn->isConstant())
- xmlWriter().writeCharacters(" CONSTANT");
- if (pn->isFinal())
- xmlWriter().writeCharacters(" FINAL");
- xmlWriter().writeCharacters(")");
- writeEndTag(); // <cxxVariablePrototype>
-
- writeStartTag(DT_cxxVariableNameLookup);
- writeCharacters(pn->parent()->name() + "::" + pn->name());
- writeEndTag(); // <cxxVariableNameLookup>
-
- if (pn->overriddenFrom() != 0) {
- PropertyNode* opn = (PropertyNode*)pn->overriddenFrom();
- writeStartTag(DT_cxxVariableReimplemented);
- xmlWriter().writeAttribute("href",ditaXmlHref(opn));
- writeCharacters(opn->plainFullName());
- writeEndTag(); // </cxxVariableReimplemented>
- }
-
- writeLocation(pn);
- writeEndTag(); // <cxxVariableDefinition>
-
- writeApiDesc(pn, marker, QString());
-
- // not included: <example> or <apiImpl>
-
- writeEndTag(); // </cxxVariableDetail>
-
- // not included: <related-links>
-
- writeEndTag(); // </cxxVariable>
- }
- ++m;
- }
-}
-
-/*!
- This function outputs the nodes resulting from \variable commands.
- */
-void DitaXmlGenerator::writeDataMembers(const Section& s,
- CodeMarker* marker,
- const QString& attribute)
-{
- NodeList::ConstIterator m = s.members.constBegin();
- while (m != s.members.constEnd()) {
- if ((*m)->type() == Node::Variable) {
- const VariableNode* vn = static_cast<const VariableNode*>(*m);
- writeStartTag(DT_cxxVariable);
- xmlWriter().writeAttribute("id",vn->guid());
- if (!attribute.isEmpty())
- xmlWriter().writeAttribute("outputclass",attribute);
- writeStartTag(DT_apiName);
- writeCharacters(vn->name());
- writeEndTag(); // </apiName>
- generateBrief(vn,marker);
-
- // not included: <prolog>
-
- writeStartTag(DT_cxxVariableDetail);
- writeStartTag(DT_cxxVariableDefinition);
- writeStartTag(DT_cxxVariableAccessSpecifier);
- xmlWriter().writeAttribute("value",vn->accessString());
- writeEndTag(); // <cxxVariableAccessSpecifier>
-
- // not included: <cxxVAriableStorageClassSpecifierExtern>
-
- if (vn->isStatic()) {
- writeStartTag(DT_cxxVariableStorageClassSpecifierStatic);
- xmlWriter().writeAttribute("name","static");
- xmlWriter().writeAttribute("value","static");
- writeEndTag(); // <cxxVariableStorageClassSpecifierStatic>
- }
-
- // not included: <cxxVAriableStorageClassSpecifierMutable>,
- // <cxxVariableConst>, <cxxVariableVolatile>
-
- writeStartTag(DT_cxxVariableDeclaredType);
- writeCharacters(vn->leftType());
- if (!vn->rightType().isEmpty())
- writeCharacters(vn->rightType());
- writeEndTag(); // <cxxVariableDeclaredType>
-
- QString fq = fullQualification(vn);
- if (!fq.isEmpty()) {
- writeStartTag(DT_cxxVariableScopedName);
- writeCharacters(fq);
- writeEndTag(); // <cxxVariableScopedName>
- }
-
- writeStartTag(DT_cxxVariablePrototype);
- writeCharacters(vn->leftType() + QLatin1Char(' '));
- //writeCharacters(vn->parent()->name() + "::" + vn->name());
- writeCharacters(vn->name());
- if (!vn->rightType().isEmpty())
- writeCharacters(vn->rightType());
- writeEndTag(); // <cxxVariablePrototype>
-
- writeStartTag(DT_cxxVariableNameLookup);
- writeCharacters(vn->parent()->name() + "::" + vn->name());
- writeEndTag(); // <cxxVariableNameLookup>
-
- // not included: <cxxVariableReimplemented>
-
- writeLocation(vn);
- writeEndTag(); // <cxxVariableDefinition>
-
- writeApiDesc(vn, marker, QString());
-
- // not included: <example> or <apiImpl>
-
- writeEndTag(); // </cxxVariableDetail>
-
- // not included: <related-links>
-
- writeEndTag(); // </cxxVariable>
- }
- ++m;
- }
-}
-
-/*!
- This function writes a \macro as a <cxxDefine>.
- */
-void DitaXmlGenerator::writeMacros(const Section& s,
- CodeMarker* marker,
- const QString& attribute)
-{
- NodeList::ConstIterator m = s.members.constBegin();
- while (m != s.members.constEnd()) {
- if ((*m)->type() == Node::Function) {
- const FunctionNode* fn = static_cast<const FunctionNode*>(*m);
- if (fn->isMacro()) {
- writeStartTag(DT_cxxDefine);
- xmlWriter().writeAttribute("id",fn->guid());
- if (!attribute.isEmpty())
- xmlWriter().writeAttribute("outputclass",attribute);
- writeStartTag(DT_apiName);
- writeCharacters(fn->name());
- writeEndTag(); // </apiName>
- generateBrief(fn,marker);
-
- // not included: <prolog>
-
- writeStartTag(DT_cxxDefineDetail);
- writeStartTag(DT_cxxDefineDefinition);
- writeStartTag(DT_cxxDefineAccessSpecifier);
- xmlWriter().writeAttribute("value",fn->accessString());
- writeEndTag(); // <cxxDefineAccessSpecifier>
-
- writeStartTag(DT_cxxDefinePrototype);
- xmlWriter().writeCharacters("#define ");
- writeCharacters(fn->name());
- if (fn->metaness() == FunctionNode::MacroWithParams) {
- QStringList params = fn->parameterNames();
- if (!params.isEmpty()) {
- xmlWriter().writeCharacters("(");
- for (int i = 0; i < params.size(); ++i) {
- if (params[i].isEmpty())
- xmlWriter().writeCharacters("...");
- else
- writeCharacters(params[i]);
- if ((i+1) < params.size())
- xmlWriter().writeCharacters(", ");
- }
- xmlWriter().writeCharacters(")");
- }
- }
- writeEndTag(); // <cxxDefinePrototype>
-
- writeStartTag(DT_cxxDefineNameLookup);
- writeCharacters(fn->name());
- writeEndTag(); // <cxxDefineNameLookup>
-
- if (fn->reimplementedFrom() != 0) {
- FunctionNode* rfn = (FunctionNode*)fn->reimplementedFrom();
- writeStartTag(DT_cxxDefineReimplemented);
- xmlWriter().writeAttribute("href",ditaXmlHref(rfn));
- writeCharacters(rfn->plainFullName());
- writeEndTag(); // </cxxDefineReimplemented>
- }
-
- if (fn->metaness() == FunctionNode::MacroWithParams) {
- QStringList params = fn->parameterNames();
- if (!params.isEmpty()) {
- writeStartTag(DT_cxxDefineParameters);
- for (int i = 0; i < params.size(); ++i) {
- writeStartTag(DT_cxxDefineParameter);
- writeStartTag(DT_cxxDefineParameterDeclarationName);
- writeCharacters(params[i]);
- writeEndTag(); // <cxxDefineParameterDeclarationName>
-
- // not included: <apiDefNote>
-
- writeEndTag(); // <cxxDefineParameter>
- }
- writeEndTag(); // <cxxDefineParameters>
- }
- }
-
- writeLocation(fn);
- writeEndTag(); // <cxxDefineDefinition>
-
- writeApiDesc(fn, marker, QString());
-
- // not included: <example> or <apiImpl>
-
- writeEndTag(); // </cxxDefineDetail>
-
- // not included: <related-links>
-
- writeEndTag(); // </cxxDefine>
- }
- }
- ++m;
- }
-}
-
-/*!
- This function writes one parameter of a Q_PROPERTY macro.
- The property is identified by \a tag ("READ" "WRIE" etc),
- and it is found in the 'a nlist.
- */
-void DitaXmlGenerator::writePropertyParameter(const QString& tag, const NodeList& nlist)
-{
- NodeList::const_iterator n = nlist.constBegin();
- while (n != nlist.constEnd()) {
- xmlWriter().writeCharacters(" ");
- writeCharacters(tag);
- xmlWriter().writeCharacters(" ");
- writeCharacters((*n)->name());
- ++n;
- }
-}
-
-/*!
- Calls beginSubPage() in the base class to open the file.
- Then creates a new XML stream writer using the IO device
- from opened file and pushes the XML writer onto a stackj.
- Creates the file named \a fileName in the output directory.
- Attaches a QTextStream to the created file, which is written
- to all over the place using out(). Finally, it sets some
- parameters in the XML writer and calls writeStartDocument().
-
- It also ensures that a GUID map is created for the output file.
- */
-void DitaXmlGenerator::beginSubPage(const InnerNode* node,
- const QString& fileName)
-{
- Generator::beginSubPage(node,fileName);
- (void) lookupGuidMap(fileName);
- QXmlStreamWriter* writer = new QXmlStreamWriter(out().device());
- xmlWriterStack.push(writer);
- writer->setAutoFormatting(true);
- writer->setAutoFormattingIndent(4);
- writer->writeStartDocument();
- clearSectionNesting();
-}
-
-/*!
- Calls writeEndDocument() and then pops the XML stream writer
- off the stack and deletes it. Then it calls endSubPage() in
- the base class to close the device.
- */
-void DitaXmlGenerator::endSubPage()
-{
- if (inSection())
- qDebug() << "Missing </section> in" << outFileName() << sectionNestingLevel;
- xmlWriter().writeEndDocument();
- delete xmlWriterStack.pop();
- Generator::endSubPage();
-}
-
-/*!
- Returns a reference to the XML stream writer currently in use.
- There is one XML stream writer open for each XML file being
- written, and they are kept on a stack. The one on top of the
- stack is the one being written to at the moment.
- */
-QXmlStreamWriter& DitaXmlGenerator::xmlWriter()
-{
- return *xmlWriterStack.top();
-}
-
-/*!
- Writes the \e {<apiDesc>} element for \a node to the current XML
- stream using the code \a marker and the \a title.
- */
-void DitaXmlGenerator::writeApiDesc(const Node* node,
- CodeMarker* marker,
- const QString& title)
-{
- if (!node->doc().isEmpty()) {
- inDetailedDescription = true;
- enterDesc(DT_apiDesc,QString(),title);
- generateBody(node, marker);
- generateAlsoList(node, marker);
- leaveSection();
- }
- inDetailedDescription = false;
-}
-
-/*!
- Write the nested class elements.
- */
-void DitaXmlGenerator::writeNestedClasses(const Section& s,
- const Node* n)
-{
- if (s.members.isEmpty())
- return;
- writeStartTag(DT_cxxClassNested);
- writeStartTag(DT_cxxClassNestedDetail);
-
- NodeList::ConstIterator m = s.members.constBegin();
- while (m != s.members.constEnd()) {
- if ((*m)->type() == Node::Class) {
- writeStartTag(DT_cxxClassNestedClass);
- QString link = linkForNode((*m), n);
- xmlWriter().writeAttribute("href", link);
- QString name = n->name() + "::" + (*m)->name();
- writeCharacters(name);
- writeEndTag(); // <cxxClassNestedClass>
- }
- ++m;
- }
- writeEndTag(); // <cxxClassNestedDetail>
- writeEndTag(); // <cxxClassNested>
-}
-
-/*!
- Recursive writing of DITA XML files from the root \a node.
- */
-void
-DitaXmlGenerator::generateInnerNode(InnerNode* node)
-{
- if (!node->url().isNull())
- return;
-
- if (node->isDocNode()) {
- DocNode* docNode = static_cast<DocNode*>(node);
- if (docNode->subType() == Node::ExternalPage)
- return;
- if (docNode->subType() == Node::Image)
- return;
- if (docNode->subType() == Node::Page) {
- if (node->count() > 0)
- qDebug("PAGE %s HAS CHILDREN", qPrintable(docNode->title()));
- }
- }
- else if (node->isQmlPropertyGroup())
- return;
-
- /*
- Obtain a code marker for the source file.
- */
- CodeMarker *marker = CodeMarker::markerForFileName(node->location().filePath());
- if (node->parent() != 0) {
- if (!node->name().endsWith(".ditamap"))
- beginSubPage(node, fileName(node));
- if (node->isNamespace() || node->isClass() || node->isQmlType() || node->isHeaderFile())
- generateClassLikeNode(node, marker);
- else if (node->isDocNode())
- generateDocNode(static_cast<DocNode*>(node), marker);
- else if (node->isQmlBasicType())
- generateQmlBasicTypePage(static_cast<QmlBasicTypeNode*>(node), marker);
- if (!node->name().endsWith(".ditamap"))
- endSubPage();
- }
-
- NodeList::ConstIterator c = node->childNodes().constBegin();
- while (c != node->childNodes().constEnd()) {
- if ((*c)->isInnerNode() && (*c)->access() != Node::Private)
- generateInnerNode((InnerNode*)*c);
- ++c;
- }
-}
-
-/*!
- Returns \c true if \a format is "DITAXML" or "HTML" .
- */
-bool DitaXmlGenerator::canHandleFormat(const QString& format)
-{
- return (format == "HTML") || (format == this->format());
-}
-
-/*!
- If the node multimap \a nmm contains nodes mapped to \a key,
- if any of the nodes mapped to \a key has the same href as the
- \a node, return true. Otherwise, return false.
- */
-bool DitaXmlGenerator::isDuplicate(NodeMultiMap* nmm, const QString& key, Node* node)
-{
- QList<Node*> matches = nmm->values(key);
- if (!matches.isEmpty()) {
- for (int i=0; i<matches.size(); ++i) {
- if (matches[i] == node)
- return true;
- if (fileName(node) == fileName(matches[i]))
- return true;
- }
- }
- return false;
-}
-/*!
- Collect all the nodes in the tree according to their type or subtype.
-
- If a node is found that is named index.html, return that node as the
- root page node.
-
- type: Class
- type: Namespace
-
- subtype: Example
- subtype: External page
- subtype: Group
- subtype: Header file
- subtype: Module
- subtype: Page
- subtype: QML basic type
- subtype: QML class
- subtype: QML module
- */
-Node* DitaXmlGenerator::collectNodesByTypeAndSubtype(const InnerNode* parent)
-{
- Node* rootPageNode = 0;
- const NodeList& children = parent->childNodes();
- if (children.size() == 0)
- return rootPageNode;
-
- QString message;
- for (int i=0; i<children.size(); ++i) {
- Node* child = children[i];
- if (!child || child->isInternal() || child->doc().isEmpty() || child->isIndexNode())
- continue;
-
- if (child->name() == "index.html" || child->name() == "index") {
- rootPageNode = child;
- }
-
- switch (child->type()) {
- case Node::Namespace:
- if (!isDuplicate(nodeTypeMaps[Node::Namespace],child->name(),child))
- nodeTypeMaps[Node::Namespace]->insert(child->name(),child);
- break;
- case Node::Class:
- if (!isDuplicate(nodeTypeMaps[Node::Class],child->name(),child))
- nodeTypeMaps[Node::Class]->insert(child->name(),child);
- break;
- case Node::QmlType:
- if (!isDuplicate(nodeTypeMaps[Node::QmlType],child->name(),child))
- nodeTypeMaps[Node::QmlType]->insert(child->name(),child);
- break;
- case Node::QmlBasicType:
- if (!isDuplicate(nodeTypeMaps[Node::QmlBasicType],child->title(),child))
- nodeTypeMaps[Node::QmlBasicType]->insert(child->title(),child);
- break;
- case Node::Group:
- if (!isDuplicate(nodeTypeMaps[Node::Group],child->title(),child))
- nodeTypeMaps[Node::Group]->insert(child->title(),child);
- break;
- case Node::Module:
- if (!isDuplicate(nodeTypeMaps[Node::Module],child->title(),child))
- nodeTypeMaps[Node::Module]->insert(child->title(),child);
- break;
- case Node::QmlModule:
- if (!isDuplicate(nodeTypeMaps[Node::QmlModule],child->title(),child))
- nodeTypeMaps[Node::QmlModule]->insert(child->title(),child);
- break;
- case Node::Document:
- switch (child->subType()) {
- case Node::Example:
- if (!isDuplicate(nodeSubtypeMaps[Node::Example],child->title(),child))
- nodeSubtypeMaps[Node::Example]->insert(child->title(),child);
- break;
- case Node::HeaderFile:
- if (!isDuplicate(nodeSubtypeMaps[Node::HeaderFile],child->title(),child))
- nodeSubtypeMaps[Node::HeaderFile]->insert(child->title(),child);
- break;
- case Node::File:
- break;
- case Node::Image:
- break;
- case Node::Page:
- if (!isDuplicate(pageTypeMaps[child->pageType()],child->title(),child))
- pageTypeMaps[child->pageType()]->insert(child->title(),child);
- break;
- case Node::ExternalPage:
- if (!isDuplicate(nodeSubtypeMaps[Node::ExternalPage],child->title(),child))
- nodeSubtypeMaps[Node::ExternalPage]->insert(child->title(),child);
- break;
- default:
- break;
- }
- break;
- case Node::Enum:
- break;
- case Node::Typedef:
- break;
- case Node::Function:
- break;
- case Node::Property:
- break;
- case Node::Variable:
- break;
- case Node::QmlProperty:
- break;
- case Node::QmlPropertyGroup:
- break;
- case Node::QmlSignal:
- break;
- case Node::QmlSignalHandler:
- break;
- case Node::QmlMethod:
- break;
- default:
- break;
- }
- }
- return rootPageNode;
-}
-
-/*!
- Creates the DITA map for the qdoc run. The map is written
- to the file \e{qt.ditamap" in the DITA XML output directory.
- */
-void DitaXmlGenerator::writeDitaMap()
-{
- QString doctype;
-
-/*
- Remove #if 0 to get a flat ditamap.
-*/
-#if 0
- beginSubPage(qdb_->primaryTreeRoot(),"qt.ditamap");
- doctype = "<!DOCTYPE map PUBLIC \"-//OASIS//DTD DITA Map//EN\" \"map.dtd\">";
- xmlWriter().writeDTD(doctype);
- writeStartTag(DT_map);
- writeStartTag(DT_topicmeta);
- writeStartTag(DT_shortdesc);
- xmlWriter().writeCharacters("The top level map for the Qt documentation");
- writeEndTag(); // </shortdesc>
- writeEndTag(); // </topicmeta>
- GuidMaps::iterator i = guidMaps.constBegin();
- while (i != guidMaps.constEnd()) {
- writeStartTag(DT_topicref);
- if (i.key() != "qt.ditamap")
- xmlWriter().writeAttribute("href",i.key());
- writeEndTag(); // </topicref>
- ++i;
- }
- endSubPage();
-#endif
-
- for (unsigned i=0; i<Node::LastType; ++i)
- nodeTypeMaps[i] = new NodeMultiMap;
- for (unsigned i=0; i<Node::LastSubtype; ++i)
- nodeSubtypeMaps[i] = new NodeMultiMap;
- for (unsigned i=0; i<Node::OnBeyondZebra; ++i)
- pageTypeMaps[i] = new NodeMultiMap;
- Node* rootPageNode = collectNodesByTypeAndSubtype(qdb_->primaryTreeRoot());
-
- beginSubPage(qdb_->primaryTreeRoot(),"qt.ditamap");
-
- doctype = "<!DOCTYPE map PUBLIC \"-//OASIS//DTD DITA Map//EN\" \"map.dtd\">";
- xmlWriter().writeDTD(doctype);
- writeStartTag(DT_map);
- writeStartTag(DT_topicmeta);
- writeStartTag(DT_shortdesc);
- xmlWriter().writeCharacters("The top level map for the Qt documentation");
- writeEndTag(); // </shortdesc>
- writeEndTag(); // </topicmeta>
-
- writeStartTag(DT_topicref);
- if (rootPageNode) {
- if (!rootPageNode->title().isEmpty())
- xmlWriter().writeAttribute("navtitle",rootPageNode->title());
- else
- xmlWriter().writeAttribute("navtitle",project);
- xmlWriter().writeAttribute("href",fileName(rootPageNode));
- }
- else
- xmlWriter().writeAttribute("navtitle",project);
-
- writeTopicrefs(pageTypeMaps[Node::OverviewPage], "Overviews");
- writeTopicrefs(pageTypeMaps[Node::HowToPage], "Howtos");
- writeTopicrefs(pageTypeMaps[Node::TutorialPage], "Tutorials");
- writeTopicrefs(pageTypeMaps[Node::FAQPage], "FAQs");
- writeTopicrefs(pageTypeMaps[Node::ArticlePage], "Articles");
- writeTopicrefs(nodeSubtypeMaps[Node::Example], "Examples");
-
- if (nodeTypeMaps[Node::QmlModule]->size() > 1)
- writeTopicrefs(nodeTypeMaps[Node::QmlModule], "QML modules");
-
- if (nodeTypeMaps[Node::QmlModule]->size() == 1)
- writeTopicrefs(nodeTypeMaps[Node::QmlType], "QML types", nodeTypeMaps[Node::QmlModule]->values()[0]);
- else
- writeTopicrefs(nodeTypeMaps[Node::QmlType], "QML types");
- writeTopicrefs(nodeTypeMaps[Node::QmlBasicType], "QML basic types");
-
- if (nodeTypeMaps[Node::Module]->size() > 1)
- writeTopicrefs(nodeTypeMaps[Node::Module], "Modules");
-
- if (nodeTypeMaps[Node::Module]->size() == 1)
- writeTopicrefs(nodeTypeMaps[Node::Class], "C++ classes", nodeTypeMaps[Node::Module]->values()[0]);
- else
- writeTopicrefs(nodeTypeMaps[Node::Class], "C++ classes");
- writeTopicrefs(nodeTypeMaps[Node::Namespace], "C++ namespaces");
- writeTopicrefs(nodeSubtypeMaps[Node::HeaderFile], "Header files");
- writeTopicrefs(nodeTypeMaps[Node::Group], "Groups");
-
- writeEndTag(); // </topicref>
- endSubPage();
-
- for (unsigned i=0; i<Node::LastType; ++i)
- delete nodeTypeMaps[i];
- for (unsigned i=0; i<Node::LastSubtype; ++i)
- delete nodeSubtypeMaps[i];
- for (unsigned i=0; i<Node::OnBeyondZebra; ++i)
- delete pageTypeMaps[i];
-}
-
-/*!
- Creates the DITA map from the topicrefs in \a node,
- which is a DitaMapNode.
- */
-void DitaXmlGenerator::writeDitaMap(const DitaMapNode* node)
-{
- beginSubPage(node,node->name());
-
- QString doctype;
- doctype = "<!DOCTYPE map PUBLIC \"-//OASIS//DTD DITA Map//EN\" \"map.dtd\">";
- xmlWriter().writeDTD(doctype);
- writeStartTag(DT_map);
- writeStartTag(DT_topicmeta);
- writeStartTag(DT_shortdesc);
- xmlWriter().writeCharacters(node->title());
- writeEndTag(); // </shortdesc>
- writeEndTag(); // </topicmeta>
- const DitaRefList map = node->map();
- writeDitaRefs(map);
- endSubPage();
-}
-
-/*!
- Write the \a ditarefs to the current output file.
- */
-void DitaXmlGenerator::writeDitaRefs(const DitaRefList& ditarefs)
-{
- foreach (DitaRef* t, ditarefs) {
- if (t->isMapRef())
- writeStartTag(DT_mapref);
- else
- writeStartTag(DT_topicref);
- xmlWriter().writeAttribute("navtitle",t->navtitle());
- if (t->href().isEmpty()) {
- const DocNode* dn = qdb_->findDocNodeByTitle(t->navtitle());
- if (dn)
- xmlWriter().writeAttribute("href",fileName(dn));
- }
- else
- xmlWriter().writeAttribute("href",t->href());
- if (t->subrefs() && !t->subrefs()->isEmpty())
- writeDitaRefs(*(t->subrefs()));
- writeEndTag(); // </topicref> or </mapref>
- }
-}
-
-void DitaXmlGenerator::writeTopicrefs(NodeMultiMap* nmm, const QString& navtitle, Node* headingnode)
-{
- if (!nmm || nmm->isEmpty())
- return;
- writeStartTag(DT_topicref);
- xmlWriter().writeAttribute("navtitle",navtitle);
- if (headingnode)
- xmlWriter().writeAttribute("href",fileName(headingnode));
- NodeMultiMap::iterator i;
- NodeMultiMap *ditaMaps = pageTypeMaps[Node::DitaMapPage];
-
- /*!
- Put all pages that are already in a hand-written ditamap not in
- the qt.ditamap separately. It loops through all ditamaps recursively
- before deciding to write an article to qt.ditamap.
- */
- if ((navtitle == "Articles" && ditaMaps && ditaMaps->size() > 0)) {
- NodeMultiMap::iterator mapIterator = ditaMaps->begin();
- while (mapIterator != ditaMaps->end()) {
- writeStartTag(DT_mapref);
- xmlWriter().writeAttribute("navtitle",mapIterator.key());
- xmlWriter().writeAttribute("href",fileName(mapIterator.value()));
- writeEndTag();
- ++mapIterator;
- }
- i = nmm->begin();
- while (i != nmm->end()) {
- // Hardcode not writing index.dita multiple times in the tree.
- // index.dita should only appear at the top of the ditamap.
- if (fileName(i.value()) == "index.dita") {
- i++;
- continue;
- }
- bool foundInDitaMap = false;
- mapIterator = ditaMaps->begin();
- while (mapIterator != ditaMaps->end()) {
- const DitaMapNode *dmNode = static_cast<const DitaMapNode *>(mapIterator.value());
- for (int count = 0; count < dmNode->map().count(); count++) {
- if (dmNode->map().at(count)->navtitle() == i.key()) {
- foundInDitaMap = true;
- break;
- }
- }
- ++mapIterator;
- }
- if (!foundInDitaMap) {
- writeStartTag(DT_topicref);
- xmlWriter().writeAttribute("navtitle",i.key());
- xmlWriter().writeAttribute("href",fileName(i.value()));
- writeEndTag(); // </topicref>
- }
- ++i;
- }
- }
- /*!
- Shortcut when there are no hand-written ditamaps or when we are
- not generating the articles list.
- */
- else {
- i = nmm->begin();
- while (i != nmm->end()) {
- // Hardcode not writing index.dita multiple times in the tree.
- // index.dita should only appear at the top of the ditamap.
- if (fileName(i.value()) == "index.dita") {
- i++;
- continue;
- }
- writeStartTag(DT_topicref);
- xmlWriter().writeAttribute("navtitle",i.key());
- xmlWriter().writeAttribute("href",fileName(i.value()));
- switch (i.value()->type()) {
- case Node::Class:
- case Node::Namespace: {
- const NamespaceNode* nn = static_cast<const NamespaceNode*>(i.value());
- const NodeList& c = nn->childNodes();
- QMap<QString, const Node*> tempMap;
- for (int j=0; j<c.size(); ++j) {
- if (c[j]->isInternal() || c[j]->access() == Node::Private || c[j]->doc().isEmpty())
- continue;
- if (c[j]->type() == Node::Class) {
- tempMap.insert(c[j]->name(), c[j]);
- }
- }
- QMap<QString, const Node*>::iterator classIterator = tempMap.begin();
- while (classIterator != tempMap.end()) {
- const Node* currentNode = static_cast<const Node*>(classIterator.value());
- writeStartTag(DT_topicref);
- xmlWriter().writeAttribute("navtitle",currentNode->name());
- xmlWriter().writeAttribute("href",fileName(currentNode));
- writeEndTag(); // </topicref>
- ++classIterator;
- }
-
- break;
- }
- default:
- break;
- }
- writeEndTag(); // </topicref>
- ++i;
- }
- }
- writeEndTag(); // </topicref>
-}
-
-
-/*!
- Looks up the tag name for \a t in the map of metadata
- values for the current topic in \a inner. If a value
- for the tag is found, the element is written with the
- found value. Otherwise if \a force is set, an empty
- element is written using the tag.
-
- Returns \c true or false depending on whether it writes
- an element using the tag \a t.
-
- \note If \a t is found in the metadata map, it is erased.
- i.e. Once you call this function for a particular \a t,
- you consume \a t.
- */
-bool DitaXmlGenerator::writeMetadataElement(const InnerNode* inner,
- DitaXmlGenerator::DitaTag t,
- bool force)
-{
- QString s = getMetadataElement(inner,t);
- if (s.isEmpty() && !force)
- return false;
- writeStartTag(t);
- if (!s.isEmpty())
- xmlWriter().writeCharacters(s);
- writeEndTag();
- return true;
-}
-
-
-/*!
- Looks up the tag name for \a t in the map of metadata
- values for the current topic in \a inner. If one or more
- value sfor the tag are found, the elements are written.
- Otherwise nothing is written.
-
- Returns \c true or false depending on whether it writes
- at least one element using the tag \a t.
-
- \note If \a t is found in the metadata map, it is erased.
- i.e. Once you call this function for a particular \a t,
- you consume \a t.
- */
-bool DitaXmlGenerator::writeMetadataElements(const InnerNode* inner,
- DitaXmlGenerator::DitaTag t)
-{
- QStringList s = getMetadataElements(inner,t);
- if (s.isEmpty())
- return false;
- for (int i=0; i<s.size(); ++i) {
- writeStartTag(t);
- xmlWriter().writeCharacters(s[i]);
- writeEndTag();
- }
- return true;
-}
-
-/*!
- Looks up the tag name for \a t in the map of metadata
- values for the current topic in \a inner. If a value
- for the tag is found, the value is returned.
-
- \note If \a t is found in the metadata map, it is erased.
- i.e. Once you call this function for a particular \a t,
- you consume \a t.
- */
-QString DitaXmlGenerator::getMetadataElement(const InnerNode* inner, DitaXmlGenerator::DitaTag t)
-{
- QString s = Generator::getMetadataElement(inner, ditaTags[t]);
- if (s.isEmpty()) {
- QStringList sl = metadataDefault(t);
- if (!sl.isEmpty())
- s = sl[0];
- }
- return s;
-}
-
-/*!
- Looks up the tag name for \a t in the map of metadata
- values for the current topic in \a inner. If values
- for the tag are found, they are returned in a string
- list.
-
- \note If \a t is found in the metadata map, all the
- pairs having the key \a t are erased. i.e. Once you
- all this function for a particular \a t, you consume
- \a t.
- */
-QStringList DitaXmlGenerator::getMetadataElements(const InnerNode* inner,
- DitaXmlGenerator::DitaTag t)
-{
- QStringList s = Generator::getMetadataElements(inner,ditaTags[t]);
- if (s.isEmpty())
- s = metadataDefault(t);
- return s;
-}
-
-/*!
- Returns the value of key \a t or an empty string
- if \a t is not found in the map.
- */
-QStringList DitaXmlGenerator::metadataDefault(DitaTag t) const
-{
- return metadataDefaults.value(ditaTags[t]).values_;
-}
-
-/*!
- Writes the <prolog> element for the \a inner node
- using the \a marker. The <prolog> element contains
- the <metadata> element, plus some others. This
- function writes one or more of these elements:
-
- \list
- \o <audience> *
- \o <author> *
- \o <brand> not used
- \o <category> *
- \o <compomnent> *
- \o <copyrholder> *
- \o <copyright> *
- \o <created> not used
- \o <copyryear> *
- \o <critdates> not used
- \o <keyword> not used
- \o <keywords> not used
- \o <metadata> *
- \o <othermeta> *
- \o <permissions> *
- \o <platform> not used
- \o <prodinfo> *
- \o <prodname> *
- \o <prolog> *
- \o <publisher> *
- \o <resourceid> not used
- \o <revised> not used
- \o <source> not used
- \o <tm> not used
- \o <unknown> not used
- \o <vrm> *
- \o <vrmlist> *
- \endlist
-
- \node * means the tag has been used.
-
- */
-void
-DitaXmlGenerator::writeProlog(const InnerNode* inner)
-{
- if (!inner)
- return;
- writeStartTag(DT_prolog);
- writeMetadataElements(inner,DT_author);
- writeMetadataElement(inner,DT_publisher);
- QString s = getMetadataElement(inner,DT_copyryear);
- QString t = getMetadataElement(inner,DT_copyrholder);
- writeStartTag(DT_copyright);
- writeStartTag(DT_copyryear);
- if (!s.isEmpty())
- xmlWriter().writeAttribute("year",s);
- writeEndTag(); // </copyryear>
- writeStartTag(DT_copyrholder);
- if (!s.isEmpty())
- xmlWriter().writeCharacters(t);
- writeEndTag(); // </copyrholder>
- writeEndTag(); // </copyright>
- s = getMetadataElement(inner,DT_permissions);
- writeStartTag(DT_permissions);
- xmlWriter().writeAttribute("view",s);
- writeEndTag(); // </permissions>
- writeStartTag(DT_metadata);
- QStringList sl = getMetadataElements(inner,DT_audience);
- if (!sl.isEmpty()) {
- for (int i=0; i<sl.size(); ++i) {
- writeStartTag(DT_audience);
- xmlWriter().writeAttribute("type",sl[i]);
- writeEndTag(); // </audience>
- }
- }
- if (!writeMetadataElement(inner,DT_category,false)) {
- writeStartTag(DT_category);
- QString category = "Page";
- if (inner->isClass())
- category = "Class reference";
- if (inner->isQmlType())
- category = "QML Reference";
- else if (inner->isQmlBasicType())
- category = "QML Basic Type";
- else if (inner->isNamespace())
- category = "Namespace";
- else if (inner->isModule())
- category = "Module";
- else if (inner->isQmlModule())
- category = "QML Module";
- else if (inner->isGroup())
- category = "Group";
- else if (inner->isDocNode()) {
- if (inner->isHeaderFile())
- category = "Header File";
- else if (inner->subType() == Node::File)
- category = "Example Source File";
- else if (inner->isExample())
- category = "Example";
- else if (inner->subType() == Node::Image)
- category = "Image";
- else if (inner->subType() == Node::Page)
- category = "Page";
- else if (inner->isExternalPage())
- category = "External Page"; // Is this necessary?
- }
- xmlWriter().writeCharacters(category);
- writeEndTag(); // </category>
- }
- if (vrm.size() > 0) {
- writeStartTag(DT_prodinfo);
- if (!writeMetadataElement(inner,DT_prodname,false)) {
- writeStartTag(DT_prodname);
- xmlWriter().writeCharacters(projectDescription);
- writeEndTag(); // </prodname>
- }
- writeStartTag(DT_vrmlist);
- writeStartTag(DT_vrm);
- if (vrm.size() > 0)
- xmlWriter().writeAttribute("version",vrm[0]);
- if (vrm.size() > 1)
- xmlWriter().writeAttribute("release",vrm[1]);
- if (vrm.size() > 2)
- xmlWriter().writeAttribute("modification",vrm[2]);
- writeEndTag(); // <vrm>
- writeEndTag(); // <vrmlist>
- if (!writeMetadataElement(inner,DT_component,false)) {
- QString component = inner->moduleName();
- if (!component.isEmpty()) {
- writeStartTag(DT_component);
- xmlWriter().writeCharacters(component);
- writeEndTag(); // </component>
- }
- }
- writeEndTag(); // </prodinfo>
- }
- const QStringMultiMap& metaTagMap = inner->doc().metaTagMap();
- QMapIterator<QString, QString> i(metaTagMap);
- while (i.hasNext()) {
- i.next();
- writeStartTag(DT_othermeta);
- xmlWriter().writeAttribute("name",i.key());
- xmlWriter().writeAttribute("content",i.value());
- writeEndTag(); // </othermeta>
- }
- if ((tagStack.first() == DT_cxxClass && !inner->includes().isEmpty()) || inner->isHeaderFile()) {
- writeStartTag(DT_othermeta);
- xmlWriter().writeAttribute("name","includeFile");
- QString text;
- QStringList::ConstIterator i = inner->includes().constBegin();
- while (i != inner->includes().constEnd()) {
- if ((*i).startsWith(QLatin1Char('<')) && (*i).endsWith(QLatin1Char('>')))
- text += *i;
- else
- text += QLatin1Char('<') + *i + QLatin1Char('>');
- ++i;
- if (i != inner->includes().constEnd())
- text += "\n";
- }
- xmlWriter().writeAttribute("content",text);
- writeEndTag(); // </othermeta>
- }
- writeEndTag(); // </metadata>
- writeEndTag(); // </prolog>
-}
-
-/*!
- This function should be called to write the \a href attribute
- if the href could be an \e http or \e ftp link. If \a href is
- one or the other, a \e scope attribute is also writen, with
- value \e external.
- */
-void DitaXmlGenerator::writeHrefAttribute(const QString& href)
-{
- xmlWriter().writeAttribute("href", href);
- if (href.startsWith("http:") || href.startsWith("ftp:") ||
- href.startsWith("https:") || href.startsWith("mailto:"))
- xmlWriter().writeAttribute("scope", "external");
-}
-
-/*!
- Strips the markup tags from \a src, when we are trying to
- create an \e{id} attribute. Returns the stripped text.
- */
-QString DitaXmlGenerator::stripMarkup(const QString& src) const
-{
- QString text;
- const QChar charAt = '@';
- const QChar charSlash = '/';
- const QChar charLangle = '<';
- const QChar charRangle = '>';
-
- int n = src.size();
- int i = 0;
- while (i < n) {
- if (src.at(i) == charLangle) {
- ++i;
- if (src.at(i) == charAt || (src.at(i) == charSlash && src.at(i+1) == charAt)) {
- while (i < n && src.at(i) != charRangle)
- ++i;
- ++i;
- }
- else {
- text += charLangle;
- }
- }
- else
- text += src.at(i++);
- }
- return text;
-}
-
-QT_END_NAMESPACE
diff --git a/src/tools/qdoc/ditaxmlgenerator.h b/src/tools/qdoc/ditaxmlgenerator.h
deleted file mode 100644
index 4514f19bc8..0000000000
--- a/src/tools/qdoc/ditaxmlgenerator.h
+++ /dev/null
@@ -1,520 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the tools applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL21$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** 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 or version 3 as published by the Free
-** Software Foundation and appearing in the file LICENSE.LGPLv21 and
-** LICENSE.LGPLv3 included in the packaging of this file. Please review the
-** following information to ensure the GNU Lesser General Public License
-** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef DITAXMLGENERATOR_H
-#define DITAXMLGENERATOR_H
-
-#include <qmap.h>
-#include <qregexp.h>
-#include <qxmlstream.h>
-#include "codemarker.h"
-#include "generator.h"
-
-QT_BEGIN_NAMESPACE
-
-typedef QMap<QString, QString> GuidMap;
-typedef QMap<QString, GuidMap*> GuidMaps;
-
-class DitaXmlGenerator : public Generator
-{
- Q_DECLARE_TR_FUNCTIONS(QDoc::DitaXmlGenerator)
-
-public:
- enum SinceType {
- Namespace,
- Class,
- MemberFunction,
- NamespaceFunction,
- GlobalFunction,
- Macro,
- Enum,
- Typedef,
- Property,
- Variable,
- QmlClass,
- QmlProperty,
- QmlSignal,
- QmlSignalHandler,
- QmlMethod,
- LastSinceType
- };
-
- enum DitaTag {
- DT_NONE,
- DT_alt,
- DT_apiData,
- DT_apiDef,
- DT_apiDefItem,
- DT_apiDesc,
- DT_apiDetail,
- DT_apiItemName,
- DT_APIMap,
- DT_apiName,
- DT_apiRef,
- DT_apiRelation,
- DT_audience,
- DT_author,
- DT_b,
- DT_body,
- DT_bodydiv,
- DT_brand,
- DT_category,
- DT_codeblock,
- DT_colspec,
- DT_comment,
- DT_component,
- DT_copyrholder,
- DT_copyright,
- DT_copyryear,
- DT_created,
- DT_critdates,
- DT_cxxAPIMap,
- DT_cxxClass,
- DT_cxxClassAbstract,
- DT_cxxClassAccessSpecifier,
- DT_cxxClassAPIItemLocation,
- DT_cxxClassBaseClass,
- DT_cxxClassDeclarationFile,
- DT_cxxClassDeclarationFileLine,
- DT_cxxClassDeclarationFileLineStart,
- DT_cxxClassDeclarationFileLineEnd,
- DT_cxxClassDefinition,
- DT_cxxClassDerivation,
- DT_cxxClassDerivationAccessSpecifier,
- DT_cxxClassDerivations,
- DT_cxxClassDetail,
- DT_cxxClassNested,
- DT_cxxClassNestedClass,
- DT_cxxClassNestedDetail,
- DT_cxxDefine,
- DT_cxxDefineAccessSpecifier,
- DT_cxxDefineAPIItemLocation,
- DT_cxxDefineDeclarationFile,
- DT_cxxDefineDeclarationFileLine,
- DT_cxxDefineDefinition,
- DT_cxxDefineDetail,
- DT_cxxDefineNameLookup,
- DT_cxxDefineParameter,
- DT_cxxDefineParameterDeclarationName,
- DT_cxxDefineParameters,
- DT_cxxDefinePrototype,
- DT_cxxDefineReimplemented,
- DT_cxxEnumeration,
- DT_cxxEnumerationAccessSpecifier,
- DT_cxxEnumerationAPIItemLocation,
- DT_cxxEnumerationDeclarationFile,
- DT_cxxEnumerationDeclarationFileLine,
- DT_cxxEnumerationDeclarationFileLineStart,
- DT_cxxEnumerationDeclarationFileLineEnd,
- DT_cxxEnumerationDefinition,
- DT_cxxEnumerationDetail,
- DT_cxxEnumerationNameLookup,
- DT_cxxEnumerationPrototype,
- DT_cxxEnumerationScopedName,
- DT_cxxEnumerator,
- DT_cxxEnumeratorInitialiser,
- DT_cxxEnumeratorNameLookup,
- DT_cxxEnumeratorPrototype,
- DT_cxxEnumerators,
- DT_cxxEnumeratorScopedName,
- DT_cxxFunction,
- DT_cxxFunctionAccessSpecifier,
- DT_cxxFunctionAPIItemLocation,
- DT_cxxFunctionConst,
- DT_cxxFunctionConstructor,
- DT_cxxFunctionDeclarationFile,
- DT_cxxFunctionDeclarationFileLine,
- DT_cxxFunctionDeclaredType,
- DT_cxxFunctionDefinition,
- DT_cxxFunctionDestructor,
- DT_cxxFunctionDetail,
- DT_cxxFunctionNameLookup,
- DT_cxxFunctionParameter,
- DT_cxxFunctionParameterDeclarationName,
- DT_cxxFunctionParameterDeclaredType,
- DT_cxxFunctionParameterDefaultValue,
- DT_cxxFunctionParameters,
- DT_cxxFunctionPrototype,
- DT_cxxFunctionPureVirtual,
- DT_cxxFunctionReimplemented,
- DT_cxxFunctionScopedName,
- DT_cxxFunctionStorageClassSpecifierStatic,
- DT_cxxFunctionVirtual,
- DT_cxxTypedef,
- DT_cxxTypedefAccessSpecifier,
- DT_cxxTypedefAPIItemLocation,
- DT_cxxTypedefDeclarationFile,
- DT_cxxTypedefDeclarationFileLine,
- DT_cxxTypedefDefinition,
- DT_cxxTypedefDetail,
- DT_cxxTypedefNameLookup,
- DT_cxxTypedefScopedName,
- DT_cxxVariable,
- DT_cxxVariableAccessSpecifier,
- DT_cxxVariableAPIItemLocation,
- DT_cxxVariableDeclarationFile,
- DT_cxxVariableDeclarationFileLine,
- DT_cxxVariableDeclaredType,
- DT_cxxVariableDefinition,
- DT_cxxVariableDetail,
- DT_cxxVariableNameLookup,
- DT_cxxVariablePrototype,
- DT_cxxVariableReimplemented,
- DT_cxxVariableScopedName,
- DT_cxxVariableStorageClassSpecifierStatic,
- DT_data,
- DT_dataabout,
- DT_dd,
- DT_dl,
- DT_dlentry,
- DT_dt,
- DT_entry,
- DT_fig,
- DT_i,
- DT_image,
- DT_keyword,
- DT_keywords,
- DT_li,
- DT_link,
- DT_linktext,
- DT_lq,
- DT_map,
- DT_mapref,
- DT_metadata,
- DT_note,
- DT_ol,
- DT_othermeta,
- DT_p,
- DT_parameter,
- DT_permissions,
- DT_ph,
- DT_platform,
- DT_pre,
- DT_prodinfo,
- DT_prodname,
- DT_prolog,
- DT_publisher,
- DT_qmlAttached,
- DT_qmlDetail,
- DT_qmlImportModule,
- DT_qmlInheritedBy,
- DT_qmlInherits,
- DT_qmlInstantiates,
- DT_qmlMethod,
- DT_qmlMethodDef,
- DT_qmlMethodDetail,
- DT_qmlName,
- DT_qmlProperty,
- DT_qmlPropertyDef,
- DT_qmlPropertyDetail,
- DT_qmlPropertyGroup,
- DT_qmlPropertyGroupDef,
- DT_qmlPropertyGroupDetail,
- DT_qmlQualifier,
- DT_qmlSignal,
- DT_qmlSignalDef,
- DT_qmlSignalDetail,
- DT_qmlSignalHandler,
- DT_qmlSignalHandlerDEf,
- DT_qmlSignalHandlerDetail,
- DT_qmlSignature,
- DT_qmlSince,
- DT_qmlType,
- DT_qmlTypeDef,
- DT_qmlTypeDetail,
- DT_relatedLinks,
- DT_resourceid,
- DT_revised,
- DT_row,
- DT_section,
- DT_sectiondiv,
- DT_shortdesc,
- DT_simpletable,
- DT_source,
- DT_stentry,
- DT_sthead,
- DT_strow,
- DT_sub,
- DT_sup,
- DT_table,
- DT_tbody,
- DT_tgroup,
- DT_thead,
- DT_title,
- DT_tm,
- DT_topic,
- DT_topicmeta,
- DT_topicref,
- DT_tt,
- DT_u,
- DT_uicontrol,
- DT_ul,
- DT_unknown,
- DT_vrm,
- DT_vrmlist,
- DT_xref,
- DT_LAST
- };
-
-public:
- DitaXmlGenerator();
- ~DitaXmlGenerator();
-
- virtual void initializeGenerator(const Config& config);
- virtual void terminateGenerator();
- virtual QString format();
- virtual bool canHandleFormat(const QString& format);
- virtual void generateDocs();
-
- QString protectEnc(const QString& string);
- static QString protect(const QString& string, const QString& encoding = "ISO-8859-1");
- static QString cleanRef(const QString& ref);
- static QString sinceTitle(int i) { return sinceTitles[i]; }
-
-protected:
- virtual int generateAtom(const Atom* atom,
- const Node* relative,
- CodeMarker* marker);
- virtual void generateClassLikeNode(InnerNode* inner, CodeMarker* marker);
- virtual void generateQmlBasicTypePage(QmlBasicTypeNode* qbtn, CodeMarker* marker);
- virtual void generateDocNode(DocNode* dn, CodeMarker* marker);
- virtual void generateCollectionNode(CollectionNode* cn, CodeMarker* marker);
- virtual QString fileExtension() const;
- virtual QString guidForNode(const Node* node);
- virtual QString linkForNode(const Node* node, const Node* relative);
-
- void writeXrefListItem(const QString& link, const QString& text);
- QString fullQualification(const Node* n);
-
- void writeCharacters(const QString& text);
- void writeDerivations(const ClassNode* cn);
- void writeLocation(const Node* n);
- void writeFunctions(const Section& s,
- const InnerNode* parent,
- CodeMarker* marker,
- const QString& attribute = QString());
- void writeNestedClasses(const Section& s, const Node* n);
- void replaceTypesWithLinks(const Node* n, const InnerNode* parent, QString& src);
- void writeParameters(const FunctionNode* fn, const InnerNode* parent, CodeMarker* marker);
- void writeEnumerations(const Section& s,
- CodeMarker* marker,
- const QString& attribute = QString());
- void writeTypedefs(const Section& s,
- CodeMarker* marker,
- const QString& attribute = QString());
- void writeDataMembers(const Section& s,
- CodeMarker* marker,
- const QString& attribute = QString());
- void writeProperties(const Section& s,
- CodeMarker* marker,
- const QString& attribute = QString());
- void writeMacros(const Section& s,
- CodeMarker* marker,
- const QString& attribute = QString());
- void writePropertyParameter(const QString& tag, const NodeList& nlist);
- void writeRelatedLinks(const Node* dn);
- void writeLink(const Node* node, const QString& tex, const QString& role);
- void writeProlog(const InnerNode* inner);
- bool writeMetadataElement(const InnerNode* inner,
- DitaXmlGenerator::DitaTag t,
- bool force=true);
- bool writeMetadataElements(const InnerNode* inner, DitaXmlGenerator::DitaTag t);
- void writeHrefAttribute(const QString& href);
- QString getMetadataElement(const InnerNode* inner, DitaXmlGenerator::DitaTag t);
- QStringList getMetadataElements(const InnerNode* inner, DitaXmlGenerator::DitaTag t);
-
-private:
- enum SubTitleSize { SmallSubTitle, LargeSubTitle };
-
- const QPair<QString,QString> anchorForNode(const Node* node);
- void generateHeader(const Node* node, const QString& name);
- void generateBrief(const Node* node, CodeMarker* marker);
- void generateTableOfContents(const Node* node,
- CodeMarker* marker,
- Doc::Sections sectioningUnit,
- int numColumns,
- const Node* relative = 0);
- void generateLowStatusMembers(InnerNode* inner, CodeMarker* marker, CodeMarker::Status status);
- void generateClassHierarchy(const Node* relative, NodeMap& classMap);
- void generateAnnotatedList(const Node* relative, CodeMarker* marker, const NodeMap& nodeMap);
- void generateAnnotatedList(const Node* relative, CodeMarker* marker, const NodeList& nodes);
- void generateCompactList(ListType listType,
- const Node* relative,
- const NodeMap& classMap,
- bool includeAlphabet,
- QString commonPrefix);
- void generateFunctionIndex(const Node* relative);
- void generateLegaleseList(const Node* relative, CodeMarker* marker);
- void generateOverviewList(const Node* relative);
-
- void generateQmlSummary(const Section& section,
- const Node* relative,
- CodeMarker* marker);
- void generateQmlItem(const Node* node,
- const Node* relative,
- CodeMarker* marker,
- bool summary);
- void startQmlProperty(QmlPropertyNode* qpn,
- const InnerNode* relative,
- CodeMarker* marker);
- void writeQmlRef(DitaTag tag,
- Node* node,
- const InnerNode* relative,
- CodeMarker* marker);
- void generateDetailedQmlMember(Node* node,
- const InnerNode* relative,
- CodeMarker* marker);
- void generateQmlInherits(QmlClassNode* qcn, CodeMarker* marker);
- void generateQmlInheritedBy(const QmlClassNode* qcn, CodeMarker* marker);
- void generateQmlInstantiates(QmlClassNode* qcn, CodeMarker* marker);
- void generateInstantiatedBy(ClassNode* cn, CodeMarker* marker);
- void generateQmlModuleDef(QmlClassNode* qcn);
- void generateQmlSince(const Node* node);
-
- void generateSection(const NodeList& nl,
- const Node* relative,
- CodeMarker* marker,
- CodeMarker::SynopsisStyle style);
- QString getMarkedUpSynopsis(const Node* node,
- const Node* relative,
- CodeMarker* marker,
- CodeMarker::SynopsisStyle style);
- void generateSectionInheritedList(const Section& section, const Node* relative);
- void writeText(const QString& markedCode, const Node* relative);
-
- void generateFullName(const Node* apparentNode, const Node* relative, const Node* actualNode = 0);
- void generateLink(const Atom* atom, CodeMarker* marker);
- void generateStatus(const Node* node, CodeMarker* marker);
-
- QString getLink(const Atom *atom, const Node *relative, const Node** node);
- QString getAutoLink(const Atom *atom, const Node *relative, const Node** node);
-
- QString registerRef(const QString& ref);
- virtual QString fileBase(const Node *node) const;
- QString fileName(const Node *node);
- static int hOffset(const Node *node);
- static bool isThreeColumnEnumValueTable(const Atom *atom);
-#ifdef GENERATE_MAC_REFS
- void generateMacRef(const Node* node, CodeMarker* marker);
-#endif
- void beginLink(const QString& link);
- void endLink();
- QString writeGuidAttribute(QString text);
- void writeGuidAttribute(Node* node);
- QString lookupGuid(QString text);
- QString lookupGuid(const QString& fileName, const QString& text);
- GuidMap* lookupGuidMap(const QString& fileName);
- virtual void beginSubPage(const InnerNode* node, const QString& fileName);
- virtual void endSubPage();
- virtual void generateInnerNode(InnerNode* node);
- QXmlStreamWriter& xmlWriter();
- void writeApiDesc(const Node* node, CodeMarker* marker, const QString& title);
- void addLink(const QString& href, const QStringRef& text, DitaTag t = DT_xref);
- void writeDitaMap();
- void writeDitaMap(const DitaMapNode* node);
- void writeStartTag(DitaTag t);
- bool writeEndTag(DitaTag t=DT_NONE);
- DitaTag currentTag();
- void clearSectionNesting() { sectionNestingLevel = 0; }
- int enterDesc(DitaTag tag, const QString& outputclass, const QString& title);
- int enterSection(const QString& outputclass, const QString& title);
- int leaveSection();
- bool inSection() const { return (sectionNestingLevel > 0); }
- int currentSectionNestingLevel() const { return sectionNestingLevel; }
- QStringList metadataDefault(DitaTag t) const;
- QString stripMarkup(const QString& src) const;
- Node* collectNodesByTypeAndSubtype(const InnerNode* parent);
- void writeDitaRefs(const DitaRefList& ditarefs);
- void writeTopicrefs(NodeMultiMap* nmm, const QString& navtitle, Node* headingnode = 0);
- bool isDuplicate(NodeMultiMap* nmm, const QString& key, Node* node);
- void debugPara(const QString& t);
- QString ditaXmlHref(Node* n);
-
-private:
- /*
- These flags indicate which elements the generator
- is currently outputting.
- */
- bool inDetailedDescription;
- bool inLegaleseText;
- bool inObsoleteLink;
- bool inTableBody;
-
- bool noLinks;
- bool obsoleteLinks;
-
- int divNestingLevel;
- int sectionNestingLevel;
- int tableColumnCount;
- int currentColumn;
-
- QRegExp funcLeftParen;
- QString style;
- QString postHeader;
- QString postPostHeader;
- QString footer;
- QString address;
- bool pleaseGenerateMacRef;
- QString project;
- QString projectDescription;
- QString projectUrl;
- QString navigationLinks;
- QString version;
- QStringList vrm;
- QStringList stylesheets;
- QStringList customHeadElements;
- QMap<QString, QString> refMap;
- QMap<QString, QString> name2guidMap;
- GuidMaps guidMaps;
- static int id;
- static QString ditaTags[];
- QStack<QXmlStreamWriter*> xmlWriterStack;
- QStack<DitaTag> tagStack;
- ConfigVarMultimap metadataDefaults;
- QVector<NodeMultiMap*> nodeTypeMaps;
- QVector<NodeMultiMap*> nodeSubtypeMaps;
- QVector<NodeMultiMap*> pageTypeMaps;
-};
-
-#define DITAXMLGENERATOR_ADDRESS "address"
-#define DITAXMLGENERATOR_FOOTER "footer"
-#define DITAXMLGENERATOR_GENERATEMACREFS "generatemacrefs"
-#define DITAXMLGENERATOR_POSTHEADER "postheader"
-#define DITAXMLGENERATOR_POSTPOSTHEADER "postpostheader"
-#define DITAXMLGENERATOR_STYLE "style"
-#define DITAXMLGENERATOR_STYLESHEETS "stylesheets"
-#define DITAXMLGENERATOR_CUSTOMHEADELEMENTS "customheadelements"
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/tools/qdoc/doc.cpp b/src/tools/qdoc/doc.cpp
index 5a3ad959d2..7965ea898f 100644
--- a/src/tools/qdoc/doc.cpp
+++ b/src/tools/qdoc/doc.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
@@ -1611,12 +1611,14 @@ void DocParser::parse(const QString& source,
QString word = in.mid(startPos, pos - startPos);
// is word a C++ symbol or an English word?
if ((numInternalUppercase >= 1 && numLowercase >= 2)
- || numStrangeSymbols >= 1) {
- append(Atom::AutoLink, word);
+ || numStrangeSymbols > 0) {
+ if (word.startsWith(QString("__")))
+ appendWord(word);
+ else
+ append(Atom::AutoLink, word);
}
- else {
+ else
appendWord(word);
- }
}
}
}
@@ -1690,12 +1692,15 @@ void DocParser::insertTarget(const QString &target, bool keyword)
}
else {
targetMap_.insert(target, location());
- append(Atom::Target, target);
priv->constructExtra();
- if (keyword)
+ if (keyword) {
+ append(Atom::Keyword, target);
priv->extra->keywords_.append(priv->text.lastAtom());
- else
+ }
+ else {
+ append(Atom::Target, target);
priv->extra->targets_.append(priv->text.lastAtom());
+ }
}
}
@@ -1991,7 +1996,7 @@ void DocParser::append(const QString &string)
Atom::Type lastType = priv->text.lastAtom()->type();
if ((lastType == Atom::Code) && priv->text.lastAtom()->string().endsWith(QLatin1String("\n\n")))
priv->text.lastAtom()->chopString();
- priv->text << Atom(string);
+ priv->text << Atom(string); // The Atom type is Link.
}
void DocParser::append(Atom::Type type, const QString& p1, const QString& p2)
@@ -2008,7 +2013,7 @@ void DocParser::append(const QString& p1, const QString& p2)
if ((lastType == Atom::Code) && priv->text.lastAtom()->string().endsWith(QLatin1String("\n\n")))
priv->text.lastAtom()->chopString();
if (p2.isEmpty())
- priv->text << Atom(p1);
+ priv->text << Atom(p1); // The Atom type is Link.
else
priv->text << LinkAtom(p1, p2);
}
@@ -2319,7 +2324,10 @@ QString DocParser::getBracedArgument(bool verbatim)
}
break;
default:
- arg += in[pos];
+ if (in[pos].isSpace() && !verbatim)
+ arg += QChar(' ');
+ else
+ arg += in[pos];
pos++;
}
}
@@ -2813,21 +2821,6 @@ QString DocParser::slashed(const QString& str)
return QLatin1Char('/') + result + QLatin1Char('/');
}
-#define COMMAND_BRIEF Doc::alias("brief")
-#define COMMAND_QMLBRIEF Doc::alias("qmlbrief")
-
-#if 0
-Doc::Doc(const Location& start_loc,
- const Location& end_loc,
- const QString& source,
- const QSet<QString>& metaCommandSet)
-{
- priv = new DocPrivate(start_loc,end_loc,source);
- DocParser parser;
- parser.parse(source,priv,metaCommandSet,QSet<QString>());
-}
-#endif
-
/*!
Parse the qdoc comment \a source. Build up a list of all the topic
commands found including their arguments. This constructor is used
@@ -3150,7 +3143,7 @@ void Doc::initialize(const Config& config)
DocParser::sourceDirs = config.getCanonicalPathList(CONFIG_SOURCEDIRS);
DocParser::quoting = config.getBool(CONFIG_QUOTINGINFORMATION);
- QmlClassNode::qmlOnly = config.getBool(CONFIG_QMLONLY);
+ QmlTypeNode::qmlOnly = config.getBool(CONFIG_QMLONLY);
QStringMap reverseAliasMap;
config_ = &config;
@@ -3234,6 +3227,9 @@ void Doc::initialize(const Config& config)
}
}
+/*!
+ All the heap allocated variables are deleted.
+ */
void Doc::terminate()
{
DocParser::exampleFiles.clear();
diff --git a/src/tools/qdoc/doc.h b/src/tools/qdoc/doc.h
index 1c13c0f026..80d47287bb 100644
--- a/src/tools/qdoc/doc.h
+++ b/src/tools/qdoc/doc.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
@@ -64,7 +64,7 @@ struct Topic
QString topic;
QString args;
Topic() { }
- Topic(QString& t, QString a) : topic(t), args(a) { }
+ Topic(QString& t, const QString &a) : topic(t), args(a) { }
bool isEmpty() const { return topic.isEmpty(); }
void clear() { topic.clear(); args.clear(); }
};
@@ -97,9 +97,9 @@ public:
TopicRef() { }
~TopicRef();
- virtual bool isMapRef() const { return false; }
- virtual const DitaRefList* subrefs() const { return &subrefs_; }
- virtual void appendSubref(DitaRef* t) { subrefs_.append(t); }
+ virtual bool isMapRef() const Q_DECL_OVERRIDE { return false; }
+ virtual const DitaRefList* subrefs() const Q_DECL_OVERRIDE { return &subrefs_; }
+ virtual void appendSubref(DitaRef* t) Q_DECL_OVERRIDE { subrefs_.append(t); }
private:
DitaRefList subrefs_;
@@ -111,7 +111,7 @@ public:
MapRef() { }
~MapRef() { }
- virtual bool isMapRef() const { return true; }
+ virtual bool isMapRef() const Q_DECL_OVERRIDE { return true; }
};
class Doc
diff --git a/src/tools/qdoc/doc/corefeatures.qdoc b/src/tools/qdoc/doc/corefeatures.qdoc
index e4d48c52d5..bbee7410fe 100644
--- a/src/tools/qdoc/doc/corefeatures.qdoc
+++ b/src/tools/qdoc/doc/corefeatures.qdoc
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
@@ -10,15 +10,15 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** 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. Please review the following information to ensure
+** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: http://www.gnu.org/copyleft/fdl.html.
** $QT_END_LICENSE$
diff --git a/src/tools/qdoc/doc/examples/componentset/ProgressBar.qml b/src/tools/qdoc/doc/examples/componentset/ProgressBar.qml
index f7aeb29865..c4e8c103e9 100644
--- a/src/tools/qdoc/doc/examples/componentset/ProgressBar.qml
+++ b/src/tools/qdoc/doc/examples/componentset/ProgressBar.qml
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the examples of the Qt Toolkit.
**
@@ -17,8 +17,8 @@
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
-** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
-** of its contributors may be used to endorse or promote products derived
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
diff --git a/src/tools/qdoc/doc/examples/componentset/Switch.qml b/src/tools/qdoc/doc/examples/componentset/Switch.qml
index 7dee33eb3c..7b7e7af31f 100644
--- a/src/tools/qdoc/doc/examples/componentset/Switch.qml
+++ b/src/tools/qdoc/doc/examples/componentset/Switch.qml
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the examples of the Qt Toolkit.
**
@@ -17,8 +17,8 @@
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
-** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
-** of its contributors may be used to endorse or promote products derived
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
diff --git a/src/tools/qdoc/doc/examples/componentset/TabWidget.qml b/src/tools/qdoc/doc/examples/componentset/TabWidget.qml
index 0fbac1604e..008c5e14e7 100644
--- a/src/tools/qdoc/doc/examples/componentset/TabWidget.qml
+++ b/src/tools/qdoc/doc/examples/componentset/TabWidget.qml
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the examples of the Qt Toolkit.
**
@@ -17,8 +17,8 @@
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
-** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
-** of its contributors may be used to endorse or promote products derived
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
diff --git a/src/tools/qdoc/doc/examples/componentset/uicomponents.qdoc.sample b/src/tools/qdoc/doc/examples/componentset/uicomponents.qdoc.sample
index 4b16dfa14f..7a14f88f45 100644
--- a/src/tools/qdoc/doc/examples/componentset/uicomponents.qdoc.sample
+++ b/src/tools/qdoc/doc/examples/componentset/uicomponents.qdoc.sample
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
@@ -10,15 +10,15 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** 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. Please review the following information to ensure
+** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: http://www.gnu.org/copyleft/fdl.html.
** $QT_END_LICENSE$
diff --git a/src/tools/qdoc/doc/examples/cpp.qdoc.sample b/src/tools/qdoc/doc/examples/cpp.qdoc.sample
index e496bbc278..38a131783b 100644
--- a/src/tools/qdoc/doc/examples/cpp.qdoc.sample
+++ b/src/tools/qdoc/doc/examples/cpp.qdoc.sample
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
@@ -10,15 +10,15 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** 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. Please review the following information to ensure
+** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: http://www.gnu.org/copyleft/fdl.html.
** $QT_END_LICENSE$
diff --git a/src/tools/qdoc/doc/examples/examples.qdoc b/src/tools/qdoc/doc/examples/examples.qdoc
index af7ff591b6..777c869c65 100644
--- a/src/tools/qdoc/doc/examples/examples.qdoc
+++ b/src/tools/qdoc/doc/examples/examples.qdoc
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
@@ -10,15 +10,15 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** 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. Please review the following information to ensure
+** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: http://www.gnu.org/copyleft/fdl.html.
** $QT_END_LICENSE$
diff --git a/src/tools/qdoc/doc/examples/main.cpp b/src/tools/qdoc/doc/examples/main.cpp
index 4a594feb44..849405e0ae 100644
--- a/src/tools/qdoc/doc/examples/main.cpp
+++ b/src/tools/qdoc/doc/examples/main.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
diff --git a/src/tools/qdoc/doc/examples/mainwindow.cpp b/src/tools/qdoc/doc/examples/mainwindow.cpp
index 9a6cdd8a97..68b878c07e 100644
--- a/src/tools/qdoc/doc/examples/mainwindow.cpp
+++ b/src/tools/qdoc/doc/examples/mainwindow.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
@@ -136,7 +136,7 @@ void MainWindow::createActions()
openAct->setShortcuts(QKeySequence::Open);
connect(openAct, SIGNAL(triggered()), this, SLOT(open()));
- foreach (QByteArray format, QImageWriter::supportedImageFormats()) {
+ foreach (const QByteArray &format, QImageWriter::supportedImageFormats()) {
QString text = tr("%1...").arg(QString(format).toUpper());
QAction *action = new QAction(text, this);
diff --git a/src/tools/qdoc/doc/examples/qml.qdoc.sample b/src/tools/qdoc/doc/examples/qml.qdoc.sample
index 11713b4e4d..cacd912242 100644
--- a/src/tools/qdoc/doc/examples/qml.qdoc.sample
+++ b/src/tools/qdoc/doc/examples/qml.qdoc.sample
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
@@ -10,15 +10,15 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** 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. Please review the following information to ensure
+** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: http://www.gnu.org/copyleft/fdl.html.
** $QT_END_LICENSE$
diff --git a/src/tools/qdoc/doc/examples/samples.qdocinc b/src/tools/qdoc/doc/examples/samples.qdocinc
index 2f8f49701b..d5679fdcd8 100644
--- a/src/tools/qdoc/doc/examples/samples.qdocinc
+++ b/src/tools/qdoc/doc/examples/samples.qdocinc
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
@@ -10,15 +10,15 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** 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. Please review the following information to ensure
+** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: http://www.gnu.org/copyleft/fdl.html.
** $QT_END_LICENSE$
diff --git a/src/tools/qdoc/doc/images/link-to-qquickitem.png b/src/tools/qdoc/doc/images/link-to-qquickitem.png
new file mode 100644
index 0000000000..00e03c3717
--- /dev/null
+++ b/src/tools/qdoc/doc/images/link-to-qquickitem.png
Binary files differ
diff --git a/src/tools/qdoc/doc/images/links-to-broken-links.png b/src/tools/qdoc/doc/images/links-to-broken-links.png
new file mode 100644
index 0000000000..775143bd4a
--- /dev/null
+++ b/src/tools/qdoc/doc/images/links-to-broken-links.png
Binary files differ
diff --git a/src/tools/qdoc/doc/images/links-to-links.png b/src/tools/qdoc/doc/images/links-to-links.png
new file mode 100644
index 0000000000..9d2cc2fae5
--- /dev/null
+++ b/src/tools/qdoc/doc/images/links-to-links.png
Binary files differ
diff --git a/src/tools/qdoc/doc/images/qa-table.png b/src/tools/qdoc/doc/images/qa-table.png
new file mode 100644
index 0000000000..5818739fac
--- /dev/null
+++ b/src/tools/qdoc/doc/images/qa-table.png
Binary files differ
diff --git a/src/tools/qdoc/doc/qa-pages.qdoc b/src/tools/qdoc/doc/qa-pages.qdoc
new file mode 100644
index 0000000000..a96673901a
--- /dev/null
+++ b/src/tools/qdoc/doc/qa-pages.qdoc
@@ -0,0 +1,109 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Free Documentation License Usage
+** 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. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \page 28-qdoc-qa-pages.html
+ \previouspage Generating DITA XML Output
+ \contentspage QDoc Manual
+ \nextpage QDoc Manual
+
+ \title QA Pages
+
+ qdoc can generate some extra HTML pages that can be useful for
+ debugging qdoc documentation. These \e QA pages make it easier for
+ those who write documentation to find links that either go to the
+ wrong targets or don't go anywhere at all.
+
+ \section2 Generating the QA Pages
+
+ Add \c {-write-qa-pages} to the command line to tell qdoc to
+ generate the QA pages. If this option is not provided, the QA
+ pages will not be generated, and previolusly generated QA pages
+ will be deleted.
+
+ \section2 Finding the Module's Main QA Page
+
+ The main QA page for a module is not linked into the module's
+ generated documentation, but it is located in the same output
+ directory. To find the top-level QA page for module \e {xxx}, set
+ your browser to the qdoc output directory for module \e {xxx}.
+ Several files whose names begin with \e {aaa} appear at the top of
+ the list. These are the QA pages for module \e{xxx}. The file
+ names begin with \e {aaa} to ensure that they are easy to find at
+ the top of the directory.
+
+ For module \e{xxx}, find the file \e{aaa-xxx-qa-page.html}. This
+ is the top-level QA page for module \e{xxx}. Load that file into
+ the browser. The top-level QA page shows a table that contains
+ links to several QA sub-pages.
+
+ For example, the main QA page for QtCore is \c{aaa-qtcore-qa-page.html}.
+ This was the table for QtCore at one point:
+
+ \image qa-table.png
+
+ Each table entry shows the number of links from QtCore to some
+ other module, except for the last entry, which shows the number of
+ broken links in QtCore. Click the \b qtquick entry to load the QA
+ subpage showing the links from QtCore to QtQuick.
+
+ \section2 Links To Links Page
+
+ Clicking the \b qtquick table entry on the main QA page for QtCore
+ loads the QA subpage showing a table containing all the links from
+ QtCore to QtQuick. The table contains all the links constructed
+ with the \l {l-command} {\\l command}, as well as the autolinks.
+
+ \image links-to-links.png
+
+ At the time this table was generated, there were six links from
+ QtCore to QtQuick. The first column of each table entry contains
+ a link to some link in QtCore. The link text as it appears in
+ QtCore is shown. The second and third columns contain the source
+ file name and line number for where qdoc saw the link in a qdoc
+ comment.
+
+ \note The line number will normally refer to the first line of the
+ comment where qdoc saw the link.
+
+ Clicking on a link in the table takes you to that link in the
+ documentation. There the link will be marked with three red
+ asterisks. For example, clicking on the link in the fifth table
+ entry takes you here:
+
+ \image link-to-qquickitem.png
+
+ The link is marked with three red asterisks. Now you can click on
+ the actual link to check that it goes to the correct place. In
+ this case, the link should go to the reference page for the
+ QQuickItem class. You can check each link in the table this
+ way. If you find a link that goes to the wrong place, use the
+ source file name and line number to find the link, and fix the
+ problem using the square bracket notation for the \l {l-command}
+ {\\l command}.
+
+ */
diff --git a/src/tools/qdoc/doc/qdoc-guide/qdoc-guide.qdoc b/src/tools/qdoc/doc/qdoc-guide/qdoc-guide.qdoc
index 3c30159895..a8c9c73b5c 100644
--- a/src/tools/qdoc/doc/qdoc-guide/qdoc-guide.qdoc
+++ b/src/tools/qdoc/doc/qdoc-guide/qdoc-guide.qdoc
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
@@ -10,15 +10,15 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** 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. Please review the following information to ensure
+** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: http://www.gnu.org/copyleft/fdl.html.
** $QT_END_LICENSE$
diff --git a/src/tools/qdoc/doc/qdoc-guide/qtwritingstyle-cpp.qdoc b/src/tools/qdoc/doc/qdoc-guide/qtwritingstyle-cpp.qdoc
index 291363a22d..8cbf74cd67 100644
--- a/src/tools/qdoc/doc/qdoc-guide/qtwritingstyle-cpp.qdoc
+++ b/src/tools/qdoc/doc/qdoc-guide/qtwritingstyle-cpp.qdoc
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
@@ -10,15 +10,15 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** 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. Please review the following information to ensure
+** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: http://www.gnu.org/copyleft/fdl.html.
** $QT_END_LICENSE$
diff --git a/src/tools/qdoc/doc/qdoc-guide/qtwritingstyle-qml.qdoc b/src/tools/qdoc/doc/qdoc-guide/qtwritingstyle-qml.qdoc
index 7ca0abed71..6955a042c2 100644
--- a/src/tools/qdoc/doc/qdoc-guide/qtwritingstyle-qml.qdoc
+++ b/src/tools/qdoc/doc/qdoc-guide/qtwritingstyle-qml.qdoc
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
@@ -10,15 +10,15 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** 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. Please review the following information to ensure
+** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: http://www.gnu.org/copyleft/fdl.html.
** $QT_END_LICENSE$
diff --git a/src/tools/qdoc/doc/qdoc-manual-DITA.qdoc b/src/tools/qdoc/doc/qdoc-manual-DITA.qdoc
index 4e4bea7556..72882c8eb1 100644
--- a/src/tools/qdoc/doc/qdoc-manual-DITA.qdoc
+++ b/src/tools/qdoc/doc/qdoc-manual-DITA.qdoc
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
@@ -10,15 +10,15 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** 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. Please review the following information to ensure
+** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: http://www.gnu.org/copyleft/fdl.html.
** $QT_END_LICENSE$
diff --git a/src/tools/qdoc/doc/qdoc-manual-cmdindex.qdoc b/src/tools/qdoc/doc/qdoc-manual-cmdindex.qdoc
index a713b2738d..1a68347682 100644
--- a/src/tools/qdoc/doc/qdoc-manual-cmdindex.qdoc
+++ b/src/tools/qdoc/doc/qdoc-manual-cmdindex.qdoc
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
@@ -10,15 +10,15 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** 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. Please review the following information to ensure
+** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: http://www.gnu.org/copyleft/fdl.html.
** $QT_END_LICENSE$
diff --git a/src/tools/qdoc/doc/qdoc-manual-contextcmds.qdoc b/src/tools/qdoc/doc/qdoc-manual-contextcmds.qdoc
index f54254e356..98321f9a39 100644
--- a/src/tools/qdoc/doc/qdoc-manual-contextcmds.qdoc
+++ b/src/tools/qdoc/doc/qdoc-manual-contextcmds.qdoc
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
@@ -10,15 +10,15 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** 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. Please review the following information to ensure
+** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: http://www.gnu.org/copyleft/fdl.html.
** $QT_END_LICENSE$
diff --git a/src/tools/qdoc/doc/qdoc-manual-intro.qdoc b/src/tools/qdoc/doc/qdoc-manual-intro.qdoc
index 636cd6980e..84f9416843 100644
--- a/src/tools/qdoc/doc/qdoc-manual-intro.qdoc
+++ b/src/tools/qdoc/doc/qdoc-manual-intro.qdoc
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
@@ -10,15 +10,15 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** 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. Please review the following information to ensure
+** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: http://www.gnu.org/copyleft/fdl.html.
** $QT_END_LICENSE$
@@ -89,8 +89,8 @@
\section1 Running QDoc
- The current name of the QDoc program is \c {qdoc}. To run qdoc
- from the command line, give it the name of a configuration file:
+ The name of the QDoc program is \c {qdoc}. To run qdoc from the
+ command line, give it the name of a configuration file:
\quotation
\c {$ ../../bin/qdoc ./config.qdocconf}
@@ -107,6 +107,151 @@
See \l{The QDoc Configuration File} for instructions on how to
set up a QDoc configuration file.
+ \section2 Running QDoc in Single Execution Mode
+
+ Beginning with Qt 5.5, a new way to run QDoc is available that
+ reduces the time it takes to generate the Qt5 documentation by as
+ much as 90%. The new way to run QDoc is \e{single execution} mode.
+ Single execution mode is not currently available in the Qt5 build
+ system, which still uses the \e {standard} mode. Single execution
+ mode is only available when you run QDoc yourself, which you will
+ want to do often as you document your module and integrate your
+ documentation with the other Qt modules.
+
+ To run QDoc in single execution mode, add \c {-single-exec} to the
+ command line and pass QDoc a master \c qdocconf file that is
+ simply a list of file paths for qdocconf files of all the Qt5
+ modules. For example:
+
+ \code
+ /Users/me/qt5/qtbase/bin/qdoc -outputdir /Users/me/qt5/qtbase/doc -installdir /Users/me/qt5/qtbase/doc /Users/me/qt5/master.qdocconf -single-exec
+ \endcode
+
+ The qdocconf file, \c {master.qdocconf}, just lists the qdocconf files for all the Qt5 modules to be processed:
+
+ \badcode
+ /Users/me/qt5/qtbase/src/corelib/doc/qtcore.qdocconf
+ /Users/me/qt5/qtbase/src/network/doc/qtnetwork.qdocconf
+ /Users/me/qt5/qtbase/src/sql/doc/qtsql.qdocconf
+ /Users/me/qt5/qtbase/src/xml/doc/qtxml.qdocconf
+ /Users/me/qt5/qtbase/src/testlib/doc/qttestlib.qdocconf
+ /Users/me/qt5/qtbase/src/concurrent/doc/qtconcurrent.qdocconf
+ /Users/me/qt5/qtbase/src/gui/doc/qtgui.qdocconf
+ /Users/me/qt5/qtbase/src/platformheaders/doc/qtplatformheaders.qdocconf
+ /Users/me/qt5/qtbase/src/widgets/doc/qtwidgets.qdocconf
+ /Users/me/qt5/qtbase/src/opengl/doc/qtopengl.qdocconf
+ /Users/me/qt5/qtbase/src/printsupport/doc/qtprintsupport.qdocconf
+ /Users/me/qt5/qtbase/src/tools/qdoc/doc/config/qdoc.qdocconf
+ /Users/me/qt5/qtbase/qmake/doc/qmake.qdocconf
+ /Users/me/qt5/qtsvg/src/svg/doc/qtsvg.qdocconf
+ /Users/me/qt5/qtxmlpatterns/src/xmlpatterns/doc/qtxmlpatterns.qdocconf
+ /Users/me/qt5/qtdeclarative/src/qml/doc/qtqml.qdocconf
+ /Users/me/qt5/qtdeclarative/src/quick/doc/qtquick.qdocconf
+ /Users/me/qt5/qtquickcontrols/src/controls/doc/qtquickcontrols.qdocconf
+ /Users/me/qt5/qtquickcontrols/src/layouts/doc/qtquicklayouts.qdocconf
+ /Users/me/qt5/qtquickcontrols/src/dialogs/doc/qtquickdialogs.qdocconf
+ /Users/me/qt5/qtmultimedia/src/multimedia/doc/qtmultimedia.qdocconf
+ /Users/me/qt5/qtmultimedia/src/multimediawidgets/doc/qtmultimediawidgets.qdocconf
+ /Users/me/qt5/qtactiveqt/src/activeqt/doc/activeqt.qdocconf
+ /Users/me/qt5/qtsensors/src/sensors/doc/qtsensors.qdocconf
+ /Users/me/qt5/qtwebkit/Source/qtwebkit.qdocconf
+ /Users/me/qt5/qttools/src/assistant/help/doc/qthelp.qdocconf
+ /Users/me/qt5/qttools/src/assistant/assistant/doc/qtassistant.qdocconf
+ /Users/me/qt5/qttools/src/designer/src/uitools/doc/qtuitools.qdocconf
+ /Users/me/qt5/qttools/src/designer/src/designer/doc/qtdesigner.qdocconf
+ /Users/me/qt5/qttools/src/linguist/linguist/doc/qtlinguist.qdocconf
+ /Users/me/qt5/qtwebkit-examples/doc/qtwebkitexamples.qdocconf
+ /Users/me/qt5/qtimageformats/src/imageformats/doc/qtimageformats.qdocconf
+ /Users/me/qt5/qtgraphicaleffects/src/effects/doc/qtgraphicaleffects.qdocconf
+ /Users/me/qt5/qtscript/src/script/doc/qtscript.qdocconf
+ /Users/me/qt5/qtscript/src/scripttools/doc/qtscripttools.qdocconf
+ /Users/me/qt5/qtserialport/src/serialport/doc/qtserialport.qdocconf
+ /Users/me/qt5/qtdoc/doc/config/qtdoc.qdocconf
+ \endcode
+
+ \section3 Why Standard Mode Is Slow
+
+ Currently, the Qt5 build system does not use QDoc's \e {single
+ execution} mode for generating the Qt5 documentation. It runs QDoc
+ in the \e {standard} mode. The standard mode was came about
+ because it was the easiest way to get convert the Qt4 QDoc to
+ handle the modularization of Qt in Qt5. In Qt4, QDoc ran once over
+ all the Qt4 sources to generate the HTML documentation for Qt.
+ While generating the Qt documentation, Qt4 QDoc also generated an
+ \e {index file} for Qt. That index file was meant to be used as
+ input to subsequent QDoc runs for generating HTML documentation
+ for other software libraries/products that were based on Qt. The
+ Qt index file allowed QDoc to link documentation written for those
+ other libraries/products to the Qt4 documentation.
+
+ When Qt5 came along, Qt was divided into modules. Since then,
+ many new modules have been added to Qt. As of version 5.5, there
+ are over 40 separate modules in Qt5, each with its own
+ documentation that links to (depends on) the documentation of
+ other Qt modules.
+
+ In \e {standard mode}, QDoc runs twice for each module. The first
+ QDoc run for a particular Qt module, parses all the module's
+ source files and then uses the information to generate the
+ module's index file. It is called the \e{prepare phase} because
+ it \e prepares the module's index file. The second QDoc run for
+ the module also parses all the module's source files and then
+ generates the module's documentation pages. This is called the \e
+ {generate phase} because it generates the module's documentation.
+
+ The module's documentation will likely contain HTML links to the
+ documentation of one or more of the other Qt modules. For example,
+ most Qt5 modules contain links to documentation in QtCore. When a
+ Qt module contains links into the documentation of other Qt
+ module's, that module is said to depend on those other Qt modules.
+ Hence when QDoc runs the \e {generate phase} for that module, it
+ must also load the index files for those modules so it can create
+ those thinks.
+
+ Hence, when the Qt build system generates the Qt documentation, it
+ first runs QDoc once for each module to perform the \e {prepare
+ phase} to generate all the index files. Then it runs QDoc once for
+ each module to perform the \e {generate phase}, where it uses the
+ dependent index files to generate the module's documentation,
+ including any cross-module links it finds. Each execution of
+ QDoc, both \e {prepare phase} and \e {generate phase}, parses
+ all the source files that are included in the module, and in the
+ \e {generate phase} also parses the index files for the dependent
+ modules. Nothing is retained or retainable between QDoc runs.
+
+ \section3 Why Single Execution Mode Is Much Faster
+
+ As the name implies, single execution mode uses a single QDoc
+ process to generate all the Qt5 documentation. The single QDoc
+ process still performs a \e{prepare phase} for each module and
+ then a \e{generate phase} for each module, but there are a few
+ differences. It begins by reading the master qdocconf file. Then
+ it reads each qdocconf file in the master list and performs the
+ \e{prepare phase} for each module. During the \e{prepare phase},
+ all the source files for the module are parsed to build a syntax
+ tree for the module. The module's index file is then generated,
+ although QDoc will not re-read the index files in the \e{generate
+ phase}. The important difference here is that the module's syntax
+ tree is retained after the index file is generated, so that after
+ the \e{prepare phase} has been run for all the modules, QDoc still
+ has all the syntax trees it built.
+
+ QDoc then processes each module again for the \e{generate phase}.
+ But now QDoc doesn't need to re-parse each module's source files,
+ because the module's syntax tree is still in memory. Nor does QDoc
+ need to re-read the index files for the dependent modules, again
+ because it still has the syntax trees for those modules in memry.
+ It remains only to traverse each module's syntax tree to generate
+ the documentation pages.
+
+ Hence, QDoc parses each source file once and only once and doesn't
+ need to read index files. This is what makes single execution mode
+ much faster than the standard mode. It is anticipated that the Qt
+ build system will eventually run QDoc in single execution mode.
+ However, changes to the master qdocconf file might be required, so
+ the method described above for running QDoc in single execution
+ mode might have to change, watch this space for updates.
+
\section1 How QDoc Works
QDoc begins by reading the configuration file you specified on the
diff --git a/src/tools/qdoc/doc/qdoc-manual-markupcmds.qdoc b/src/tools/qdoc/doc/qdoc-manual-markupcmds.qdoc
index 9f719ec3bc..f341699ee8 100644
--- a/src/tools/qdoc/doc/qdoc-manual-markupcmds.qdoc
+++ b/src/tools/qdoc/doc/qdoc-manual-markupcmds.qdoc
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
@@ -10,15 +10,15 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** 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. Please review the following information to ensure
+** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: http://www.gnu.org/copyleft/fdl.html.
** $QT_END_LICENSE$
@@ -1771,9 +1771,15 @@
different kinds of targets. The command's general syntax is:
\code
- \l {link target} {link text}
+ \l [ link criteria ] { link target } { link text }
\endcode
+ ...where the \c {link criteria} in square brackets are optional
+ but may be required when the \c {link target} is ambiguous. See
+ \l {Fixing Ambiguous Links} below.
+
+ Here is an example using the \\l command to link to an external page:
+
\code
/ *!
Read the \l {http://doc.qt.io/qt-5/}
@@ -1877,6 +1883,101 @@
\l {QWidget::} {sizeHint()}
\endquotation
+ \section2 Fixing Ambiguous Links
+
+ Because of the modularization of Qt beginning with Qt 5.0, The
+ possibility that qdoc will have to deal with ambiguous links has
+ increased. An ambiguous link is one that has a matching target in
+ more than one Qt module, e.g. the same section title can appear in
+ more than one Qt module, or the name of a C++ class in one module
+ can also be the name of a QML type in another module. A real
+ example in Qt5 is the name Qt itself. Qt is the name of both a C++
+ namespace in QtCore and a QML type in QtQml.
+
+ Suppose we want to link to the \l {Qt} {Qt C++ namespace}. At the
+ time qdoc generated this HTML page, that link was correct. Does
+ it still go to the C++ namespace? Qdoc generated that link from
+ this link command:
+
+ \list
+ \li \c {\l {Qt} {Qt C++ namespace}}
+ \endlist
+
+ Now suppose we want to link to the \l [QML] {Qt} {Qt QML type}.
+ At the time qdoc generated this HTML page, that link was also
+ correct, but we had to use this link command:
+
+ \list
+ \li \c {\l [QML] {Qt} {Qt QML type}}
+ \endlist
+
+ The \e {QML} in \e {square brackets} tells qdoc to accept a
+ matching target only if the traget is on a QML page. Qdoc actually
+ finds the C++ namespace target first, but since that target is on
+ a C++ page, qdoc ignores it and keeps looking until it finds the
+ same target on a QML page.
+
+ Without the guidance in the \e{\\l command} in the optional \e
+ {square bracket} argument, qdoc links to the first matching target
+ it finds. qdoc can't warn that the link was ambiguous in such
+ cases because it doesn't know that another matching target exists.
+
+ \section2 What arguments can appear in square brackets?
+
+ A link command with square bracket argument has the following syntax:
+ \list
+ \c {\l [QML|CPP|DOC|QtModuleName] {link target} {link text}}
+ \endlist
+
+ The \e {square bracket} argument is only allowed in the \c {\\l
+ (link)} command. The example above shows how \c QML is used as the
+ \e {square brackets} argument to force qdoc to match a QML target.
+ Most often, this will be a QML type, but it can also be a QML
+ member function of property.
+
+ In the example, qdoc didn't need a \e {square bracket} argument to
+ find the Qt C++ namespace page, because that one was the first
+ matching target qdoc found anyway. However, to force qdoc to find
+ a C++ target when a matching QML target gets in the way, \c CPP
+ can be used as the \e {square bracket} argument. For example:
+
+ \list
+ \li \c {\l [CPP] {Qt} {Qt C++ namespace}}
+ \endlist
+
+ ...will force qdoc to ignore the Qt QML type and continue
+ searching until it matches the Qt C++ namespace.
+
+ If the link target is neither a C++ nor a QML entity, \c {DOC} can
+ be used as the \e {square bracket} argument to prevent qdoc from
+ matching either of those. At this writing, there were no cases of
+ ambiguous links where using \c {DOC} was required.
+
+ Often, the documentor knows which Qt module the link target is
+ in. When the module name is known, use the module name as the \e
+ {square bracket} argument. In the example above, if we know that
+ the QML type named Qt is located in the QtQml module, we can write
+ the link command like this:
+
+ \list
+ \li \c {\l [QtQml] {Qt} {Qt QML type}}
+ \endlist
+
+ When a module name is used as the \e {square bracket} argument,
+ qdoc will search for link the target in that module only. This
+ makes searching for link targets more efficient.
+
+ Finally, the module name and entity type arguments can be
+ combined, separated by a blank, so something like this is also
+ allowed:
+
+ \list
+ \li \c {\l [CPP QtQml] {Window} {C++ class Window}}
+ \endlist
+
+ As of this writing, there were no cases where combining the two
+ was required.
+
See also \l {sa-command} {\\sa}, \l {target-command} {\\target},
and \l {keyword-command} {\\keyword}.
@@ -3433,11 +3534,11 @@
\l{GNU Lesser General Public License (LGPL)} or the
\l{Qt Commercial Edition}{Qt Commercial License Agreement}, but rather under
specific licenses from the original authors. Some pieces of code were developed
- by Digia and others originated from third parties.
+ by The Qt Company and others originated from third parties.
This page lists the licenses used, names the authors, and links
to the places where it is used.
- Digia gratefully acknowledges these and other contributions
+ The Qt Company gratefully acknowledges these and other contributions
to Qt. We recommend that programs that use Qt also acknowledge
these contributions, and quote these license statements in an
appendix to the documentation.
diff --git a/src/tools/qdoc/doc/qdoc-manual-qdocconf.qdoc b/src/tools/qdoc/doc/qdoc-manual-qdocconf.qdoc
index 6ca394a586..226c107e3a 100644
--- a/src/tools/qdoc/doc/qdoc-manual-qdocconf.qdoc
+++ b/src/tools/qdoc/doc/qdoc-manual-qdocconf.qdoc
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
@@ -10,15 +10,15 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** 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. Please review the following information to ensure
+** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: http://www.gnu.org/copyleft/fdl.html.
** $QT_END_LICENSE$
@@ -204,7 +204,6 @@
QT_.*_LIB \
QT_COMPAT \
QT3_SUPPORT \
- Q_WS_.* \
Q_OS_.* \
Q_BYTE_ORDER \
__cplusplus
@@ -214,14 +213,14 @@
symbols to be defined. For example:
\code
- #ifdef Q_WS_WIN
+ #ifdef Q_OS_WIN
HDC getDC() const;
void releaseDC(HDC) const;
#endif
\endcode
- Since the Q_WS_.* regular expression (specified using the \c
- defines variable) matches Q_WS_WIN, QDoc will process the code
+ Since the Q_OS_.* regular expression (specified using the \c
+ defines variable) matches Q_OS_WIN, QDoc will process the code
within #ifdef and #endif in our example.
You can also define preprocessor symbols manually on the command
@@ -1531,7 +1530,7 @@
\page 21-3-qt-dita-xml-output.html
\previouspage minimum.qdocconf
\contentspage QDoc Manual
- \nextpage QDoc Manual
+ \nextpage QA Pages
\title Generating DITA XML Output
diff --git a/src/tools/qdoc/doc/qdoc-manual-topiccmds.qdoc b/src/tools/qdoc/doc/qdoc-manual-topiccmds.qdoc
index fb3e604396..93cd25610d 100644
--- a/src/tools/qdoc/doc/qdoc-manual-topiccmds.qdoc
+++ b/src/tools/qdoc/doc/qdoc-manual-topiccmds.qdoc
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
@@ -10,15 +10,15 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** 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. Please review the following information to ensure
+** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: http://www.gnu.org/copyleft/fdl.html.
** $QT_END_LICENSE$
diff --git a/src/tools/qdoc/doc/qdoc-manual.qdoc b/src/tools/qdoc/doc/qdoc-manual.qdoc
index 485faba70f..c0a1afaa52 100644
--- a/src/tools/qdoc/doc/qdoc-manual.qdoc
+++ b/src/tools/qdoc/doc/qdoc-manual.qdoc
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
@@ -10,15 +10,15 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** 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. Please review the following information to ensure
+** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: http://www.gnu.org/copyleft/fdl.html.
** $QT_END_LICENSE$
@@ -70,6 +70,7 @@
\li \l {minimum.qdocconf}
\li \l {Generating DITA XML Output}
\endlist
+ \li \l {QA Pages}
\endlist
*/
diff --git a/src/tools/qdoc/doc/qdoc-minimum-qdocconf.qdoc b/src/tools/qdoc/doc/qdoc-minimum-qdocconf.qdoc
index ceaf5b6200..77d252b24c 100644
--- a/src/tools/qdoc/doc/qdoc-minimum-qdocconf.qdoc
+++ b/src/tools/qdoc/doc/qdoc-minimum-qdocconf.qdoc
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
@@ -10,15 +10,15 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** 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. Please review the following information to ensure
+** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: http://www.gnu.org/copyleft/fdl.html.
** $QT_END_LICENSE$
diff --git a/src/tools/qdoc/doc/qtgui-qdocconf.qdoc b/src/tools/qdoc/doc/qtgui-qdocconf.qdoc
index f8213271c6..3dcd2482d6 100644
--- a/src/tools/qdoc/doc/qtgui-qdocconf.qdoc
+++ b/src/tools/qdoc/doc/qtgui-qdocconf.qdoc
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
@@ -10,15 +10,15 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** 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. Please review the following information to ensure
+** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: http://www.gnu.org/copyleft/fdl.html.
** $QT_END_LICENSE$
diff --git a/src/tools/qdoc/editdistance.cpp b/src/tools/qdoc/editdistance.cpp
index aec9d13972..c3336d2ab5 100644
--- a/src/tools/qdoc/editdistance.cpp
+++ b/src/tools/qdoc/editdistance.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
diff --git a/src/tools/qdoc/editdistance.h b/src/tools/qdoc/editdistance.h
index b6467e0400..2a9b1710fa 100644
--- a/src/tools/qdoc/editdistance.h
+++ b/src/tools/qdoc/editdistance.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
diff --git a/src/tools/qdoc/generator.cpp b/src/tools/qdoc/generator.cpp
index 5aff19e121..0ecd5ed6e3 100644
--- a/src/tools/qdoc/generator.cpp
+++ b/src/tools/qdoc/generator.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
@@ -38,7 +38,6 @@
#include <qdebug.h>
#include "codemarker.h"
#include "config.h"
-#include "ditaxmlgenerator.h"
#include "doc.h"
#include "editdistance.h"
#include "generator.h"
@@ -64,7 +63,7 @@ QString Generator::outSubdir_;
QStringList Generator::outFileNames_;
QSet<QString> Generator::outputFormats;
QHash<QString, QString> Generator::outputPrefixes;
-QString Generator::project;
+QString Generator::project_;
QStringList Generator::scriptDirs;
QStringList Generator::scriptFiles;
QString Generator::sinceTitles[] =
@@ -92,8 +91,11 @@ bool Generator::debugging_ = false;
bool Generator::noLinkErrors_ = false;
bool Generator::autolinkErrors_ = false;
bool Generator::redirectDocumentationToDevNull_ = false;
-Generator::Passes Generator::qdocPass_ = Both;
+Generator::QDocPass Generator::qdocPass_ = Generator::Neither;
+bool Generator::qdocSingleExec_ = false;
+bool Generator::qdocWriteQaPages_ = false;
bool Generator::useOutputSubdirs_ = true;
+QmlTypeNode* Generator::qmlTypeContext_ = 0;
void Generator::startDebugging(const QString& message)
{
@@ -134,6 +136,7 @@ Generator::Generator()
inTableHeader_(false),
threeColumnEnumValueTable_(true),
showInternal_(false),
+ singleExec_(false),
numTableRows_(0)
{
qdb_ = QDocDatabase::qdocDB();
@@ -222,7 +225,7 @@ void Generator::appendSortedQmlNames(Text& text, const Node* base, const NodeLis
for (int i = 0; i < subs.size(); ++i) {
Text t;
if (!base->isQtQuickNode() || !subs[i]->isQtQuickNode() ||
- (base->qmlModuleName() == subs[i]->qmlModuleName())) {
+ (base->logicalModuleName() == subs[i]->logicalModuleName())) {
appendFullName(t, subs[i], base);
classMap[t.toString().toLower()] = t;
}
@@ -259,7 +262,8 @@ void Generator::writeOutFileNames()
void Generator::beginSubPage(const InnerNode* node, const QString& fileName)
{
QString path = outputDir() + QLatin1Char('/');
- if (Generator::useOutputSubdirs() && !node->outputSubdirectory().isEmpty())
+ if (Generator::useOutputSubdirs() && !node->outputSubdirectory().isEmpty() &&
+ !outputDir().endsWith(node->outputSubdirectory()))
path += node->outputSubdirectory() + QLatin1Char('/');
path += fileName;
@@ -306,15 +310,15 @@ QString Generator::fileBase(const Node *node) const
return node->fileNameBase();
QString base;
- if (node->isDocNode()) {
+ if (node->isDocumentNode()) {
base = node->name();
if (base.endsWith(".html") && !node->isExampleFile())
base.truncate(base.length() - 5);
if (node->isExample() || node->isExampleFile()) {
- QString modPrefix(node->moduleName());
+ QString modPrefix(node->physicalModuleName());
if (modPrefix.isEmpty()) {
- modPrefix = project;
+ modPrefix = project_;
}
base.prepend(modPrefix.toLower() + QLatin1Char('-'));
}
@@ -322,17 +326,21 @@ QString Generator::fileBase(const Node *node) const
base.append(QLatin1String("-example"));
}
}
- else if (node->isQmlType() || node->isQmlBasicType()) {
+ else if (node->isQmlType() || node->isQmlBasicType() ||
+ node->isJsType() || node->isJsBasicType()) {
base = node->name();
- if (!node->qmlModuleName().isEmpty()) {
- base.prepend(node->qmlModuleName() + QLatin1Char('-'));
+ if (!node->logicalModuleName().isEmpty()) {
+ base.prepend(node->logicalModuleName() + QLatin1Char('-'));
}
/*
To avoid file name conflicts in the html directory,
we prepend a prefix (by default, "qml-") to the file name of QML
element doc files.
*/
- base.prepend(outputPrefix(QLatin1String("QML")));
+ if (node->isQmlType() || node->isQmlBasicType())
+ base.prepend(outputPrefix(QLatin1String("QML")));
+ else
+ base.prepend(outputPrefix(QLatin1String("JS")));
}
else if (node->isCollectionNode()) {
base = node->name();
@@ -342,6 +350,9 @@ QString Generator::fileBase(const Node *node) const
if (node->isQmlModule()) {
base.append("-qmlmodule");
}
+ else if (node->isJsModule()) {
+ base.append("-jsmodule");
+ }
else if (node->isModule()) {
base.append("-module");
}
@@ -352,7 +363,7 @@ QString Generator::fileBase(const Node *node) const
forever {
const Node *pp = p->parent();
base.prepend(p->name());
- if (!pp || pp->name().isEmpty() || pp->isDocNode())
+ if (!pp || pp->name().isEmpty() || pp->isDocumentNode())
break;
base.prepend(QLatin1Char('-'));
p = pp;
@@ -452,21 +463,27 @@ QString Generator::fullDocumentLocation(const Node *node, bool useSubdir)
else
return QString();
}
- else if (node->isQmlType() || node->isQmlBasicType()) {
+ else if (node->isQmlType() || node->isQmlBasicType() ||
+ node->isJsType() || node->isJsBasicType()) {
QString fb = fileBase(node);
if (fb.startsWith(Generator::outputPrefix(QLatin1String("QML"))))
return fb + QLatin1Char('.') + currentGenerator()->fileExtension();
+ else if (fb.startsWith(Generator::outputPrefix(QLatin1String("JS"))))
+ return fb + QLatin1Char('.') + currentGenerator()->fileExtension();
else {
QString mq;
- if (!node->qmlModuleName().isEmpty()) {
- mq = node->qmlModuleName().replace(QChar('.'),QChar('-'));
+ if (!node->logicalModuleName().isEmpty()) {
+ mq = node->logicalModuleName().replace(QChar('.'),QChar('-'));
mq = mq.toLower() + QLatin1Char('-');
}
- return fdl+ Generator::outputPrefix(QLatin1String("QML")) + mq +
- fileBase(node) + QLatin1Char('.') + currentGenerator()->fileExtension();
+ QLatin1String prefix = QLatin1String("QML");
+ if (node->isJsType() || node->isJsBasicType())
+ prefix = QLatin1String("JS");
+ return fdl+ Generator::outputPrefix(prefix) + mq + fileBase(node) +
+ QLatin1Char('.') + currentGenerator()->fileExtension();
}
}
- else if (node->isDocNode() || node->isCollectionNode()) {
+ else if (node->isDocumentNode() || node->isCollectionNode()) {
parentName = fileBase(node) + QLatin1Char('.') + currentGenerator()->fileExtension();
}
else if (fileBase(node).isEmpty())
@@ -478,7 +495,7 @@ QString Generator::fullDocumentLocation(const Node *node, bool useSubdir)
parentName = fullDocumentLocation(node->relates());
}
else if ((parentNode = node->parent())) {
- if (parentNode->type() == Node::QmlPropertyGroup) {
+ if (parentNode->isQmlPropertyGroup() || parentNode->isJsPropertyGroup()) {
parentNode = parentNode->parent();
parentName = fullDocumentLocation(parentNode);
}
@@ -679,7 +696,7 @@ void Generator::generateBody(const Node *node, CodeMarker *marker)
bool quiet = false;
if (node->type() == Node::Document) {
- const DocNode *dn = static_cast<const DocNode *>(node);
+ const DocumentNode *dn = static_cast<const DocumentNode *>(node);
if ((dn->subType() == Node::File) || (dn->subType() == Node::Image)) {
quiet = true;
}
@@ -804,8 +821,8 @@ void Generator::generateBody(const Node *node, CodeMarker *marker)
}
}
- if (node->isDocNode()) {
- const DocNode *dn = static_cast<const DocNode *>(node);
+ if (node->isDocumentNode()) {
+ const DocumentNode *dn = static_cast<const DocumentNode *>(node);
if (dn->isExample()) {
generateExampleFiles(dn, marker);
}
@@ -825,7 +842,7 @@ void Generator::generateClassLikeNode(InnerNode* /* classe */, CodeMarker* /* ma
{
}
-void Generator::generateExampleFiles(const DocNode *dn, CodeMarker *marker)
+void Generator::generateExampleFiles(const DocumentNode *dn, CodeMarker *marker)
{
if (dn->childNodes().isEmpty())
return;
@@ -833,7 +850,7 @@ void Generator::generateExampleFiles(const DocNode *dn, CodeMarker *marker)
generateFileList(dn, marker, Node::Image, QString("Images:"));
}
-void Generator::generateDocNode(DocNode* /* dn */, CodeMarker* /* marker */)
+void Generator::generateDocumentNode(DocumentNode* /* dn */, CodeMarker* /* marker */)
{
}
@@ -848,7 +865,7 @@ void Generator::generateCollectionNode(CollectionNode* , CodeMarker* )
by the example. The images are copied into a subtree of
\c{...doc/html/images/used-in-examples/...}
*/
-void Generator::generateFileList(const DocNode* dn,
+void Generator::generateFileList(const DocumentNode* dn,
CodeMarker* marker,
Node::SubType subtype,
const QString& tag)
@@ -959,9 +976,6 @@ void Generator::generateInherits(const ClassNode *classe, CodeMarker *marker)
/*!
Recursive writing of HTML files from the root \a node.
-
- \note DitaXmlGenerator overrides this function, but
- HtmlGenerator does not.
*/
void Generator::generateInnerNode(InnerNode* node)
{
@@ -972,8 +986,8 @@ void Generator::generateInnerNode(InnerNode* node)
if (node->isInternal() && !showInternal_)
return;
- if (node->isDocNode()) {
- DocNode* docNode = static_cast<DocNode*>(node);
+ if (node->isDocumentNode()) {
+ DocumentNode* docNode = static_cast<DocumentNode*>(node);
if (docNode->subType() == Node::ExternalPage)
return;
if (docNode->subType() == Node::Image)
@@ -983,7 +997,7 @@ void Generator::generateInnerNode(InnerNode* node)
qDebug("PAGE %s HAS CHILDREN", qPrintable(docNode->title()));
}
}
- else if (node->isQmlPropertyGroup())
+ else if (node->isQmlPropertyGroup() || node->isJsPropertyGroup())
return;
/*
@@ -997,44 +1011,44 @@ void Generator::generateInnerNode(InnerNode* node)
generateClassLikeNode(node, marker);
endSubPage();
}
- if (node->isQmlType()) {
+ if (node->isQmlType() || node->isJsType()) {
beginSubPage(node, fileName(node));
- QmlClassNode* qcn = static_cast<QmlClassNode*>(node);
+ QmlTypeNode* qcn = static_cast<QmlTypeNode*>(node);
generateQmlTypePage(qcn, marker);
endSubPage();
}
- else if (node->isDocNode()) {
+ else if (node->isDocumentNode()) {
beginSubPage(node, fileName(node));
- generateDocNode(static_cast<DocNode*>(node), marker);
+ generateDocumentNode(static_cast<DocumentNode*>(node), marker);
endSubPage();
}
- else if (node->isQmlBasicType()) {
+ else if (node->isQmlBasicType() || node->isJsBasicType()) {
beginSubPage(node, fileName(node));
QmlBasicTypeNode* qbtn = static_cast<QmlBasicTypeNode*>(node);
generateQmlBasicTypePage(qbtn, marker);
endSubPage();
}
else if (node->isCollectionNode()) {
- CollectionNode* cn = static_cast<CollectionNode*>(node);
/*
- A collection node is one of: group, module,
- or QML module.
+ A collection node collects: groups, C++ modules,
+ QML modules or JavaScript modules.
Don't output an HTML page for the collection
- node unless the \group, \module, or \qmlmodule
- command was actually seen by qdoc in the qdoc
- comment for the node.
+ node unless the \group, \module, \qmlmodule or
+ \jsmodule command was actually seen by qdoc in
+ the qdoc comment for the node.
A key prerequisite in this case is the call to
- mergeCollections(cn). We don't know if this
- collection (group, module, or QML module) has
- members in other modules. We know at this point
- that cn's members list contains only members in
- the current module. Therefore, before outputting
- the page for cn, we must search for members of
- cn in the other modules and add them to the
- members list.
+ mergeCollections(cn). We must determine whether
+ this group, module, QML module, or JavaScript
+ module has members in other modules. We know at
+ this point that cn's members list contains only
+ members in the current module. Therefore, before
+ outputting the page for cn, we must search for
+ members of cn in the other modules and add them
+ to the members list.
*/
+ CollectionNode* cn = static_cast<CollectionNode*>(node);
if (cn->wasSeen()) {
qdb_->mergeCollections(cn);
beginSubPage(node, fileName(node));
@@ -1080,12 +1094,12 @@ void Generator::generateMaintainerList(const InnerNode* node, CodeMarker* marker
Output the "Inherit by" list for the QML element,
if it is inherited by any other elements.
*/
-void Generator::generateQmlInheritedBy(const QmlClassNode* qcn,
+void Generator::generateQmlInheritedBy(const QmlTypeNode* qcn,
CodeMarker* marker)
{
if (qcn) {
NodeList subs;
- QmlClassNode::subclasses(qcn->name(),subs);
+ QmlTypeNode::subclasses(qcn->name(),subs);
if (!subs.isEmpty()) {
Text text;
text << Atom::ParaLeft << "Inherited by ";
@@ -1098,7 +1112,7 @@ void Generator::generateQmlInheritedBy(const QmlClassNode* qcn,
/*!
*/
-void Generator::generateQmlInherits(QmlClassNode* , CodeMarker* )
+void Generator::generateQmlInherits(QmlTypeNode* , CodeMarker* )
{
// stub.
}
@@ -1515,6 +1529,7 @@ void Generator::initialize(const Config &config)
if (config.getBool(QString("HTML.nosubdirs")))
resetUseOutputSubdirs();
+ outFileNames_.clear();
outputFormats = config.getOutputFormats();
redirectDocumentationToDevNull_ = config.getBool(CONFIG_REDIRECTDOCUMENTATIONTODEVNULL);
if (!outputFormats.isEmpty()) {
@@ -1529,7 +1544,7 @@ void Generator::initialize(const Config &config)
QDir dirInfo;
if (dirInfo.exists(outDir_)) {
- if (!runGenerateOnly() && Generator::useOutputSubdirs()) {
+ if (!generating() && Generator::useOutputSubdirs()) {
if (!Config::removeDirContents(outDir_))
config.lastLocation().error(tr("Cannot empty output directory '%1'").arg(outDir_));
}
@@ -1643,15 +1658,17 @@ void Generator::initialize(const Config &config)
++n;
}
- project = config.getString(CONFIG_PROJECT);
+ project_ = config.getString(CONFIG_PROJECT);
QStringList prefixes = config.getStringList(CONFIG_OUTPUTPREFIXES);
if (!prefixes.isEmpty()) {
foreach (const QString &prefix, prefixes)
outputPrefixes[prefix] = config.getString(CONFIG_OUTPUTPREFIXES + Config::dot + prefix);
}
- else
+ else {
outputPrefixes[QLatin1String("QML")] = QLatin1String("qml-");
+ outputPrefixes[QLatin1String("JS")] = QLatin1String("js-");
+ }
noLinkErrors_ = config.getBool(CONFIG_NOLINKERRORS);
autolinkErrors_ = config.getBool(CONFIG_AUTOLINKERRORS);
}
@@ -1678,6 +1695,7 @@ void Generator::initializeGenerator(const Config& config)
{
config_ = &config;
showInternal_ = config.getBool(CONFIG_SHOWINTERNAL);
+ singleExec_ = config.getBool(CONFIG_SINGLEEXEC);
}
bool Generator::matchAhead(const Atom *atom, Atom::Type expectedAtomType)
@@ -1919,7 +1937,7 @@ void Generator::terminate()
imageFiles.clear();
imageDirs.clear();
outDir_.clear();
- QmlClassNode::terminate();
+ QmlTypeNode::terminate();
}
void Generator::terminateGenerator()
diff --git a/src/tools/qdoc/generator.h b/src/tools/qdoc/generator.h
index 110a8d9e73..3165e8d449 100644
--- a/src/tools/qdoc/generator.h
+++ b/src/tools/qdoc/generator.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
@@ -61,7 +61,7 @@ class Generator
Q_DECLARE_TR_FUNCTIONS(QDoc::Generator)
public:
- enum Passes { Both, Prepare, Generate };
+ enum QDocPass { Neither, Prepare, Generate };
enum ListType { Generic, Obsolete };
Generator();
@@ -91,32 +91,39 @@ public:
static bool debugging() { return debugging_; }
static bool noLinkErrors() { return noLinkErrors_; }
static bool autolinkErrors() { return autolinkErrors_; }
- static void setQDocPass(Passes pass) { qdocPass_ = pass; }
- static bool runPrepareOnly() { return (qdocPass_ == Prepare); }
- static bool runGenerateOnly() { return (qdocPass_ == Generate); }
- static QString defaultModuleName() { return project; }
+ static void setQDocPass(QDocPass t) { qdocPass_ = t; }
+ static bool preparing() { return (qdocPass_ == Prepare); }
+ static bool generating() { return (qdocPass_ == Generate); }
+ static bool singleExec() { return qdocSingleExec_; }
+ static bool writeQaPages() { return qdocWriteQaPages_; }
+ static void setSingleExec() { qdocSingleExec_ = true; }
+ static void setWriteQaPages() { qdocWriteQaPages_ = true; }
+ static QString defaultModuleName() { return project_; }
static void resetUseOutputSubdirs() { useOutputSubdirs_ = false; }
static bool useOutputSubdirs() { return useOutputSubdirs_; }
+ static void setQmlTypeContext(QmlTypeNode* t) { qmlTypeContext_ = t; }
+ static QmlTypeNode* qmlTypeContext() { return qmlTypeContext_; }
protected:
virtual void beginSubPage(const InnerNode* node, const QString& fileName);
virtual void endSubPage();
virtual QString fileBase(const Node* node) const;
virtual QString fileExtension() const = 0;
+ virtual void generateQAPage() { }
virtual void generateAlsoList(const Node *node, CodeMarker *marker);
virtual int generateAtom(const Atom *atom, const Node *relative, CodeMarker *marker);
virtual void generateBody(const Node *node, CodeMarker *marker);
virtual void generateClassLikeNode(InnerNode* inner, CodeMarker* marker);
- virtual void generateQmlTypePage(QmlClassNode* , CodeMarker* ) { }
+ virtual void generateQmlTypePage(QmlTypeNode* , CodeMarker* ) { }
virtual void generateQmlBasicTypePage(QmlBasicTypeNode* , CodeMarker* ) { }
- virtual void generateDocNode(DocNode* dn, CodeMarker* marker);
+ virtual void generateDocumentNode(DocumentNode* dn, CodeMarker* marker);
virtual void generateCollectionNode(CollectionNode* cn, CodeMarker* marker);
virtual void generateInheritedBy(const ClassNode *classe, CodeMarker *marker);
virtual void generateInherits(const ClassNode *classe, CodeMarker *marker);
virtual void generateInnerNode(InnerNode* node);
virtual void generateMaintainerList(const InnerNode* node, CodeMarker* marker);
- virtual void generateQmlInheritedBy(const QmlClassNode* qcn, CodeMarker* marker);
- virtual void generateQmlInherits(QmlClassNode* qcn, CodeMarker* marker);
+ virtual void generateQmlInheritedBy(const QmlTypeNode* qcn, CodeMarker* marker);
+ virtual void generateQmlInherits(QmlTypeNode* qcn, CodeMarker* marker);
virtual bool generateQmlText(const Text& text,
const Node *relative,
CodeMarker *marker,
@@ -142,8 +149,8 @@ protected:
CodeMarker *marker,
bool generate,
int& numGeneratedAtoms);
- void generateExampleFiles(const DocNode *dn, CodeMarker *marker);
- void generateFileList(const DocNode* dn,
+ void generateExampleFiles(const DocumentNode *dn, CodeMarker *marker);
+ void generateFileList(const DocumentNode* dn,
CodeMarker* marker,
Node::SubType subtype,
const QString& tag);
@@ -198,7 +205,7 @@ private:
static QStringList imageDirs;
static QStringList imageFiles;
static QMap<QString, QStringList> imgFileExts;
- static QString project;
+ static QString project_;
static QString outDir_;
static QString outSubdir_;
static QStringList outFileNames_;
@@ -212,8 +219,11 @@ private:
static bool noLinkErrors_;
static bool autolinkErrors_;
static bool redirectDocumentationToDevNull_;
- static Passes qdocPass_;
+ static QDocPass qdocPass_;
+ static bool qdocSingleExec_;
+ static bool qdocWriteQaPages_;
static bool useOutputSubdirs_;
+ static QmlTypeNode* qmlTypeContext_;
void generateReimplementedFrom(const FunctionNode *func, CodeMarker *marker);
@@ -232,6 +242,7 @@ private:
bool inTableHeader_;
bool threeColumnEnumValueTable_;
bool showInternal_;
+ bool singleExec_;
int numTableRows_;
QString link_;
QString sectionNumber_;
diff --git a/src/tools/qdoc/helpprojectwriter.cpp b/src/tools/qdoc/helpprojectwriter.cpp
index d0960e48bd..90b1d9cfe3 100644
--- a/src/tools/qdoc/helpprojectwriter.cpp
+++ b/src/tools/qdoc/helpprojectwriter.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
@@ -49,8 +49,16 @@ QT_BEGIN_NAMESPACE
HelpProjectWriter::HelpProjectWriter(const Config &config,
const QString &defaultFileName,
Generator* g)
- : gen_(g)
{
+ reset(config, defaultFileName, g);
+}
+
+void HelpProjectWriter::reset(const Config &config,
+ const QString &defaultFileName,
+ Generator* g)
+{
+ projects.clear();
+ gen_ = g;
/*
Get the pointer to the singleton for the qdoc database and
store it locally. This replaces all the local accesses to
@@ -188,7 +196,7 @@ QStringList HelpProjectWriter::keywordDetails(const Node *node) const
{
QStringList details;
- if (node->type() == Node::QmlProperty) {
+ if (node->isQmlProperty() || node->isJsProperty()) {
// "name"
details << node->name();
// "id"
@@ -207,8 +215,12 @@ QStringList HelpProjectWriter::keywordDetails(const Node *node) const
details << node->name();
details << "QML." + node->name();
}
- else if (node->isDocNode()) {
- const DocNode *fake = static_cast<const DocNode *>(node);
+ else if (node->isJsType() || node->isJsBasicType()) {
+ details << node->name();
+ details << "JS." + node->name();
+ }
+ else if (node->isDocumentNode()) {
+ const DocumentNode *fake = static_cast<const DocumentNode *>(node);
details << fake->fullTitle();
details << fake->fullTitle();
}
@@ -216,7 +228,7 @@ QStringList HelpProjectWriter::keywordDetails(const Node *node) const
details << node->name();
details << node->name();
}
- details << gen_->fullDocumentLocation(node,Generator::useOutputSubdirs());
+ details << gen_->fullDocumentLocation(node, false);
return details;
}
@@ -238,8 +250,8 @@ bool HelpProjectWriter::generateSection(HelpProject &project,
return false;
QString objName;
- if (node->isDocNode()) {
- const DocNode *fake = static_cast<const DocNode *>(node);
+ if (node->isDocumentNode()) {
+ const DocumentNode *fake = static_cast<const DocumentNode *>(node);
objName = fake->fullTitle();
}
else
@@ -261,7 +273,7 @@ bool HelpProjectWriter::generateSection(HelpProject &project,
else {
// Accept only fake nodes with subtypes contained in the selector's
// mask.
- const DocNode *docNode = static_cast<const DocNode *>(node);
+ const DocumentNode *docNode = static_cast<const DocumentNode *>(node);
if (subproject.selectors[node->type()].contains(docNode->subType()) &&
docNode->subType() != Node::ExternalPage &&
!docNode->fullTitle().isEmpty()) {
@@ -285,12 +297,12 @@ bool HelpProjectWriter::generateSection(HelpProject &project,
QStringList details;
details << keyword->string()
<< keyword->string()
- << gen_->fullDocumentLocation(node,Generator::useOutputSubdirs()) +
+ << gen_->fullDocumentLocation(node, false) +
QLatin1Char('#') + Doc::canonicalTitle(keyword->string());
project.keywords.append(details);
}
else
- node->doc().location().warning(tr("Bad keyword in %1").arg(gen_->fullDocumentLocation(node,Generator::useOutputSubdirs())));
+ node->doc().location().warning(tr("Bad keyword in %1").arg(gen_->fullDocumentLocation(node, false)));
}
}
project.keywords.append(keywordDetails(node));
@@ -317,7 +329,7 @@ bool HelpProjectWriter::generateSection(HelpProject &project,
details << item.name(); // "name"
details << item.name(); // "id"
}
- details << gen_->fullDocumentLocation(node,Generator::useOutputSubdirs());
+ details << gen_->fullDocumentLocation(node, false);
project.keywords.append(details);
}
}
@@ -335,13 +347,13 @@ bool HelpProjectWriter::generateSection(HelpProject &project,
QStringList details;
details << keyword->string()
<< keyword->string()
- << gen_->fullDocumentLocation(node, Generator::useOutputSubdirs()) +
+ << gen_->fullDocumentLocation(node, false) +
QLatin1Char('#') + Doc::canonicalTitle(keyword->string());
project.keywords.append(details);
}
else
cn->doc().location().warning(
- tr("Bad keyword in %1").arg(gen_->fullDocumentLocation(node,Generator::useOutputSubdirs()))
+ tr("Bad keyword in %1").arg(gen_->fullDocumentLocation(node, false))
);
}
}
@@ -389,7 +401,7 @@ bool HelpProjectWriter::generateSection(HelpProject &project,
// Use the location of any associated enum node in preference
// to that of the typedef.
if (enumNode)
- typedefDetails[2] = gen_->fullDocumentLocation(enumNode,Generator::useOutputSubdirs());
+ typedefDetails[2] = gen_->fullDocumentLocation(enumNode, false);
project.keywords.append(typedefDetails);
}
@@ -404,7 +416,7 @@ bool HelpProjectWriter::generateSection(HelpProject &project,
// Document nodes (such as manual pages) contain subtypes, titles and other
// attributes.
case Node::Document: {
- const DocNode *docNode = static_cast<const DocNode*>(node);
+ const DocumentNode *docNode = static_cast<const DocumentNode*>(node);
if (docNode->subType() != Node::ExternalPage &&
docNode->subType() != Node::Image &&
!docNode->fullTitle().isEmpty()) {
@@ -416,12 +428,12 @@ bool HelpProjectWriter::generateSection(HelpProject &project,
QStringList details;
details << keyword->string()
<< keyword->string()
- << gen_->fullDocumentLocation(node,Generator::useOutputSubdirs()) +
+ << gen_->fullDocumentLocation(node, false) +
QLatin1Char('#') + Doc::canonicalTitle(keyword->string());
project.keywords.append(details);
} else
docNode->doc().location().warning(
- tr("Bad keyword in %1").arg(gen_->fullDocumentLocation(node,Generator::useOutputSubdirs()))
+ tr("Bad keyword in %1").arg(gen_->fullDocumentLocation(node, false))
);
}
}
@@ -473,17 +485,17 @@ void HelpProjectWriter::generateSections(HelpProject &project,
continue;
if (childNode->type() == Node::Document) {
- childMap[static_cast<const DocNode *>(childNode)->fullTitle()] = childNode;
+ childMap[static_cast<const DocumentNode *>(childNode)->fullTitle()] = childNode;
}
- else if (childNode->type() == Node::QmlPropertyGroup) {
+ else if (childNode->isQmlPropertyGroup() || childNode->isJsPropertyGroup()) {
/*
- Don't visit QML property group nodes,
+ Don't visit QML/JS property group nodes,
but visit their children, which are all
- QML property nodes.
+ QML/JS property nodes.
This is probably not correct anymore,
- because The Qml Property Group is an
- actual documented thing.
+ because The Qml/Js Property Group is
+ an actual documented thing.
*/
const InnerNode* inner = static_cast<const InnerNode*>(childNode);
foreach (const Node* n, inner->childNodes()) {
@@ -546,7 +558,7 @@ void HelpProjectWriter::writeSection(QXmlStreamWriter &writer, const QString &pa
void HelpProjectWriter::addMembers(HelpProject &project, QXmlStreamWriter &writer,
const Node *node)
{
- QString href = gen_->fullDocumentLocation(node,Generator::useOutputSubdirs());
+ QString href = gen_->fullDocumentLocation(node, false);
href = href.left(href.size()-5);
if (href.isEmpty())
return;
@@ -558,7 +570,8 @@ void HelpProjectWriter::addMembers(HelpProject &project, QXmlStreamWriter &write
// Do not generate a 'List of all members' for namespaces or header files,
// but always generate it for derived classes and QML classes
if (!node->isNamespace() && !node->isHeaderFile() &&
- (derivedClass || node->isQmlType() || !project.memberStatus[node].isEmpty())) {
+ (derivedClass || node->isQmlType() || node->isJsType() ||
+ !project.memberStatus[node].isEmpty())) {
QString membersPath = href + QStringLiteral("-members.html");
writeSection(writer, membersPath, tr("List of all members"));
}
@@ -575,7 +588,7 @@ void HelpProjectWriter::addMembers(HelpProject &project, QXmlStreamWriter &write
void HelpProjectWriter::writeNode(HelpProject &project, QXmlStreamWriter &writer,
const Node *node)
{
- QString href = gen_->fullDocumentLocation(node,Generator::useOutputSubdirs());
+ QString href = gen_->fullDocumentLocation(node, false);
QString objName = node->name();
switch (node->type()) {
@@ -607,7 +620,7 @@ void HelpProjectWriter::writeNode(HelpProject &project, QXmlStreamWriter &writer
case Node::Document: {
// Document nodes (such as manual pages) contain subtypes, titles and other
// attributes.
- const DocNode *docNode = static_cast<const DocNode*>(node);
+ const DocumentNode *docNode = static_cast<const DocumentNode*>(node);
writer.writeStartElement("section");
writer.writeAttribute("ref", href);
@@ -644,7 +657,7 @@ void HelpProjectWriter::generateProject(HelpProject &project)
qdb_->setLocalSearch();
if (!project.indexRoot.isEmpty())
- rootNode = qdb_->findDocNodeByTitle(project.indexRoot);
+ rootNode = qdb_->findDocumentNodeByTitle(project.indexRoot);
else
rootNode = qdb_->primaryTreeRoot();
@@ -687,12 +700,12 @@ void HelpProjectWriter::generateProject(HelpProject &project)
writer.writeStartElement("toc");
writer.writeStartElement("section");
- const Node* node = qdb_->findDocNodeByTitle(project.indexTitle);
+ const Node* node = qdb_->findDocumentNodeByTitle(project.indexTitle);
if (node == 0)
node = qdb_->findNodeByNameAndType(QStringList("index.html"), Node::Document);
QString indexPath;
if (node)
- indexPath = gen_->fullDocumentLocation(node,Generator::useOutputSubdirs());
+ indexPath = gen_->fullDocumentLocation(node, false);
else
indexPath = "index.html";
writer.writeAttribute("ref", indexPath);
@@ -734,8 +747,7 @@ void HelpProjectWriter::generateProject(HelpProject &project)
const Node *page = qdb_->findNodeForTarget(atom->string(), 0);
writer.writeStartElement("section");
- QString indexPath = gen_->fullDocumentLocation(page,
- Generator::useOutputSubdirs());
+ QString indexPath = gen_->fullDocumentLocation(page, false);
writer.writeAttribute("ref", indexPath);
writer.writeAttribute("title", atom->string());
@@ -760,7 +772,7 @@ void HelpProjectWriter::generateProject(HelpProject &project)
if (!name.isEmpty()) {
writer.writeStartElement("section");
QString indexPath = gen_->fullDocumentLocation(qdb_->findNodeForTarget(subproject.indexTitle, 0),
- Generator::useOutputSubdirs());
+ false);
writer.writeAttribute("ref", indexPath);
writer.writeAttribute("title", subproject.title);
}
diff --git a/src/tools/qdoc/helpprojectwriter.h b/src/tools/qdoc/helpprojectwriter.h
index 2519e62c13..efc2596296 100644
--- a/src/tools/qdoc/helpprojectwriter.h
+++ b/src/tools/qdoc/helpprojectwriter.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
@@ -50,7 +50,7 @@ struct SubProject
{
QString title;
QString indexTitle;
- QHash<Node::Type, QSet<DocNode::SubType> > selectors;
+ QHash<Node::Type, QSet<DocumentNode::SubType> > selectors;
bool sortPages;
QString type;
QHash<QString, const Node *> nodes;
@@ -83,6 +83,9 @@ public:
HelpProjectWriter(const Config &config,
const QString &defaultFileName,
Generator* g);
+ void reset(const Config &config,
+ const QString &defaultFileName,
+ Generator* g);
void addExtraFile(const QString &file);
void addExtraFiles(const QSet<QString> &files);
void generate();
diff --git a/src/tools/qdoc/htmlgenerator.cpp b/src/tools/qdoc/htmlgenerator.cpp
index ced7e637b3..8eb96bff17 100644
--- a/src/tools/qdoc/htmlgenerator.cpp
+++ b/src/tools/qdoc/htmlgenerator.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
@@ -100,8 +100,10 @@ HtmlGenerator::HtmlGenerator()
*/
HtmlGenerator::~HtmlGenerator()
{
- if (helpProjectWriter)
+ if (helpProjectWriter) {
delete helpProjectWriter;
+ helpProjectWriter = 0;
+ }
}
/*!
@@ -130,6 +132,11 @@ void HtmlGenerator::initializeGenerator(const Config &config)
Generator::initializeGenerator(config);
obsoleteLinks = config.getBool(CONFIG_OBSOLETELINKS);
setImageFileExtensions(QStringList() << "png" << "jpg" << "jpeg" << "gif");
+
+ /*
+ The formatting maps are owned by Generator. They are cleared in
+ Generator::terminate().
+ */
int i = 0;
while (defaults[i].key) {
formattingLeftMap().insert(defaults[i].key, defaults[i].left);
@@ -215,7 +222,14 @@ void HtmlGenerator::initializeGenerator(const Config &config)
// The following line was changed to fix QTBUG-27798
//codeIndent = config.getInt(CONFIG_CODEINDENT);
- helpProjectWriter = new HelpProjectWriter(config, project.toLower() + ".qhp", this);
+ /*
+ The help file write should be allocated once and only once
+ per qdoc execution.
+ */
+ if (helpProjectWriter)
+ helpProjectWriter->reset(config, project.toLower() + ".qhp", this);
+ else
+ helpProjectWriter = new HelpProjectWriter(config, project.toLower() + ".qhp", this);
// Documentation template handling
headerScripts = config.getString(HtmlGenerator::format() + Config::dot + CONFIG_HEADERSCRIPTS);
@@ -263,6 +277,20 @@ QString HtmlGenerator::format()
}
/*!
+ Generate targets for any \keyword commands that were seen
+ in the qdoc comment for the \a node.
+ */
+void HtmlGenerator::generateKeywordAnchors(const Node* node)
+{
+ if (!node->doc().isEmpty()) {
+ const QList<Atom*>& keywords = node->doc().keywords();
+ foreach (Atom* a, keywords) {
+ out() << "<a name=\"" << Doc::canonicalTitle(a->string()) << "\"></a>";
+ }
+ }
+}
+
+/*!
Traverses the current tree generating all the HTML documentation.
*/
void HtmlGenerator::generateDocs()
@@ -270,10 +298,12 @@ void HtmlGenerator::generateDocs()
Node* qflags = qdb_->findClassNode(QStringList("QFlags"));
if (qflags)
qflagsHref_ = linkForNode(qflags,0);
- if (!runPrepareOnly())
+ if (!preparing())
Generator::generateDocs();
+ if (Generator::generating() && Generator::writeQaPages())
+ generateQAPage();
- if (!runGenerateOnly()) {
+ if (!generating()) {
QString fileBase = project.toLower().simplified().replace(QLatin1Char(' '), QLatin1Char('-'));
qdb_->generateIndex(outputDir() + QLatin1Char('/') + fileBase + ".index",
projectUrl,
@@ -282,7 +312,7 @@ void HtmlGenerator::generateDocs()
true);
}
- if (!runPrepareOnly()) {
+ if (!preparing()) {
helpProjectWriter->generate();
generateManifestFiles();
/*
@@ -293,6 +323,144 @@ void HtmlGenerator::generateDocs()
}
/*!
+ Output the module's Quality Assurance page.
+ */
+void HtmlGenerator::generateQAPage()
+{
+ NamespaceNode* node = qdb_->primaryTreeRoot();
+ beginSubPage(node, "aaa-" + defaultModuleName().toLower() + "-qa-page.html");
+ CodeMarker* marker = CodeMarker::markerForFileName(node->location().filePath());
+ QString title = "Quality Assurance Page for " + defaultModuleName();
+ QString t = "Quality assurance information for checking the " + defaultModuleName() + " documentation.";
+ generateHeader(title, node, marker);
+ generateTitle(title, Text() << t, LargeSubTitle, node, marker);
+
+ QStringList strings;
+ QVector<int> counts;
+ QString depends = qdb_->getLinkCounts(strings, counts);
+ if (!strings.isEmpty()) {
+ t = "Intermodule Link Counts";
+ QString ref = registerRef(t);
+ out() << "<a name=\"" << ref << "\"></a>" << divNavTop << '\n';
+ out() << "<h2 id=\"" << ref << "\">" << protectEnc(t) << "</h2>\n";
+ out() << "<table class=\"valuelist\"><tr valign=\"top\" "
+ << "class=\"even\"><th class=\"tblConst\">Destination Module</th>"
+ << "<th class=\"tblval\">Link Count</th></tr>\n";
+ QString fileName;
+ for (int i = 0; i< strings.size(); ++i) {
+ fileName = generateLinksToLinksPage(strings.at(i), marker);
+ out() << "<tr><td class=\"topAlign\"><tt>"
+ << "<a href=\"" << fileName << "\">"
+ << strings.at(i) << "</a>"
+ << "</tt></td><td class=\"topAlign\"><tt>" << counts.at(i)
+ << "</tt></td></tr>\n";
+ }
+ int count = 0;
+ fileName = generateLinksToBrokenLinksPage(marker, count);
+ if (count != 0) {
+ out() << "<tr><td class=\"topAlign\"><tt>"
+ << "<a href=\"" << fileName << "\">"
+ << "Broken Links" << "</a>"
+ << "</tt></td><td class=\"topAlign\"><tt>" << count
+ << "</tt></td></tr>\n";
+
+ }
+
+ out() << "</table>\n";
+ t = "The Optimal \"depends\" Variable";
+ out() << "<h2>" << protectEnc(t) << "</h2>\n";
+ t = "Consider replacing the depends variable in " + defaultModuleName().toLower() +
+ ".qdocconf with this one, if the two are not identical:";
+ out() << "<p>" << protectEnc(t) << "</p>\n";
+ out() << "<p>" << protectEnc(depends) << "</p>\n";
+ }
+ generateFooter();
+ endSubPage();
+}
+
+/*!
+ This function writes an html file containing a list of
+ links to links that originate in the current module and
+ go to targets in the specified \a module. The \a marker
+ is used for the same thing the marker is always used for.
+ */
+QString HtmlGenerator::generateLinksToLinksPage(const QString& module, CodeMarker* marker)
+{
+ NamespaceNode* node = qdb_->primaryTreeRoot();
+ QString fileName = "aaa-links-to-" + module + ".html";
+ beginSubPage(node, fileName);
+ QString title = "Links from " + defaultModuleName() + " to " + module;
+ generateHeader(title, node, marker);
+ generateTitle(title, Text(), SmallSubTitle, node, marker);
+ out() << "<p>This is a list of links from " << defaultModuleName()
+ << " to " << module << ". ";
+ out() << "Click on a link to go to the location of the link. The link is marked ";
+ out() << "with red asterisks. ";
+ out() << "Click on the marked link to see if it goes to the right place.</p>\n";
+ TargetList* tlist = qdb_->getTargetList(module);
+ if (tlist) {
+ out() << "<table class=\"valuelist\"><tr valign=\"top\" class=\"odd\"><th class=\"tblConst\">Link to link...</th><th class=\"tblval\">In file...</th><th class=\"tbldscr\">Somewhere after line number...</th></tr>\n";
+ foreach (TargetLoc* t, *tlist) {
+ // e.g.: <a name="link-8421"></a><a href="layout.html">Layout Management</a>
+ out() << "<tr><td class=\"topAlign\">";
+ out() << "<a href=\"" << t->fileName_ << "#" << t->target_ << "\">";
+ out() << t->text_ << "</a></td>";
+ out() << "<td class=\"topAlign\">";
+ QString f = t->loc_->doc().location().filePath();
+ out() << f << "</td>";
+ out() << "<td class=\"topAlign\">";
+ out() << t->loc_->doc().location().lineNo() << "</td></tr>\n";
+ }
+ out() << "</table>\n";
+ }
+ generateFooter();
+ endSubPage();
+ return fileName;
+}
+
+/*!
+ This function writes an html file containing a list of
+ links to broken links that originate in the current
+ module and go nowwhere. It returns the name of the file
+ it generates, and it sets \a count to the number of
+ broken links that were found. The \a marker is used for
+ the same thing the marker is always used for.
+ */
+QString HtmlGenerator::generateLinksToBrokenLinksPage(CodeMarker* marker, int& count)
+{
+ QString fileName;
+ NamespaceNode* node = qdb_->primaryTreeRoot();
+ TargetList* tlist = qdb_->getTargetList("broken");
+ if (tlist && !tlist->isEmpty()) {
+ count = tlist->size();
+ fileName = "aaa-links-to-broken-links.html";
+ beginSubPage(node, fileName);
+ QString title = "Broken links in " + defaultModuleName();
+ generateHeader(title, node, marker);
+ generateTitle(title, Text(), SmallSubTitle, node, marker);
+ out() << "<p>This is a list of broken links in " << defaultModuleName() << ". ";
+ out() << "Click on a link to go to the broken link. ";
+ out() << "The link's target could not be found.</p>\n";
+ out() << "<table class=\"valuelist\"><tr valign=\"top\" class=\"odd\"><th class=\"tblConst\">Link to broken link...</th><th class=\"tblval\">In file...</th><th class=\"tbldscr\">Somewhere after line number...</th></tr>\n";
+ foreach (TargetLoc* t, *tlist) {
+ // e.g.: <a name="link-8421"></a><a href="layout.html">Layout Management</a>
+ out() << "<tr><td class=\"topAlign\">";
+ out() << "<a href=\"" << t->fileName_ << "#" << t->target_ << "\">";
+ out() << t->text_ << "</a></td>";
+ out() << "<td class=\"topAlign\">";
+ QString f = t->loc_->doc().location().filePath();
+ out() << f << "</td>";
+ out() << "<td class=\"topAlign\">";
+ out() << t->loc_->doc().location().lineNo() << "</td></tr>\n";
+ }
+ out() << "</table>\n";
+ generateFooter();
+ endSubPage();
+ }
+ return fileName;
+}
+
+/*!
Generate html from an instance of Atom.
*/
int HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMarker *marker)
@@ -310,6 +478,7 @@ int HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMark
case Atom::AbstractRight:
break;
case Atom::AutoLink:
+ case Atom::NavAutoLink:
if (!inLink_ && !inContents_ && !inSectionHeading_) {
const Node *node = 0;
QString link = getAutoLink(atom, relative, &node);
@@ -321,9 +490,15 @@ int HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMark
if ((relative->parent() != node) && !relative->isObsolete())
link.clear();
}
- if (link.isEmpty())
+ if (link.isEmpty()) {
out() << protectEnc(atom->string());
+ }
else {
+ if (Generator::writeQaPages() && node && (atom->type() != Atom::NavAutoLink)) {
+ QString text = atom->string();
+ QString target = qdb_->getNewLinkTarget(relative, node, outFileName(), text);
+ out() << "<a id=\"" << Doc::canonicalTitle(target) << "\" class=\"qa-mark\"></a>";
+ }
beginLink(link, node, relative);
generateLink(atom, marker);
endLink();
@@ -338,7 +513,10 @@ int HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMark
case Atom::BriefLeft:
// Do not output the brief for QML nodes, doc nodes or collections
// (groups, modules, qml module nodes)
- if (relative->isQmlType() || relative->isDocNode() || relative->isCollectionNode()) {
+ if (relative->isQmlType() ||
+ relative->isDocumentNode() ||
+ relative->isCollectionNode() ||
+ relative->isJsType()) {
skipAhead = skipAtoms(atom, Atom::BriefRight);
break;
}
@@ -374,7 +552,7 @@ int HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMark
}
break;
case Atom::BriefRight:
- if (!relative->isDocNode())
+ if (!relative->isDocumentNode())
out() << "</p>\n";
break;
case Atom::C:
@@ -485,9 +663,9 @@ int HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMark
break;
case Atom::AnnotatedList:
{
- GroupNode* gn = qdb_->getGroup(atom->string());
- if (gn)
- generateList(gn, marker, atom->string());
+ CollectionNode* cn = qdb_->getCollection(atom->string(), Node::DOC);
+ if (cn)
+ generateList(cn, marker, atom->string());
}
break;
case Atom::GeneratedList:
@@ -508,12 +686,12 @@ int HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMark
generateCompactList(Generic, relative, qdb_->getQmlTypes(), true, QStringLiteral(""));
}
else if (atom->string().contains("classesbymodule")) {
- QString moduleName = atom->string().mid(atom->string().indexOf("classesbymodule") + 15).trimmed();
+ QString physicalModuleName = atom->string().mid(atom->string().indexOf("classesbymodule") + 15).trimmed();
QDocDatabase* qdb = QDocDatabase::qdocDB();
- ModuleNode* mn = qdb->findModule(moduleName);
- if (mn) {
+ CollectionNode* cn = qdb->findModule(physicalModuleName);
+ if (cn) {
NodeMap m;
- mn->getMemberClasses(m);
+ cn->getMemberClasses(m);
if (!m.isEmpty()) {
generateAnnotatedList(relative, marker, m);
}
@@ -576,7 +754,7 @@ int HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMark
Remove permanently if it is not missed.
*/
else if (atom->string() == "relatedinline") {
- const DocNode *dn = static_cast<const DocNode *>(relative);
+ const DocumentNode *dn = static_cast<const DocumentNode *>(relative);
if (dn && !dn->members().isEmpty()) {
// Reverse the list into the original scan order.
// Should be sorted. But on what? It may not be a
@@ -806,14 +984,31 @@ int HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMark
out() << "<br/>";
break;
case Atom::Link:
+ case Atom::NavLink:
{
inObsoleteLink = false;
const Node *node = 0;
QString link = getLink(atom, relative, &node);
if (link.isEmpty() && (node != relative) && !noLinkErrors()) {
relative->doc().location().warning(tr("Can't link to '%1'").arg(atom->string()));
+ if (Generator::writeQaPages() && (atom->type() != Atom::NavAutoLink)) {
+ QString text = atom->next()->next()->string();
+ QString target = qdb_->getNewLinkTarget(relative, node, outFileName(), text, true);
+ out() << "<a id=\"" << Doc::canonicalTitle(target) << "\" class=\"qa-mark\"></a>";
+ }
}
else {
+ if (Generator::writeQaPages() && node && (atom->type() != Atom::NavLink)) {
+ QString text = atom->next()->next()->string();
+ QString target = qdb_->getNewLinkTarget(relative, node, outFileName(), text);
+ out() << "<a id=\"" << Doc::canonicalTitle(target) << "\" class=\"qa-mark\"></a>";
+ }
+ /*
+ mws saw this on 17/10/2014.
+ Is this correct? Setting node to 0 means the
+ following test always fails. Did we decide to
+ no longer warn about linking to obsolete things?
+ */
node = 0;
if (node && node->status() == Node::Obsolete) {
if ((relative->parent() != node) && !relative->isObsolete()) {
@@ -1126,6 +1321,8 @@ int HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMark
break;
case Atom::TableOfContents:
break;
+ case Atom::Keyword:
+ break;
case Atom::Target:
out() << "<a name=\"" << Doc::canonicalTitle(atom->string()) << "\"></a>";
break;
@@ -1173,8 +1370,10 @@ void HtmlGenerator::generateClassLikeNode(InnerNode* inner, CodeMarker* marker)
subtitleText << "(" << Atom(Atom::AutoLink, fullTitle) << ")" << Atom(Atom::LineBreak);
generateHeader(title, inner, marker);
+
sections = marker->sections(inner, CodeMarker::Summary, CodeMarker::Okay);
generateTableOfContents(inner,marker,&sections);
+ generateKeywordAnchors(inner);
generateTitle(title, subtitleText, SmallSubTitle, inner, marker);
generateBrief(inner, marker);
generateRequisites(inner, marker);
@@ -1336,16 +1535,22 @@ void HtmlGenerator::generateClassLikeNode(InnerNode* inner, CodeMarker* marker)
Generate the HTML page for a QML type. \qcn is the QML type.
\marker is the code markeup object.
*/
-void HtmlGenerator::generateQmlTypePage(QmlClassNode* qcn, CodeMarker* marker)
+void HtmlGenerator::generateQmlTypePage(QmlTypeNode* qcn, CodeMarker* marker)
{
+ Generator::setQmlTypeContext(qcn);
SubTitleSize subTitleSize = LargeSubTitle;
QList<Section>::const_iterator s;
- QString htmlTitle = qcn->fullTitle() + " QML Type";
+ QString htmlTitle = qcn->fullTitle();
+ if (qcn->isJsType())
+ htmlTitle += " JavaScript Type";
+ else
+ htmlTitle += " QML Type";
generateHeader(htmlTitle, qcn, marker);
QList<Section> sections = marker->qmlSections(qcn, CodeMarker::Summary);
generateTableOfContents(qcn, marker, &sections);
marker = CodeMarker::markerForLanguage(QLatin1String("QML"));
+ generateKeywordAnchors(qcn);
generateTitle(htmlTitle, Text() << qcn->subTitle(), subTitleSize, qcn, marker);
generateBrief(qcn, marker);
generateQmlRequisites(qcn, marker);
@@ -1400,6 +1605,7 @@ void HtmlGenerator::generateQmlTypePage(QmlClassNode* qcn, CodeMarker* marker)
++s;
}
generateFooter(qcn);
+ Generator::setQmlTypeContext(0);
}
/*!
@@ -1410,13 +1616,18 @@ void HtmlGenerator::generateQmlBasicTypePage(QmlBasicTypeNode* qbtn, CodeMarker*
{
SubTitleSize subTitleSize = LargeSubTitle;
QList<Section>::const_iterator s;
- QString htmlTitle = qbtn->fullTitle() + " QML Basic Type";
+ QString htmlTitle = qbtn->fullTitle();
+ if (qbtn->isJsType())
+ htmlTitle += " JavaScript Basic Type";
+ else
+ htmlTitle += " QML Basic Type";
marker = CodeMarker::markerForLanguage(QLatin1String("QML"));
generateHeader(htmlTitle, qbtn, marker);
QList<Section> sections = marker->sections(qbtn, CodeMarker::Summary, CodeMarker::Okay);
generateTableOfContents(qbtn,marker,&sections);
+ generateKeywordAnchors(qbtn);
generateTitle(htmlTitle,
Text() << qbtn->subTitle(),
subTitleSize,
@@ -1436,7 +1647,7 @@ void HtmlGenerator::generateQmlBasicTypePage(QmlBasicTypeNode* qbtn, CodeMarker*
Generate the HTML page for an entity that doesn't map
to any underlying parsable C++ class or QML component.
*/
-void HtmlGenerator::generateDocNode(DocNode* dn, CodeMarker* marker)
+void HtmlGenerator::generateDocumentNode(DocumentNode* dn, CodeMarker* marker)
{
/*
If the document node is a page node, and if the page type
@@ -1462,6 +1673,7 @@ void HtmlGenerator::generateDocNode(DocNode* dn, CodeMarker* marker)
if ((dn->name() != QStringLiteral("index.html")))
generateTableOfContents(dn,marker,0);
+ generateKeywordAnchors(dn);
generateTitle(fullTitle,
Text() << dn->subTitle(),
subTitleSize,
@@ -1546,6 +1758,7 @@ void HtmlGenerator::generateCollectionNode(CollectionNode* cn, CodeMarker* marke
generateHeader(fullTitle, cn, marker);
generateTableOfContents(cn,marker,0);
+ generateKeywordAnchors(cn);
generateTitle(fullTitle, Text() << cn->subTitle(), subTitleSize, cn, marker);
if (cn->isModule()) {
@@ -1603,7 +1816,7 @@ void HtmlGenerator::generateCollectionNode(CollectionNode* cn, CodeMarker* marke
if (cn->isGroup())
generateAnnotatedList(cn, marker, cn->members());
- else if (cn->isQmlModule())
+ else if (cn->isQmlModule() || cn->isJsModule())
generateAnnotatedList(cn, marker, cn->members());
sections = marker->sections(cn, CodeMarker::Detailed, CodeMarker::Okay);
@@ -1646,20 +1859,20 @@ void HtmlGenerator::generateNavigationBar(const QString &title,
return;
if (!homepage.isEmpty())
navigationbar << Atom(Atom::ListItemLeft)
- << Atom(Atom::AutoLink, homepage)
+ << Atom(Atom::NavAutoLink, homepage)
<< Atom(Atom::ListItemRight);
if (!landingpage.isEmpty() && landingpage != title)
navigationbar << Atom(Atom::ListItemLeft)
- << Atom(Atom::AutoLink, landingpage)
+ << Atom(Atom::NavAutoLink, landingpage)
<< Atom(Atom::ListItemRight);
if (node->isClass()) {
const ClassNode *cn = static_cast<const ClassNode *>(node);
- QString name = node->moduleName();
+ QString name = node->physicalModuleName();
if (!cppclassespage.isEmpty())
navigationbar << Atom(Atom::ListItemLeft)
- << Atom(Atom::Link, cppclassespage)
+ << Atom(Atom::NavLink, cppclassespage)
<< Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK)
<< Atom(Atom::String, QLatin1String("C++ Classes"))
<< Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK)
@@ -1670,10 +1883,11 @@ void HtmlGenerator::generateNavigationBar(const QString &title,
<< Atom(Atom::String, cn->name())
<< Atom(Atom::ListItemRight);
}
- else if (node->isQmlType() || node->isQmlBasicType()) {
+ else if (node->isQmlType() || node->isQmlBasicType() ||
+ node->isJsType() || node->isJsBasicType()) {
if (!qmltypespage.isEmpty())
navigationbar << Atom(Atom::ListItemLeft)
- << Atom(Atom::Link, qmltypespage)
+ << Atom(Atom::NavLink, qmltypespage)
<< Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK)
<< Atom(Atom::String, QLatin1String("QML Types"))
<< Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK)
@@ -1685,7 +1899,7 @@ void HtmlGenerator::generateNavigationBar(const QString &title,
else {
if (node->isExampleFile()) {
navigationbar << Atom(Atom::ListItemLeft)
- << Atom(Atom::Link, node->parent()->name())
+ << Atom(Atom::NavLink, node->parent()->name())
<< Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK)
<< Atom(Atom::String, node->parent()->title())
<< Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK)
@@ -1930,11 +2144,11 @@ void HtmlGenerator::generateRequisites(InnerNode *inner, CodeMarker *marker)
if (inner->type() == Node::Class || inner->type() == Node::Namespace) {
//add the QT variable to the map
- if (!inner->moduleName().isEmpty()) {
- ModuleNode* moduleNode = qdb_->findModule(inner->moduleName());
- if (moduleNode && !moduleNode->qtVariable().isEmpty()) {
+ if (!inner->physicalModuleName().isEmpty()) {
+ CollectionNode* cn = qdb_->findModule(inner->physicalModuleName());
+ if (cn && !cn->qtVariable().isEmpty()) {
text.clear();
- text << "QT += " + moduleNode->qtVariable();
+ text << "QT += " + cn->qtVariable();
requisites.insert(qtVariableText, text);
}
}
@@ -2018,7 +2232,7 @@ void HtmlGenerator::generateRequisites(InnerNode *inner, CodeMarker *marker)
Lists the required imports and includes in a table.
The number of rows is known, so this path is simpler than the generateSection() path.
*/
-void HtmlGenerator::generateQmlRequisites(QmlClassNode *qcn, CodeMarker *marker)
+void HtmlGenerator::generateQmlRequisites(QmlTypeNode *qcn, CodeMarker *marker)
{
if (!qcn)
return;
@@ -2040,14 +2254,18 @@ void HtmlGenerator::generateQmlRequisites(QmlClassNode *qcn, CodeMarker *marker)
<< inheritedBytext;
//add the module name and version to the map
- QString qmlModuleVersion;
- QmlModuleNode* qmn = qdb_->findQmlModule(qcn->qmlModuleName());
- if (qmn)
- qmlModuleVersion = qmn->qmlModuleVersion();
+ QString logicalModuleVersion;
+ CollectionNode* collection = 0;
+ if (qcn->isJsNode())
+ qdb_->findJsModule(qcn->logicalModuleName());
+ else
+ qdb_->findQmlModule(qcn->logicalModuleName());
+ if (collection)
+ logicalModuleVersion = collection->logicalModuleVersion();
else
- qmlModuleVersion = qcn->qmlModuleVersion();
+ logicalModuleVersion = qcn->logicalModuleVersion();
text.clear();
- text << "import " + qcn->qmlModuleName() + " " + qmlModuleVersion;
+ text << "import " + qcn->logicalModuleName() + " " + logicalModuleVersion;
requisites.insert(importText, text);
//add the since and project into the map
@@ -2080,7 +2298,7 @@ void HtmlGenerator::generateQmlRequisites(QmlClassNode *qcn, CodeMarker *marker)
}
//add the inherits to the map
- QmlClassNode* base = qcn->qmlBaseNode();
+ QmlTypeNode* base = qcn->qmlBaseNode();
while (base && base->isInternal()) {
base = base->qmlBaseNode();
}
@@ -2097,7 +2315,7 @@ void HtmlGenerator::generateQmlRequisites(QmlClassNode *qcn, CodeMarker *marker)
//add the inherited-by to the map
NodeList subs;
- QmlClassNode::subclasses(qcn->name(), subs);
+ QmlTypeNode::subclasses(qcn->name(), subs);
if (!subs.isEmpty()) {
text.clear();
text << Atom::ParaLeft;
@@ -2217,7 +2435,10 @@ void HtmlGenerator::generateTableOfContents(const Node *node,
}
}
}
- else if (sections && (node->isClass() || node->isNamespace() || node->isQmlType())) {
+ else if (sections && (node->isClass() ||
+ node->isNamespace() ||
+ node->isQmlType() ||
+ node->isJsType())) {
QList<Section>::ConstIterator s = sections->constBegin();
while (s != sections->constEnd()) {
if (!s->members.isEmpty()) {
@@ -2329,7 +2550,7 @@ QString HtmlGenerator::generateListOfAllMemberFile(const InnerNode *inner,
out() << ", including inherited members.</p>\n";
Section section = sections.first();
- generateSectionList(section, 0, marker, CodeMarker::Subpage);
+ generateSectionList(section, inner, marker, CodeMarker::Subpage);
generateFooter();
endSubPage();
@@ -2341,7 +2562,7 @@ QString HtmlGenerator::generateListOfAllMemberFile(const InnerNode *inner,
the members of QML class \a qml_cn, including the inherited
members. The \a marker is used for formatting stuff.
*/
-QString HtmlGenerator::generateAllQmlMembersFile(QmlClassNode* qml_cn, CodeMarker* marker)
+QString HtmlGenerator::generateAllQmlMembersFile(QmlTypeNode* qml_cn, CodeMarker* marker)
{
QList<Section> sections;
QList<Section>::ConstIterator s;
@@ -2364,7 +2585,7 @@ QString HtmlGenerator::generateAllQmlMembersFile(QmlClassNode* qml_cn, CodeMarke
if (!cknl.isEmpty()) {
for (int i=0; i<cknl.size(); i++) {
ClassKeysNodes* ckn = cknl[i];
- const QmlClassNode* qcn = ckn->first;
+ const QmlTypeNode* qcn = ckn->first;
KeysAndNodes& kn = ckn->second;
QStringList& keys = kn.first;
NodeList& nodes = kn.second;
@@ -2386,7 +2607,7 @@ QString HtmlGenerator::generateAllQmlMembersFile(QmlClassNode* qml_cn, CodeMarke
prefix = keys.at(j).mid(1);
prefix = prefix.left(keys.at(j).indexOf("::")+1);
}
- generateQmlItem(nodes[j], qcn, marker, true);
+ generateQmlItem(nodes[j], qml_cn, marker, true);
if (nodes[j]->isAttached())
out() << " [attached]";
//generateSynopsis(nodes[j], qcn, marker, CodeMarker::Subpage, false, &prefix);
@@ -2490,7 +2711,7 @@ QString HtmlGenerator::generateLowStatusMemberFile(InnerNode *inner,
Note that this function currently only handles correctly the
case where \a status is \c {CodeMarker::Obsolete}.
*/
-QString HtmlGenerator::generateQmlMemberFile(QmlClassNode* qcn,
+QString HtmlGenerator::generateQmlMemberFile(QmlTypeNode* qcn,
CodeMarker *marker,
CodeMarker::Status status)
{
@@ -2646,7 +2867,7 @@ void HtmlGenerator::generateAnnotatedList(const Node *relative,
generateFullName(node, relative);
out() << "</p></td>";
- if (!node->isDocNode()) {
+ if (!node->isDocumentNode()) {
Text brief = node->doc().trimmedBriefText(node->name());
if (!brief.isEmpty()) {
out() << "<td class=\"tblDescr\"><p>";
@@ -2815,14 +3036,15 @@ void HtmlGenerator::generateCompactList(ListType listType,
else if (listType == Obsolete) {
QString fileName = fileBase(it.value()) + "-obsolete." + fileExtension();
QString link;
- if (useOutputSubdirs())
+ if (useOutputSubdirs()) {
link = QString("../" + it.value()->outputSubdirectory() + QLatin1Char('/'));
+ }
link += fileName;
out() << "<a href=\"" << link << "\">";
}
QStringList pieces;
- if (it.value()->isQmlType())
+ if (it.value()->isQmlType() || it.value()->isJsType())
pieces << it.value()->name();
else
pieces = it.value()->fullName(relative).split("::");
@@ -2856,7 +3078,7 @@ void HtmlGenerator::generateFunctionIndex(const Node *relative)
char currentLetter;
out() << "<ul>\n";
- NodeMapMap funcIndex = qdb_->getFunctionIndex();
+ NodeMapMap& funcIndex = qdb_->getFunctionIndex();
QMap<QString, NodeMap >::ConstIterator f = funcIndex.constBegin();
while (f != funcIndex.constEnd()) {
out() << "<li>";
@@ -2915,7 +3137,7 @@ void HtmlGenerator::generateQmlItem(const Node *node,
}
marked.replace(QRegExp("<@param>([a-z]+)_([1-9n])</@param>"),
"<i>\\1<sub>\\2</sub></i>");
- marked.replace("<@param>", "<i>");
+ marked.replace("<@param>", "<i> ");
marked.replace("</@param>", "</i>");
if (summary)
@@ -2933,30 +3155,20 @@ void HtmlGenerator::generateQmlItem(const Node *node,
void HtmlGenerator::generateList(const Node* relative, CodeMarker* marker, const QString& selector)
{
- NodeList nl;
- CollectionList cl;
- QRegExp singleDigit("\\b([0-9])\\b");
-
- if (selector == "overviews") {
- CNMap groups;
- qdb_->mergeCollections(Node::Group, groups, relative);
- cl = groups.values();
- foreach (CollectionNode* cn, cl)
- nl.append(cn);
- generateAnnotatedList(relative, marker, nl);
- }
- else if (selector == "cpp-modules") {
- CNMap modules;
- qdb_->mergeCollections(Node::Module, modules, relative);
- cl = modules.values();
- foreach (CollectionNode* cn, cl)
- nl.append(cn);
- generateAnnotatedList(relative, marker, nl);
- }
- else if (selector == "qml-modules") {
- CNMap qmlModules;
- qdb_->mergeCollections(Node::QmlModule, qmlModules, relative);
- cl = qmlModules.values();
+ CNMap cnm;
+ Node::Genus genus = Node::DontCare;
+ if (selector == "overviews")
+ genus = Node::DOC;
+ else if (selector == "cpp-modules")
+ genus = Node::CPP;
+ else if (selector == "qml-modules")
+ genus = Node::QML;
+ else if (selector == "js-modules")
+ genus = Node::JS;
+ if (genus != Node::DontCare) {
+ NodeList nl;
+ qdb_->mergeCollections(genus, cnm, relative);
+ CollectionList cl = cnm.values();
foreach (CollectionNode* cn, cl)
nl.append(cn);
generateAnnotatedList(relative, marker, nl);
@@ -2964,69 +3176,19 @@ void HtmlGenerator::generateList(const Node* relative, CodeMarker* marker, const
else {
/*
\generatelist {selector} is only allowed in a
- comment where the topic is \group, \module, or
- \qmlmodule.
+ comment where the topic is \group, \module,
+ \qmlmodule, or \jsmodule
*/
if (!relative || !relative->isCollectionNode()) {
- relative->doc().location().warning(tr("\\generatelist {%1} is only allowed in \\group, \\module, and \\qmlmodule comments.").arg(selector));
+ relative->doc().location().warning(tr("\\generatelist {%1} is only allowed in \\group, "
+ "\\module, \\qmlmodule, and \\jsmodule comments.").arg(selector));
return;
}
- if (selector == "related") {
- Node* n = const_cast<Node*>(relative);
- CollectionNode* cn = static_cast<CollectionNode*>(n);
- qdb_->mergeCollections(cn);
- generateAnnotatedList(cn, marker, cn->members());
- }
- else {
- Node* n = const_cast<Node*>(relative);
- CollectionNode* cn = static_cast<CollectionNode*>(n);
- qdb_->mergeCollections(cn);
- generateAnnotatedList(cn, marker, cn->members());
- }
- }
-
-#if 0
- QStringList keys = groups.uniqueKeys();
- foreach (QString key, keys) {
- GroupNode* gn = static_cast<GroupNode*>(groups.value(key));
- if (gn) {
- out() << QString("<h3><a href=\"%1\">%2</a></h3>\n").arg(
- linkForNode(gn, relative)).arg(
- protectEnc(gn->fullTitle()));
-#if 0
- if (gn->members().isEmpty())
- continue;
-
- NodeMap nm;
- foreach (Node* member, gn->members()) {
- if (member->isInternal() || member->isExample() || member->isExternalPage() ||
- member->isObsolete())
- continue;
- // not interested either in individual (Qt Designer etc.) manual chapters
- if (member->links().contains(Node::ContentsLink))
- continue;
- QString sortKey = member->fullTitle().toLower();
- if (sortKey.startsWith("the "))
- sortKey.remove(0, 4);
- sortKey.replace(singleDigit, "0\\1");
- nm.insert(sortKey, member);
- }
-
- out() << "<ul>\n";
- QStringList titles = nm.keys();
- foreach (QString t, titles) {
- Node* member = nm.value(t);
- QString title = member->fullTitle();
- if (title.startsWith("The "))
- title.remove(0, 4);
- out() << "<li><a href=\"" << linkForNode(member, relative) << "\">"
- << protectEnc(title) << "</a></li>\n";
- }
- out() << "</ul>\n";
-#endif
- }
+ Node* n = const_cast<Node*>(relative);
+ CollectionNode* cn = static_cast<CollectionNode*>(n);
+ qdb_->mergeCollections(cn);
+ generateAnnotatedList(cn, marker, cn->members());
}
-#endif
}
void HtmlGenerator::generateSection(const NodeList& nl,
@@ -3304,8 +3466,8 @@ QString HtmlGenerator::highlightedCode(const QString& markedCode,
par1 = QStringRef();
const Node* n = qdb_->findTypeNode(arg.toString(), relative);
html += QLatin1String("<span class=\"type\">");
- if (n && n->isQmlBasicType()) {
- if (relative && relative->isQmlType())
+ if (n && (n->isQmlBasicType() || n->isJsBasicType())) {
+ if (relative && (relative->isQmlType() || relative->isJsType()))
addLink(linkForNode(n,relative), arg, &html);
else
html += arg;
@@ -3575,9 +3737,9 @@ QString HtmlGenerator::fileBase(const Node *node) const
QString HtmlGenerator::fileName(const Node *node)
{
if (node->type() == Node::Document) {
- if (static_cast<const DocNode *>(node)->subType() == Node::ExternalPage)
+ if (static_cast<const DocumentNode *>(node)->subType() == Node::ExternalPage)
return node->name();
- if (static_cast<const DocNode *>(node)->subType() == Node::Image)
+ if (static_cast<const DocumentNode *>(node)->subType() == Node::Image)
return node->name();
}
return Generator::fileName(node);
@@ -3675,34 +3837,7 @@ QString HtmlGenerator::getLink(const Atom *atom, const Node *relative, const Nod
if (t.startsWith("mailto:"))
return t;
}
-
- QString ref;
-
- *node = qdb_->findNodeForAtom(atom, relative, ref);
- if (!(*node))
- return QString();
-
- QString url = (*node)->url();
- if (!url.isEmpty()) {
- if (ref.isEmpty())
- return url;
- int hashtag = url.lastIndexOf(QChar('#'));
- if (hashtag != -1)
- url.truncate(hashtag);
- return url + "#" + ref;
- }
- /*
- Given that *node is not null, we now cconstruct a link
- to the page that *node represents, and then if we found
- a target on that page, we connect the target to the link
- with '#'.
- */
- QString link = linkForNode(*node, relative);
- if (*node && (*node)->subType() == Node::Image)
- link = "images/used-in-examples/" + link;
- if (!ref.isEmpty())
- link += QLatin1Char('#') + ref;
- return link;
+ return getAutoLink(atom, relative, node);
}
/*!
@@ -3720,29 +3855,29 @@ QString HtmlGenerator::getLink(const Atom *atom, const Node *relative, const Nod
QString HtmlGenerator::getAutoLink(const Atom *atom, const Node *relative, const Node** node)
{
QString ref;
- QString link;
*node = qdb_->findNodeForAtom(atom, relative, ref);
- if (!(*node))
+ if (!(*node)) {
return QString();
+ }
- QString url = (*node)->url();
- if (!url.isEmpty()) {
- if (ref.isEmpty())
- return url;
- int hashtag = url.lastIndexOf(QChar('#'));
+ QString link = (*node)->url();
+ if (link.isEmpty()) {
+ link = linkForNode(*node, relative);
+ if ((*node)->subType() == Node::Image)
+ link = "images/used-in-examples/" + link;
+ if (!ref.isEmpty())
+ link += QLatin1Char('#') + ref;
+ }
+ else if (!ref.isEmpty()) {
+ int hashtag = link.lastIndexOf(QChar('#'));
if (hashtag != -1)
- url.truncate(hashtag);
- return url + "#" + ref;
+ link.truncate(hashtag);
+ link += "#" + ref;
}
-
- link = linkForNode(*node, relative);
- if (!ref.isEmpty())
- link += QLatin1Char('#') + ref;
return link;
}
-
/*!
Construct the link string for the \a node and return it.
The \a relative node is use to decide the link we are
@@ -3762,25 +3897,15 @@ QString HtmlGenerator::linkForNode(const Node *node, const Node *relative)
return QString();
QString fn = fileName(node);
- if (node && relative && node->parent() != relative) {
- if (node->parent()->isQmlType() && relative->isQmlType()) {
- if (node->parent()->isAbstract()) {
- /*
- This is a bit of a hack. What we discover with
- the three 'if' statements immediately above,
- is that node's parent is marked \qmlabstract
- but the link appears in a qdoc comment for a
- subclass of the node's parent. This means the
- link should refer to the file for the relative
- node, not the file for node.
- */
- fn = fileName(relative);
- }
- }
+ if (node && node->parent() &&
+ (node->parent()->isQmlType() || node->parent()->isJsType())
+ && node->parent()->isAbstract()) {
+ if (Generator::qmlTypeContext())
+ fn = fileName(Generator::qmlTypeContext());
}
QString link = fn;
- if (!node->isInnerNode() || node->type() == Node::QmlPropertyGroup) {
+ if (!node->isInnerNode() || node->isQmlPropertyGroup() || node->isJsPropertyGroup()) {
QString ref = refForNode(node);
if (relative && fn == fileName(relative) && ref == refForNode(relative))
return QString();
@@ -3797,7 +3922,12 @@ QString HtmlGenerator::linkForNode(const Node *node, const Node *relative)
if (node && relative && (node != relative)) {
if (useOutputSubdirs() && !node->isExternalPage() &&
node->outputSubdirectory() != relative->outputSubdirectory()) {
- link.prepend(QString("../" + node->outputSubdirectory() + QLatin1Char('/')));
+ if (link.startsWith(QString(node->outputSubdirectory() + QLatin1Char('/')))) {
+ link.prepend(QString("../"));
+ }
+ else {
+ link.prepend(QString("../" + node->outputSubdirectory() + QLatin1Char('/')));
+ }
}
}
return link;
@@ -3835,6 +3965,7 @@ void HtmlGenerator::generateDetailedMember(const Node *node,
generateMacRef(node, marker);
#endif
generateExtractionMark(node, MemberMark);
+ generateKeywordAnchors(node);
QString nodeRef = refForNode(node);
if (node->type() == Node::Enum
&& (enume = static_cast<const EnumNode *>(node))->flagsType()) {
@@ -3937,7 +4068,7 @@ const QPair<QString,QString> HtmlGenerator::anchorForNode(const Node *node)
anchorPair.first = Generator::fileName(node);
if (node->type() == Node::Document) {
- const DocNode *docNode = static_cast<const DocNode*>(node);
+ const DocumentNode *docNode = static_cast<const DocumentNode*>(node);
anchorPair.second = docNode->title();
}
@@ -4071,6 +4202,7 @@ void HtmlGenerator::generateDetailedQmlMember(Node *node,
generateMacRef(node, marker);
#endif
generateExtractionMark(node, MemberMark);
+ generateKeywordAnchors(node);
out() << "<div class=\"qmlitem\">";
QString nodeRef = refForNode(node);
if (node->type() == Node::QmlPropertyGroup) {
@@ -4176,11 +4308,11 @@ void HtmlGenerator::generateDetailedQmlMember(Node *node,
Output the "Inherits" line for the QML element,
if there should be one.
*/
-void HtmlGenerator::generateQmlInherits(QmlClassNode* qcn, CodeMarker* marker)
+void HtmlGenerator::generateQmlInherits(QmlTypeNode* qcn, CodeMarker* marker)
{
if (!qcn)
return;
- QmlClassNode* base = qcn->qmlBaseNode();
+ QmlTypeNode* base = qcn->qmlBaseNode();
while (base && base->isInternal()) {
base = base->qmlBaseNode();
}
@@ -4203,7 +4335,7 @@ void HtmlGenerator::generateQmlInherits(QmlClassNode* qcn, CodeMarker* marker)
If there is no class node, or if the class node status
is set to Node::Internal, do nothing.
*/
-void HtmlGenerator::generateQmlInstantiates(QmlClassNode* qcn, CodeMarker* marker)
+void HtmlGenerator::generateQmlInstantiates(QmlTypeNode* qcn, CodeMarker* marker)
{
ClassNode* cn = qcn->classNode();
if (cn && (cn->status() != Node::Internal)) {
@@ -4240,14 +4372,17 @@ void HtmlGenerator::generateQmlInstantiates(QmlClassNode* qcn, CodeMarker* marke
void HtmlGenerator::generateInstantiatedBy(ClassNode* cn, CodeMarker* marker)
{
if (cn && cn->status() != Node::Internal && cn->qmlElement() != 0) {
- const QmlClassNode* qcn = cn->qmlElement();
+ const QmlTypeNode* qcn = cn->qmlElement();
Text text;
text << Atom::ParaLeft;
text << Atom(Atom::LinkNode,CodeMarker::stringForNode(cn));
text << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK);
text << Atom(Atom::String, cn->name());
text << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK);
- text << " is instantiated by QML Type ";
+ if (qcn->isQmlType())
+ text << " is instantiated by QML Type ";
+ else
+ text << " is instantiated by Javascript Type ";
text << Atom(Atom::LinkNode,CodeMarker::stringForNode(qcn));
text << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK);
text << Atom(Atom::String, qcn->name());
@@ -4313,7 +4448,7 @@ void HtmlGenerator::generateManifestFiles()
for each manifest file to be generated. \a manifest is the
type of manifest file.
*/
-void HtmlGenerator::generateManifestFile(QString manifest, QString element)
+void HtmlGenerator::generateManifestFile(const QString &manifest, const QString &element)
{
ExampleNodeMap& exampleNodeMap = qdb_->exampleNodeMap();
if (exampleNodeMap.isEmpty())
@@ -4524,6 +4659,9 @@ void HtmlGenerator::generateManifestFile(QString manifest, QString element)
Reads metacontent - additional attributes and tags to apply
when generating manifest files, read from config. Takes the
configuration class \a config as a parameter.
+
+ The manifest metacontent map is cleared immediately after
+ the manifest files have been generated.
*/
void HtmlGenerator::readManifestMetaContent(const Config &config)
{
@@ -4743,9 +4881,9 @@ void HtmlGenerator::writeDitaRefs(const DitaRefList& ditarefs)
xmlWriter().writeStartElement("topicref");
xmlWriter().writeAttribute("navtitle",t->navtitle());
if (t->href().isEmpty()) {
- const DocNode* fn = qdb_->findDocNodeByTitle(t->navtitle());
- if (fn)
- xmlWriter().writeAttribute("href",fileName(fn));
+ const DocumentNode* dn = qdb_->findDocumentNodeByTitle(t->navtitle());
+ if (dn)
+ xmlWriter().writeAttribute("href",fileName(dn));
}
else
xmlWriter().writeAttribute("href",t->href());
diff --git a/src/tools/qdoc/htmlgenerator.h b/src/tools/qdoc/htmlgenerator.h
index 40360da02e..0c7a4af5ff 100644
--- a/src/tools/qdoc/htmlgenerator.h
+++ b/src/tools/qdoc/htmlgenerator.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
@@ -77,10 +77,10 @@ public:
HtmlGenerator();
~HtmlGenerator();
- virtual void initializeGenerator(const Config& config);
- virtual void terminateGenerator();
- virtual QString format();
- virtual void generateDocs();
+ virtual void initializeGenerator(const Config& config) Q_DECL_OVERRIDE;
+ virtual void terminateGenerator() Q_DECL_OVERRIDE;
+ virtual QString format() Q_DECL_OVERRIDE;
+ virtual void generateDocs() Q_DECL_OVERRIDE;
void generateManifestFiles();
QString protectEnc(const QString &string);
@@ -89,20 +89,24 @@ public:
static QString sinceTitle(int i) { return sinceTitles[i]; }
protected:
+ virtual void generateQAPage() Q_DECL_OVERRIDE;
+ QString generateLinksToLinksPage(const QString& module, CodeMarker* marker);
+ QString generateLinksToBrokenLinksPage(CodeMarker* marker, int& count);
virtual int generateAtom(const Atom *atom,
const Node *relative,
- CodeMarker *marker);
- virtual void generateClassLikeNode(InnerNode* inner, CodeMarker* marker);
- virtual void generateQmlTypePage(QmlClassNode* qcn, CodeMarker* marker);
- virtual void generateQmlBasicTypePage(QmlBasicTypeNode* qbtn, CodeMarker* marker);
- virtual void generateDocNode(DocNode* dn, CodeMarker* marker);
- virtual void generateCollectionNode(CollectionNode* cn, CodeMarker* marker);
- virtual QString fileExtension() const;
+ CodeMarker *marker) Q_DECL_OVERRIDE;
+ virtual void generateClassLikeNode(InnerNode* inner, CodeMarker* marker) Q_DECL_OVERRIDE;
+ virtual void generateQmlTypePage(QmlTypeNode* qcn, CodeMarker* marker) Q_DECL_OVERRIDE;
+ virtual void generateQmlBasicTypePage(QmlBasicTypeNode* qbtn, CodeMarker* marker) Q_DECL_OVERRIDE;
+ virtual void generateDocumentNode(DocumentNode* dn, CodeMarker* marker) Q_DECL_OVERRIDE;
+ virtual void generateCollectionNode(CollectionNode* cn, CodeMarker* marker) Q_DECL_OVERRIDE;
+ virtual QString fileExtension() const Q_DECL_OVERRIDE;
virtual QString refForNode(const Node *node);
virtual QString linkForNode(const Node *node, const Node *relative);
- void generateManifestFile(QString manifest, QString element);
+ void generateManifestFile(const QString &manifest, const QString &element);
void readManifestMetaContent(const Config &config);
+ void generateKeywordAnchors(const Node* node);
private:
enum SubTitleSize { SmallSubTitle, LargeSubTitle };
@@ -135,7 +139,7 @@ private:
void generateFooter(const Node *node = 0);
void generateRequisites(InnerNode *inner,
CodeMarker *marker);
- void generateQmlRequisites(QmlClassNode *qcn,
+ void generateQmlRequisites(QmlTypeNode *qcn,
CodeMarker *marker);
void generateBrief(const Node *node,
CodeMarker *marker,
@@ -147,11 +151,11 @@ private:
void generateSidebar();
QString generateListOfAllMemberFile(const InnerNode *inner,
CodeMarker *marker);
- QString generateAllQmlMembersFile(QmlClassNode* qml_cn, CodeMarker* marker);
+ QString generateAllQmlMembersFile(QmlTypeNode* qml_cn, CodeMarker* marker);
QString generateLowStatusMemberFile(InnerNode *inner,
CodeMarker *marker,
CodeMarker::Status status);
- QString generateQmlMemberFile(QmlClassNode* qcn,
+ QString generateQmlMemberFile(QmlTypeNode* qcn,
CodeMarker *marker,
CodeMarker::Status status);
void generateClassHierarchy(const Node *relative, NodeMap &classMap);
@@ -179,8 +183,8 @@ private:
void generateDetailedQmlMember(Node *node,
const InnerNode *relative,
CodeMarker *marker);
- void generateQmlInherits(QmlClassNode* qcn, CodeMarker* marker);
- void generateQmlInstantiates(QmlClassNode* qcn, CodeMarker* marker);
+ void generateQmlInherits(QmlTypeNode* qcn, CodeMarker* marker) Q_DECL_OVERRIDE;
+ void generateQmlInstantiates(QmlTypeNode* qcn, CodeMarker* marker);
void generateInstantiatedBy(ClassNode* cn, CodeMarker* marker);
void generateRequisitesTable(const QStringList& requisitesOrder, QMap<QString, Text>& requisites);
@@ -210,7 +214,7 @@ private:
QString getAutoLink(const Atom *atom, const Node *relative, const Node** node);
QString registerRef(const QString& ref);
- virtual QString fileBase(const Node *node) const;
+ virtual QString fileBase(const Node *node) const Q_DECL_OVERRIDE;
QString fileName(const Node *node);
static int hOffset(const Node *node);
static bool isThreeColumnEnumValueTable(const Atom *atom);
diff --git a/src/tools/qdoc/jscodemarker.cpp b/src/tools/qdoc/jscodemarker.cpp
index 3a29a4db3f..2a98b7372d 100644
--- a/src/tools/qdoc/jscodemarker.cpp
+++ b/src/tools/qdoc/jscodemarker.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
diff --git a/src/tools/qdoc/jscodemarker.h b/src/tools/qdoc/jscodemarker.h
index 52fe8855af..d9f6eb5a10 100644
--- a/src/tools/qdoc/jscodemarker.h
+++ b/src/tools/qdoc/jscodemarker.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
@@ -50,14 +50,14 @@ public:
JsCodeMarker();
~JsCodeMarker();
- virtual bool recognizeCode(const QString &code);
- virtual bool recognizeExtension(const QString &ext);
- virtual bool recognizeLanguage(const QString &language);
- virtual Atom::Type atomType() const;
+ virtual bool recognizeCode(const QString &code) Q_DECL_OVERRIDE;
+ virtual bool recognizeExtension(const QString &ext) Q_DECL_OVERRIDE;
+ virtual bool recognizeLanguage(const QString &language) Q_DECL_OVERRIDE;
+ virtual Atom::Type atomType() const Q_DECL_OVERRIDE;
virtual QString markedUpCode(const QString &code,
const Node *relative,
- const Location &location);
+ const Location &location) Q_DECL_OVERRIDE;
private:
QString addMarkUp(const QString &code, const Node *relative,
diff --git a/src/tools/qdoc/location.cpp b/src/tools/qdoc/location.cpp
index 040dd0cd88..12dc9e1b4c 100644
--- a/src/tools/qdoc/location.cpp
+++ b/src/tools/qdoc/location.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
@@ -256,7 +256,7 @@ QString Location::canonicalRelativePath(const QString &path)
*/
void Location::warning(const QString& message, const QString& details) const
{
- if (!Generator::runPrepareOnly())
+ if (!Generator::preparing())
emitMessage(Warning, message, details);
}
@@ -267,7 +267,7 @@ void Location::warning(const QString& message, const QString& details) const
*/
void Location::error(const QString& message, const QString& details) const
{
- if (!Generator::runPrepareOnly())
+ if (!Generator::preparing())
emitMessage(Error, message, details);
}
@@ -286,6 +286,15 @@ void Location::fatal(const QString& message, const QString& details) const
}
/*!
+ Writes \a message and \a detals to stderr as a formatted
+ report message.
+ */
+void Location::report(const QString& message, const QString& details) const
+{
+ emitMessage(Report, message, details);
+}
+
+/*!
Gets several parameters from the \a config, including
tab size, program name, and a regular expression that
appears to be used for matching certain error messages
@@ -371,7 +380,8 @@ void Location::emitMessage(MessageType type,
result.prepend(tr(": error: "));
else if (type == Warning)
result.prepend(tr(": warning: "));
- result.prepend(toString());
+ if (type != Report)
+ result.prepend(toString());
fprintf(stderr, "%s\n", result.toLatin1().data());
fflush(stderr);
}
diff --git a/src/tools/qdoc/location.h b/src/tools/qdoc/location.h
index eb4dbbae98..5250e27a47 100644
--- a/src/tools/qdoc/location.h
+++ b/src/tools/qdoc/location.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
@@ -81,6 +81,8 @@ public:
const QString& details = QString()) const;
void fatal(const QString& message,
const QString& details = QString()) const;
+ void report(const QString& message,
+ const QString& details = QString()) const;
static const Location null;
@@ -94,7 +96,7 @@ public:
static QString canonicalRelativePath(const QString &path);
private:
- enum MessageType { Warning, Error };
+ enum MessageType { Warning, Error, Report };
struct StackEntry
{
diff --git a/src/tools/qdoc/main.cpp b/src/tools/qdoc/main.cpp
index 118c206f16..74d706efe1 100644
--- a/src/tools/qdoc/main.cpp
+++ b/src/tools/qdoc/main.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
@@ -38,7 +38,6 @@
#include "config.h"
#include "cppcodemarker.h"
#include "cppcodeparser.h"
-#include "ditaxmlgenerator.h"
#include "doc.h"
#include "htmlgenerator.h"
#include "location.h"
@@ -63,7 +62,6 @@
QT_BEGIN_NAMESPACE
-
bool creationTimeBefore(const QFileInfo &fi1, const QFileInfo &fi2)
{
return fi1.lastModified() < fi2.lastModified();
@@ -71,6 +69,8 @@ bool creationTimeBefore(const QFileInfo &fi1, const QFileInfo &fi2)
static bool highlighting = false;
static bool showInternal = false;
+static bool singleExec = false;
+static bool writeQaPages = false;
static bool redirectDocumentationToDevNull = false;
static bool noLinkErrors = false;
static bool autolinkErrors = false;
@@ -80,14 +80,22 @@ static QStringList dependModules;
static QStringList indexDirs;
static QString currentDir;
static QString prevCurrentDir;
+static QHash<QString,QString> defaults;
+#ifndef QT_NO_TRANSLATION
+typedef QPair<QString, QTranslator*> Translator;
+static QList<Translator> translators;
+#endif
-
+/*!
+ Read some XML indexes containing definitions from other
+ documentation sets. \a config contains a variable that
+ lists directories where index files can bge found. It also
+ contains the \c depends variable, which lists the modules
+ that the current module depends on.
+*/
static void loadIndexFiles(Config& config)
{
QDocDatabase* qdb = QDocDatabase::qdocDB();
- /*
- Read some XML indexes containing definitions from other documentation sets.
- */
QStringList indexFiles;
QStringList configIndexes = config.getStringList(CONFIG_INDEXES);
foreach (const QString &index, configIndexes) {
@@ -194,35 +202,17 @@ static void loadIndexFiles(Config& config)
*/
static void processQdocconfFile(const QString &fileName)
{
-#ifndef QT_NO_TRANSLATION
- QList<QTranslator *> translators;
-#endif
-
/*
The Config instance represents the configuration data for qdoc.
- All the other classes are initialized with the config. Here we
+ All the other classes are initialized with the config. Below, we
initialize the configuration with some default values.
- */
- Config config(QCoreApplication::translate("QDoc", "qdoc"));
- /*
- The default indent for code is 4.
- The default value for false is 0.
- The default supported file extensions are cpp, h, qdoc and qml.
- The default language is c++.
- The default output format is html.
- The default tab size is 8.
- And those are all the default values for configuration variables.
+ I don't think the call to translate() does anything here. For one
+ thing, the translators haven't been installed at this point. And
+ I doubt any translator would translate QDoc anyway. But I left it
+ here because it does no harm.
*/
- static QHash<QString,QString> defaults;
- if (defaults.isEmpty()) {
- defaults.insert(CONFIG_CODEINDENT, QLatin1String("4"));
- defaults.insert(CONFIG_FALSEHOODS, QLatin1String("0"));
- defaults.insert(CONFIG_FILEEXTENSIONS, QLatin1String("*.cpp *.h *.qdoc *.qml"));
- defaults.insert(CONFIG_LANGUAGE, QLatin1String("Cpp"));
- defaults.insert(CONFIG_OUTPUTFORMATS, QLatin1String("HTML"));
- defaults.insert(CONFIG_TABSIZE, QLatin1String("8"));
- }
+ Config config(QCoreApplication::translate("QDoc", "qdoc"));
QHash<QString,QString>::iterator iter;
for (iter = defaults.begin(); iter != defaults.end(); ++iter)
@@ -230,6 +220,8 @@ static void processQdocconfFile(const QString &fileName)
config.setStringList(CONFIG_SYNTAXHIGHLIGHTING, QStringList(highlighting ? "true" : "false"));
config.setStringList(CONFIG_SHOWINTERNAL, QStringList(showInternal ? "true" : "false"));
+ config.setStringList(CONFIG_SINGLEEXEC, QStringList(singleExec ? "true" : "false"));
+ config.setStringList(CONFIG_WRITEQAPAGES, QStringList(writeQaPages ? "true" : "false"));
config.setStringList(CONFIG_REDIRECTDOCUMENTATIONTODEVNULL, QStringList(redirectDocumentationToDevNull ? "true" : "false"));
config.setStringList(CONFIG_NOLINKERRORS, QStringList(noLinkErrors ? "true" : "false"));
config.setStringList(CONFIG_AUTOLINKERRORS, QStringList(autolinkErrors ? "true" : "false"));
@@ -247,8 +239,8 @@ static void processQdocconfFile(const QString &fileName)
currentDir = QFileInfo(fileName).path();
Location::initialize(config);
config.load(fileName);
- QString project = config.getString(CONFIG_PROJECT).toLower();
- //qDebug() << "\nStart project:" << project;
+ QString project = config.getString(CONFIG_PROJECT);
+ //qDebug() << "Start project:" << project;
/*
Add the defines to the configuration variables.
*/
@@ -261,17 +253,24 @@ static void processQdocconfFile(const QString &fileName)
if (!currentDir.isEmpty())
QDir::setCurrent(currentDir);
- QString phase;
- if (Generator::runPrepareOnly())
- phase = " in -prepare mode ";
- else if (Generator::runGenerateOnly())
- phase = " in -generate mode ";
+ QString phase = " in -";
+ if (Generator::singleExec())
+ phase += "single exec mode, ";
+ else
+ phase += "separate exec mode, ";
+ if (Generator::preparing())
+ phase += "prepare phase ";
+ else if (Generator::generating())
+ phase += "generate phase ";
QString msg = "Running qdoc for " + config.getString(CONFIG_PROJECT) + phase;
Location::logToStdErr(msg);
/*
Initialize all the classes and data structures with the
- qdoc configuration.
+ qdoc configuration. This is safe to do for each qdocconf
+ file processed, because all the data structures created
+ are either cleared after they have been used, or they
+ are cleared in the terminate() functions below.
*/
Location::initialize(config);
Tokenizer::initialize(config);
@@ -282,16 +281,32 @@ static void processQdocconfFile(const QString &fileName)
#ifndef QT_NO_TRANSLATION
/*
- Load the language translators, if the configuration specifies any.
+ Load the language translators, if the configuration specifies any,
+ but only if they haven't already been loaded. This works in both
+ -prepare/-generate mode and -singleexec mode.
*/
QStringList fileNames = config.getStringList(CONFIG_TRANSLATORS);
QStringList::ConstIterator fn = fileNames.constBegin();
while (fn != fileNames.constEnd()) {
- QTranslator *translator = new QTranslator(0);
- if (!translator->load(*fn))
- config.lastLocation().error(QCoreApplication::translate("QDoc", "Cannot load translator '%1'").arg(*fn));
- QCoreApplication::instance()->installTranslator(translator);
- translators.append(translator);
+ bool found = false;
+ if (!translators.isEmpty()) {
+ for (int i=0; i<translators.size(); ++i) {
+ if (translators.at(i).first == *fn) {
+ found = true;
+ break;
+ }
+ }
+ }
+ if (!found) {
+ QTranslator *translator = new QTranslator(0);
+ if (!translator->load(*fn)) {
+ config.lastLocation().error(QCoreApplication::translate("QDoc", "Cannot load translator '%1'").arg(*fn));
+ }
+ else {
+ QCoreApplication::instance()->installTranslator(translator);
+ translators.append(Translator(*fn, translator));
+ }
+ }
++fn;
}
#endif
@@ -311,175 +326,228 @@ static void processQdocconfFile(const QString &fileName)
will be stored. The database includes a tree of nodes, which gets
built as the source files are parsed. The documentation output is
generated by traversing that tree.
+
+ Note: qdocDB() allocates a new instance only if no instance exists.
+ So it is safe to call qdocDB() any time.
*/
QDocDatabase* qdb = QDocDatabase::qdocDB();
qdb->setVersion(config.getString(CONFIG_VERSION));
qdb->setShowInternal(config.getBool(CONFIG_SHOWINTERNAL));
+ qdb->setSingleExec(config.getBool(CONFIG_SINGLEEXEC));
/*
By default, the only output format is HTML.
*/
QSet<QString> outputFormats = config.getOutputFormats();
Location outputFormatsLocation = config.lastLocation();
- //if (!Generator::runPrepareOnly())
- Generator::debug(" loading index files");
- loadIndexFiles(config);
- qdb->newPrimaryTree(config.getString(CONFIG_PROJECT));
- qdb->setSearchOrder();
- Generator::debug(" done loading index files");
+ qdb->clearSearchOrder();
+ QString p = config.getString(CONFIG_PROJECT).toLower();
+ if (!Generator::singleExec()) {
+ Generator::debug(" loading index files");
+ loadIndexFiles(config);
+ Generator::debug(" done loading index files");
+ qdb->newPrimaryTree(p);
+ }
+ else if (Generator::preparing())
+ qdb->newPrimaryTree(p);
+ else
+ qdb->setPrimaryTree(p);
+
+ dependModules = config.getStringList(CONFIG_DEPENDS);
+ dependModules.removeDuplicates();
+ qdb->setSearchOrder(dependModules);
QSet<QString> excludedDirs;
QSet<QString> excludedFiles;
- QStringList headerList;
- QStringList sourceList;
QStringList excludedDirsList;
QStringList excludedFilesList;
- Generator::debug("Reading excludedirs");
- excludedDirsList = config.getCanonicalPathList(CONFIG_EXCLUDEDIRS);
- foreach (const QString &excludeDir, excludedDirsList) {
- QString p = QDir::fromNativeSeparators(excludeDir);
- QDir tmp(p);
- if (tmp.exists())
- excludedDirs.insert(p);
- }
+ if (!Generator::singleExec() || !Generator::generating()) {
+ QStringList headerList;
+ QStringList sourceList;
+
+ Generator::debug("Reading excludedirs");
+ excludedDirsList = config.getCanonicalPathList(CONFIG_EXCLUDEDIRS);
+ foreach (const QString &excludeDir, excludedDirsList) {
+ QString p = QDir::fromNativeSeparators(excludeDir);
+ QDir tmp(p);
+ if (tmp.exists())
+ excludedDirs.insert(p);
+ }
- Generator::debug("Reading excludefiles");
- excludedFilesList = config.getCanonicalPathList(CONFIG_EXCLUDEFILES);
- foreach (const QString& excludeFile, excludedFilesList) {
- QString p = QDir::fromNativeSeparators(excludeFile);
- excludedFiles.insert(p);
- }
+ Generator::debug("Reading excludefiles");
+ excludedFilesList = config.getCanonicalPathList(CONFIG_EXCLUDEFILES);
+ foreach (const QString& excludeFile, excludedFilesList) {
+ QString p = QDir::fromNativeSeparators(excludeFile);
+ excludedFiles.insert(p);
+ }
- Generator::debug("Reading headerdirs");
- headerList = config.getAllFiles(CONFIG_HEADERS,CONFIG_HEADERDIRS,excludedDirs,excludedFiles);
- QMap<QString,QString> headers;
- QMultiMap<QString,QString> headerFileNames;
- for (int i=0; i<headerList.size(); ++i) {
- if (headerList[i].contains(QString("doc/snippets")))
- continue;
- if (headers.contains(headerList[i]))
- continue;
- headers.insert(headerList[i],headerList[i]);
- QString t = headerList[i].mid(headerList[i].lastIndexOf('/')+1);
- headerFileNames.insert(t,t);
- }
+ Generator::debug("Reading headerdirs");
+ headerList = config.getAllFiles(CONFIG_HEADERS,CONFIG_HEADERDIRS,excludedDirs,excludedFiles);
+ QMap<QString,QString> headers;
+ QMultiMap<QString,QString> headerFileNames;
+ for (int i=0; i<headerList.size(); ++i) {
+ if (headerList[i].contains(QString("doc/snippets")))
+ continue;
+ if (headers.contains(headerList[i]))
+ continue;
+ headers.insert(headerList[i],headerList[i]);
+ QString t = headerList[i].mid(headerList[i].lastIndexOf('/')+1);
+ headerFileNames.insert(t,t);
+ }
- Generator::debug("Reading sourcedirs");
- sourceList = config.getAllFiles(CONFIG_SOURCES,CONFIG_SOURCEDIRS,excludedDirs,excludedFiles);
- QMap<QString,QString> sources;
- QMultiMap<QString,QString> sourceFileNames;
- for (int i=0; i<sourceList.size(); ++i) {
- if (sourceList[i].contains(QString("doc/snippets")))
- continue;
- if (sources.contains(sourceList[i]))
- continue;
- sources.insert(sourceList[i],sourceList[i]);
- QString t = sourceList[i].mid(sourceList[i].lastIndexOf('/')+1);
- sourceFileNames.insert(t,t);
- }
- /*
- Find all the qdoc files in the example dirs, and add
- them to the source files to be parsed.
- */
- Generator::debug("Reading exampledirs");
- QStringList exampleQdocList = config.getExampleQdocFiles(excludedDirs, excludedFiles);
- for (int i=0; i<exampleQdocList.size(); ++i) {
- if (!sources.contains(exampleQdocList[i])) {
- sources.insert(exampleQdocList[i],exampleQdocList[i]);
- QString t = exampleQdocList[i].mid(exampleQdocList[i].lastIndexOf('/')+1);
+ Generator::debug("Reading sourcedirs");
+ sourceList = config.getAllFiles(CONFIG_SOURCES,CONFIG_SOURCEDIRS,excludedDirs,excludedFiles);
+ QMap<QString,QString> sources;
+ QMultiMap<QString,QString> sourceFileNames;
+ for (int i=0; i<sourceList.size(); ++i) {
+ if (sourceList[i].contains(QString("doc/snippets")))
+ continue;
+ if (sources.contains(sourceList[i]))
+ continue;
+ sources.insert(sourceList[i],sourceList[i]);
+ QString t = sourceList[i].mid(sourceList[i].lastIndexOf('/')+1);
sourceFileNames.insert(t,t);
}
- }
+ /*
+ Find all the qdoc files in the example dirs, and add
+ them to the source files to be parsed.
+ */
+ Generator::debug("Reading exampledirs");
+ QStringList exampleQdocList = config.getExampleQdocFiles(excludedDirs, excludedFiles);
+ for (int i=0; i<exampleQdocList.size(); ++i) {
+ if (!sources.contains(exampleQdocList[i])) {
+ sources.insert(exampleQdocList[i],exampleQdocList[i]);
+ QString t = exampleQdocList[i].mid(exampleQdocList[i].lastIndexOf('/')+1);
+ sourceFileNames.insert(t,t);
+ }
+ }
- Generator::debug("Adding doc/image dirs found in exampledirs to imagedirs");
- QSet<QString> exampleImageDirs;
- QStringList exampleImageList = config.getExampleImageFiles(excludedDirs, excludedFiles);
- for (int i=0; i<exampleImageList.size(); ++i) {
- if (exampleImageList[i].contains("doc/images")) {
- QString t = exampleImageList[i].left(exampleImageList[i].lastIndexOf("doc/images")+10);
- if (!exampleImageDirs.contains(t)) {
- exampleImageDirs.insert(t);
+ Generator::debug("Adding doc/image dirs found in exampledirs to imagedirs");
+ QSet<QString> exampleImageDirs;
+ QStringList exampleImageList = config.getExampleImageFiles(excludedDirs, excludedFiles);
+ for (int i=0; i<exampleImageList.size(); ++i) {
+ if (exampleImageList[i].contains("doc/images")) {
+ QString t = exampleImageList[i].left(exampleImageList[i].lastIndexOf("doc/images")+10);
+ if (!exampleImageDirs.contains(t)) {
+ exampleImageDirs.insert(t);
+ }
}
}
- }
- Generator::augmentImageDirs(exampleImageDirs);
+ Generator::augmentImageDirs(exampleImageDirs);
+
+ /*
+ Parse each header file in the set using the appropriate parser and add it
+ to the big tree.
+ */
+ QSet<CodeParser *> usedParsers;
+
+ Generator::debug("Parsing header files");
+ int parsed = 0;
+ QMap<QString,QString>::ConstIterator h = headers.constBegin();
+ while (h != headers.constEnd()) {
+ CodeParser *codeParser = CodeParser::parserForHeaderFile(h.key());
+ if (codeParser) {
+ ++parsed;
+ Generator::debug(QString("Parsing " + h.key()));
+ codeParser->parseHeaderFile(config.location(), h.key());
+ usedParsers.insert(codeParser);
+ }
+ ++h;
+ }
- /*
- Parse each header file in the set using the appropriate parser and add it
- to the big tree.
- */
- QSet<CodeParser *> usedParsers;
-
- Generator::debug("Parsing header files");
- int parsed = 0;
- QMap<QString,QString>::ConstIterator h = headers.constBegin();
- while (h != headers.constEnd()) {
- CodeParser *codeParser = CodeParser::parserForHeaderFile(h.key());
- if (codeParser) {
- ++parsed;
- Generator::debug(QString("Parsing " + h.key()));
- codeParser->parseHeaderFile(config.location(), h.key());
- usedParsers.insert(codeParser);
+ foreach (CodeParser *codeParser, usedParsers)
+ codeParser->doneParsingHeaderFiles();
+
+ usedParsers.clear();
+ qdb->resolveInheritance();
+
+ /*
+ Parse each source text file in the set using the appropriate parser and
+ add it to the big tree.
+ */
+ parsed = 0;
+ Generator::debug("Parsing source files");
+ QMap<QString,QString>::ConstIterator s = sources.constBegin();
+ while (s != sources.constEnd()) {
+ CodeParser *codeParser = CodeParser::parserForSourceFile(s.key());
+ if (codeParser) {
+ ++parsed;
+ Generator::debug(QString("Parsing " + s.key()));
+ codeParser->parseSourceFile(config.location(), s.key());
+ usedParsers.insert(codeParser);
+ }
+ ++s;
}
- ++h;
+ Generator::debug(QString("Parsing done."));
+
+ foreach (CodeParser *codeParser, usedParsers)
+ codeParser->doneParsingSourceFiles();
+
+ /*
+ Now the primary tree has been built from all the header and
+ source files. Resolve all the class names, function names,
+ targets, URLs, links, and other stuff that needs resolving.
+ */
+ Generator::debug("Resolving stuff prior to generating docs");
+ qdb->resolveIssues();
}
+ else {
+ Generator::debug("Reading excludedirs");
+ excludedDirsList = config.getCanonicalPathList(CONFIG_EXCLUDEDIRS);
+ foreach (const QString &excludeDir, excludedDirsList) {
+ QString p = QDir::fromNativeSeparators(excludeDir);
+ QDir tmp(p);
+ if (tmp.exists())
+ excludedDirs.insert(p);
+ }
- foreach (CodeParser *codeParser, usedParsers)
- codeParser->doneParsingHeaderFiles();
-
- usedParsers.clear();
- qdb->resolveInheritance();
+ Generator::debug("Reading excludefiles");
+ excludedFilesList = config.getCanonicalPathList(CONFIG_EXCLUDEFILES);
+ foreach (const QString& excludeFile, excludedFilesList) {
+ QString p = QDir::fromNativeSeparators(excludeFile);
+ excludedFiles.insert(p);
+ }
- /*
- Parse each source text file in the set using the appropriate parser and
- add it to the big tree.
- */
- parsed = 0;
- Generator::debug("Parsing source files");
- QMap<QString,QString>::ConstIterator s = sources.constBegin();
- while (s != sources.constEnd()) {
- CodeParser *codeParser = CodeParser::parserForSourceFile(s.key());
- if (codeParser) {
- ++parsed;
- Generator::debug(QString("Parsing " + s.key()));
- codeParser->parseSourceFile(config.location(), s.key());
- usedParsers.insert(codeParser);
+ Generator::debug("Adding doc/image dirs found in exampledirs to imagedirs");
+ QSet<QString> exampleImageDirs;
+ QStringList exampleImageList = config.getExampleImageFiles(excludedDirs, excludedFiles);
+ for (int i=0; i<exampleImageList.size(); ++i) {
+ if (exampleImageList[i].contains("doc/images")) {
+ QString t = exampleImageList[i].left(exampleImageList[i].lastIndexOf("doc/images")+10);
+ if (!exampleImageDirs.contains(t)) {
+ exampleImageDirs.insert(t);
+ }
+ }
}
- ++s;
+ Generator::augmentImageDirs(exampleImageDirs);
+ qdb->resolveStuff();
}
- Generator::debug(QString("Parsing done."));
-
- foreach (CodeParser *codeParser, usedParsers)
- codeParser->doneParsingSourceFiles();
/*
- Now the big tree has been built from all the header and
- source files. Resolve all the class names, function names,
- targets, URLs, links, and other stuff that needs resolving.
- */
- Generator::debug("Resolving stuff prior to generating docs");
- qdb->resolveIssues();
-
- /*
- The tree is built and all the stuff that needed resolving
- has been resolved. Now traverse the tree and generate the
- documentation output. More than one output format can be
- requested. The tree is traversed for each one.
+ The primary tree is built and all the stuff that needed
+ resolving has been resolved. Now traverse the tree and
+ generate the documentation output. More than one output
+ format can be requested. The tree is traversed for each
+ one.
*/
Generator::debug("Generating docs");
QSet<QString>::ConstIterator of = outputFormats.constBegin();
while (of != outputFormats.constEnd()) {
Generator* generator = Generator::generatorForFormat(*of);
if (generator == 0)
- outputFormatsLocation.fatal(QCoreApplication::translate("QDoc", "Unknown output format '%1'").arg(*of));
+ outputFormatsLocation.fatal(QCoreApplication::translate("QDoc",
+ "Unknown output format '%1'").arg(*of));
generator->generateDocs();
++of;
}
+#if 0
+ if (Generator::generating() && Generator::writeQaPages())
+ qdb->printLinkCounts(project);
+#endif
+ qdb->clearLinkCounts();
-
- //Generator::writeOutFileNames();
- Generator::debug("Shutting down qdoc");
+ Generator::debug("Terminating qdoc classes");
if (Generator::debugging())
Generator::stopDebugging(project);
@@ -492,17 +560,7 @@ static void processQdocconfFile(const QString &fileName)
Location::terminate();
QDir::setCurrent(prevCurrentDir);
-#ifndef QT_NO_TRANSLATION
- qDeleteAll(translators);
-#endif
-#ifdef DEBUG_SHUTDOWN_CRASH
- qDebug() << "main(): Delete qdoc database";
-#endif
- QDocDatabase::destroyQdocDB();
-#ifdef DEBUG_SHUTDOWN_CRASH
- qDebug() << "main(): qdoc database deleted";
-#endif
- Generator::debug("qdoc finished!");
+ Generator::debug("qdoc classes terminated");
}
extern Q_CORE_EXPORT QBasicAtomicInt qt_qhash_seed;
@@ -536,7 +594,6 @@ int main(int argc, char **argv)
QmlCodeMarker qmlMarker;
HtmlGenerator htmlGenerator;
- DitaXmlGenerator ditaxmlGenerator;
QCommandLineParser parser;
parser.setApplicationDescription(QCoreApplication::translate("qdoc", "Qt documentation generator"));
@@ -621,12 +678,22 @@ int main(int argc, char **argv)
logProgressOption.setDescription(QCoreApplication::translate("qdoc", "Log progress on stderr."));
parser.addOption(logProgressOption);
+ QCommandLineOption singleExecOption(QStringList() << QStringLiteral("single-exec"));
+ singleExecOption.setDescription(QCoreApplication::translate("qdoc", "Run qdoc once over all the qdoc conf files."));
+ parser.addOption(singleExecOption);
+
+ QCommandLineOption writeQaPagesOption(QStringList() << QStringLiteral("write-qa-pages"));
+ writeQaPagesOption.setDescription(QCoreApplication::translate("qdoc", "Write QA pages."));
+ parser.addOption(writeQaPagesOption);
+
parser.process(app);
defines += parser.values(defineOption);
dependModules += parser.values(dependsOption);
highlighting = parser.isSet(highlightingOption);
showInternal = parser.isSet(showInternalOption);
+ singleExec = parser.isSet(singleExecOption);
+ writeQaPages = parser.isSet(writeQaPagesOption);
redirectDocumentationToDevNull = parser.isSet(redirectDocumentationToDevNullOption);
Config::generateExamples = !parser.isSet(noExamplesOption);
foreach (const QString &indexDir, parser.values(indexDirOption)) {
@@ -650,21 +717,73 @@ int main(int argc, char **argv)
Generator::setQDocPass(Generator::Prepare);
if (parser.isSet(generateOption))
Generator::setQDocPass(Generator::Generate);
+ if (parser.isSet(singleExecOption))
+ Generator::setSingleExec();
+ if (parser.isSet(writeQaPagesOption))
+ Generator::setWriteQaPages();
if (parser.isSet(logProgressOption))
Location::startLoggingProgress();
- const QStringList qdocFiles = parser.positionalArguments();
+ /*
+ The default indent for code is 4.
+ The default value for false is 0.
+ The default supported file extensions are cpp, h, qdoc and qml.
+ The default language is c++.
+ The default output format is html.
+ The default tab size is 8.
+ And those are all the default values for configuration variables.
+ */
+ if (defaults.isEmpty()) {
+ defaults.insert(CONFIG_CODEINDENT, QLatin1String("4"));
+ defaults.insert(CONFIG_FALSEHOODS, QLatin1String("0"));
+ defaults.insert(CONFIG_FILEEXTENSIONS, QLatin1String("*.cpp *.h *.qdoc *.qml"));
+ defaults.insert(CONFIG_LANGUAGE, QLatin1String("Cpp"));
+ defaults.insert(CONFIG_OUTPUTFORMATS, QLatin1String("HTML"));
+ defaults.insert(CONFIG_TABSIZE, QLatin1String("8"));
+ }
+
+ QStringList qdocFiles = parser.positionalArguments();
if (qdocFiles.isEmpty())
parser.showHelp();
+ if (singleExec)
+ qdocFiles = Config::loadMaster(qdocFiles.at(0));
+
/*
- Main loop.
+ Main loop is now modified to handle single exec mode.
*/
+ if (Generator::singleExec())
+ Generator::setQDocPass(Generator::Prepare);
foreach (const QString &qf, qdocFiles) {
- //qDebug() << "PROCESSING:" << qf;
+ dependModules.clear();
processQdocconfFile(qf);
}
+ if (Generator::singleExec()) {
+ Generator::setQDocPass(Generator::Generate);
+ QDocDatabase* qdb = QDocDatabase::qdocDB();
+ qdb->processForest();
+ foreach (const QString &qf, qdocFiles) {
+ dependModules.clear();
+ processQdocconfFile(qf);
+ }
+ }
+
+#ifndef QT_NO_TRANSLATION
+ if (!translators.isEmpty()) {
+ for (int i=0; i<translators.size(); ++i) {
+ delete translators.at(i).second;
+ }
+ }
+ translators.clear();
+#endif
+
+#ifdef DEBUG_SHUTDOWN_CRASH
+ qDebug() << "main(): Delete qdoc database";
+#endif
+ QDocDatabase::destroyQdocDB();
+#ifdef DEBUG_SHUTDOWN_CRASH
+ qDebug() << "main(): qdoc database deleted";
+#endif
return EXIT_SUCCESS;
}
-
diff --git a/src/tools/qdoc/node.cpp b/src/tools/qdoc/node.cpp
index ce655efef6..e14ca4af3e 100644
--- a/src/tools/qdoc/node.cpp
+++ b/src/tools/qdoc/node.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
@@ -149,7 +149,7 @@ QString Node::plainFullName(const Node* relative) const
*/
QString Node::fullName(const Node* relative) const
{
- if (isDocNode())
+ if (isDocumentNode())
return title();
else if (isClass()) {
const ClassNode* cn = static_cast<const ClassNode*>(this);
@@ -206,11 +206,11 @@ void Node::setDoc(const Doc& doc, bool replace)
parent's child list.
*/
Node::Node(Type type, InnerNode *parent, const QString& name)
- : nodeType_(type),
- access_(Public),
- safeness_(UnspecifiedSafeness),
- pageType_(NoPageType),
- status_(Commendable),
+ : nodeType_((unsigned char) type),
+ access_((unsigned char) Public),
+ safeness_((unsigned char) UnspecifiedSafeness),
+ pageType_((unsigned char) NoPageType),
+ status_((unsigned char) Commendable),
indexNodeFlag_(false),
parent_(parent),
relatesTo_(0),
@@ -218,7 +218,7 @@ Node::Node(Type type, InnerNode *parent, const QString& name)
{
if (parent_)
parent_->addChild(this);
- outSubDir_ = CodeParser::currentOutputSubdirectory();
+ outSubDir_ = Generator::outputSubdir();
if (operators_.isEmpty()) {
operators_.insert("++","inc");
operators_.insert("--","dec");
@@ -279,14 +279,14 @@ Node::Node(Type type, InnerNode *parent, const QString& name)
*/
QString Node::pageTypeString() const
{
- return pageTypeString(pageType_);
+ return pageTypeString((PageType) pageType_);
}
/*!
Returns the page type \a t as a string, for use as an
attribute value in XML or HTML.
*/
-QString Node::pageTypeString(unsigned t)
+QString Node::pageTypeString(unsigned char t)
{
switch ((PageType)t) {
case Node::ApiPage:
@@ -323,7 +323,7 @@ QString Node::nodeTypeString() const
Returns the node type \a t as a string for use as an
attribute value in XML or HTML.
*/
-QString Node::nodeTypeString(unsigned t)
+QString Node::nodeTypeString(unsigned char t)
{
switch ((Type)t) {
case Namespace:
@@ -383,7 +383,7 @@ QString Node::nodeSubtypeString() const
attribute value in XML or HTML. This is only useful
in the case where the node type is Document.
*/
-QString Node::nodeSubtypeString(unsigned t)
+QString Node::nodeSubtypeString(unsigned char t)
{
switch ((SubType)t) {
case Example:
@@ -413,21 +413,21 @@ QString Node::nodeSubtypeString(unsigned t)
void Node::setPageType(const QString& t)
{
if ((t == "API") || (t == "api"))
- pageType_ = ApiPage;
+ pageType_ = (unsigned char) ApiPage;
else if (t == "howto")
- pageType_ = HowToPage;
+ pageType_ = (unsigned char) HowToPage;
else if (t == "overview")
- pageType_ = OverviewPage;
+ pageType_ = (unsigned char) OverviewPage;
else if (t == "tutorial")
- pageType_ = TutorialPage;
+ pageType_ = (unsigned char) TutorialPage;
else if (t == "faq")
- pageType_ = FAQPage;
+ pageType_ = (unsigned char) FAQPage;
else if (t == "article")
- pageType_ = ArticlePage;
+ pageType_ = (unsigned char) ArticlePage;
else if (t == "example")
- pageType_ = ExamplePage;
+ pageType_ = (unsigned char) ExamplePage;
else if (t == "ditamap")
- pageType_ = DitaMapPage;
+ pageType_ = (unsigned char) DitaMapPage;
}
/*! Converts the boolean value \a b to an enum representation
@@ -502,7 +502,7 @@ void Node::setSince(const QString &since)
*/
QString Node::accessString() const
{
- switch (access_) {
+ switch ((Access) access_) {
case Protected:
return "protected";
case Private:
@@ -578,9 +578,9 @@ Node::Status Node::inheritedStatus() const
*/
Node::ThreadSafeness Node::threadSafeness() const
{
- if (parent_ && safeness_ == parent_->inheritedThreadSafeness())
+ if (parent_ && (ThreadSafeness) safeness_ == parent_->inheritedThreadSafeness())
return UnspecifiedSafeness;
- return safeness_;
+ return (ThreadSafeness) safeness_;
}
/*!
@@ -590,9 +590,9 @@ Node::ThreadSafeness Node::threadSafeness() const
*/
Node::ThreadSafeness Node::inheritedThreadSafeness() const
{
- if (parent_ && safeness_ == UnspecifiedSafeness)
+ if (parent_ && (ThreadSafeness) safeness_ == UnspecifiedSafeness)
return parent_->inheritedThreadSafeness();
- return safeness_;
+ return (ThreadSafeness) safeness_;
}
#if 0
@@ -624,18 +624,19 @@ QString Node::guid() const
}
/*!
- If this node is a QML class node, return a pointer to it.
- If it is a child of a QML class node, return a pointer to
- the QML class node. Otherwise, return 0;
+ If this node is a QML or JS type node, return a pointer to
+ it. If it is a child of a QML or JS type node, return the
+ pointer to its parent QMLor JS type node. Otherwise return
+ 0;
*/
-QmlClassNode* Node::qmlClassNode()
+QmlTypeNode* Node::qmlTypeNode()
{
- if (isQmlNode()) {
+ if (isQmlNode() || isJsNode()) {
Node* n = this;
- while (n && !n->isQmlType())
+ while (n && !(n->isQmlType() || n->isJsType()))
n = n->parent();
- if (n && n->isQmlType())
- return static_cast<QmlClassNode*>(n);
+ if (n && (n->isQmlType() || n->isJsType()))
+ return static_cast<QmlTypeNode*>(n);
}
return 0;
}
@@ -649,7 +650,7 @@ QmlClassNode* Node::qmlClassNode()
*/
ClassNode* Node::declarativeCppNode()
{
- QmlClassNode* qcn = qmlClassNode();
+ QmlTypeNode* qcn = qmlTypeNode();
if (qcn)
return qcn->classNode();
return 0;
@@ -716,10 +717,10 @@ Node *InnerNode::findChildNode(const QString& name, Node::Genus genus) const
Node *node = childMap.value(name);
if (node && !node->isQmlPropertyGroup()) // mws asks: Why not property group?
return node;
- if (isQmlType()) {
+ if (isQmlType() || isJsType()) {
for (int i=0; i<children_.size(); ++i) {
Node* n = children_.at(i);
- if (n->isQmlPropertyGroup()) {
+ if (n->isQmlPropertyGroup() || isJsPropertyGroup()) {
node = static_cast<InnerNode*>(n)->findChildNode(name, genus);
if (node)
return node;
@@ -732,7 +733,7 @@ Node *InnerNode::findChildNode(const QString& name, Node::Genus genus) const
if (!nodes.isEmpty()) {
for (int i=0; i<nodes.size(); ++i) {
Node* node = nodes.at(i);
- if (genus == node->genus() || genus == Node::DontCare)
+ if (genus == node->genus())
return node;
}
}
@@ -754,7 +755,7 @@ void InnerNode::findChildren(const QString& name, NodeList& nodes) const
if (!t.isEmpty())
nodes.append(t);
}
- if (!nodes.isEmpty() || !isQmlNode())
+ if (!nodes.isEmpty() || !(isQmlNode() || isJsNode()))
return;
int i = name.indexOf(QChar('.'));
if (i < 0)
@@ -764,7 +765,7 @@ void InnerNode::findChildren(const QString& name, NodeList& nodes) const
if (t.isEmpty())
return;
foreach (Node* n, t) {
- if (n->isQmlPropertyGroup()) {
+ if (n->isQmlPropertyGroup() || n->isJsPropertyGroup()) {
n->findChildren(name, nodes);
if (!nodes.isEmpty())
break;
@@ -772,45 +773,6 @@ void InnerNode::findChildren(const QString& name, NodeList& nodes) const
}
}
-#if 0
-/*!
- Find the node in this node's children that has the given \a name. If
- this node is a QML class node, be sure to also look in the children
- of its property group nodes. Return the matching node or 0. This is
- not a recearsive search.
-
- If \a qml is true, only match a node for which node->isQmlNode()
- returns \c true. If \a qml is false, only match a node for which
- node->isQmlNode() returns \c false.
- */
-Node* InnerNode::findChildNode(const QString& name, bool qml) const
-{
- NodeList nodes = childMap.values(name);
- if (!nodes.isEmpty()) {
- for (int i=0; i<nodes.size(); ++i) {
- Node* node = nodes.at(i);
- if (!qml) {
- if (!node->isQmlNode())
- return node;
- }
- else if (node->isQmlNode())
- return node;
- }
- }
- if (qml && isQmlType()) {
- for (int i=0; i<children_.size(); ++i) {
- Node* node = children_.at(i);
- if (node->isQmlPropertyGroup()) {
- node = static_cast<InnerNode*>(node)->findChildNode(name);
- if (node)
- return node;
- }
- }
- }
- return primaryFunctionMap.value(name);
-}
-#endif
-
/*!
This function is like findChildNode(), but if a node
with the specified \a name is found but it is not of the
@@ -831,63 +793,6 @@ Node* InnerNode::findChildNode(const QString& name, Type type)
return 0;
}
-#if 0
-/*!
- */
-void InnerNode::findNodes(const QString& name, NodeList& n)
-{
- n.clear();
- Node* node = 0;
- NodeList nodes = childMap.values(name);
- /*
- <sigh> If this node's child map contains no nodes named
- name, then if this node is a QML class, search each of its
- property group nodes for a node named name. If a match is
- found, append it to the output list and return immediately.
- */
- if (nodes.isEmpty()) {
- if (isQmlType()) {
- for (int i=0; i<children_.size(); ++i) {
- node = children_.at(i);
- if (node->isQmlPropertyGroup()) {
- node = static_cast<InnerNode*>(node)->findChildNode(name);
- if (node) {
- n.append(node);
- return;
- }
- }
- }
- }
- }
- else {
- /*
- If the childMap does contain one or more nodes named
- name, traverse the list of matching nodes. Append each
- matching node that is not a property group node to the
- output list. Search each property group node for a node
- named name and append that node to the output list.
- This is overkill, I think, but should produce a useful
- list.
- */
- for (int i=0; i<nodes.size(); ++i) {
- node = nodes.at(i);
- if (!node->isQmlPropertyGroup())
- n.append(node);
- else {
- node = static_cast<InnerNode*>(node)->findChildNode(name);
- if (node)
- n.append(node);
- }
- }
- }
- if (!n.isEmpty())
- return;
- node = primaryFunctionMap.value(name);
- if (node)
- n.append(node);
-}
-#endif
-
/*!
Find a function node that is a child of this nose, such
that the function node has the specified \a name.
@@ -1292,10 +1197,10 @@ void InnerNode::removeChild(Node *child)
been defined in the header file with a QT_MODULE macro or with an
\inmodule command in the documentation.
*/
-QString Node::moduleName() const
+QString Node::physicalModuleName() const
{
- if (!moduleName_.isEmpty())
- return moduleName_;
+ if (!physicalModuleName_.isEmpty())
+ return physicalModuleName_;
QString path = location().filePath();
QString pattern = QString("src") + QDir::separator();
@@ -1310,27 +1215,27 @@ QString Node::moduleName() const
if (finish == -1)
return QString();
- QString moduleName = moduleDir.left(finish);
+ QString physicalModuleName = moduleDir.left(finish);
- if (moduleName == "corelib")
+ if (physicalModuleName == "corelib")
return "QtCore";
- else if (moduleName == "uitools")
+ else if (physicalModuleName == "uitools")
return "QtUiTools";
- else if (moduleName == "gui")
+ else if (physicalModuleName == "gui")
return "QtGui";
- else if (moduleName == "network")
+ else if (physicalModuleName == "network")
return "QtNetwork";
- else if (moduleName == "opengl")
+ else if (physicalModuleName == "opengl")
return "QtOpenGL";
- else if (moduleName == "svg")
+ else if (physicalModuleName == "svg")
return "QtSvg";
- else if (moduleName == "sql")
+ else if (physicalModuleName == "sql")
return "QtSql";
- else if (moduleName == "qtestlib")
+ else if (physicalModuleName == "qtestlib")
return "QtTest";
else if (moduleDir.contains("webkit"))
return "QtWebKit";
- else if (moduleName == "xml")
+ else if (physicalModuleName == "xml")
return "QtXml";
else
return QString();
@@ -1454,6 +1359,7 @@ LeafNode::LeafNode(InnerNode* parent, Type type, const QString& name)
NamespaceNode::NamespaceNode(InnerNode *parent, const QString& name)
: InnerNode(Namespace, parent, name), tree_(0)
{
+ setGenus(Node::CPP);
setPageType(ApiPage);
}
@@ -1471,6 +1377,7 @@ ClassNode::ClassNode(InnerNode *parent, const QString& name)
abstract_ = false;
wrapper_ = false;
qmlelement = 0;
+ setGenus(Node::CPP);
setPageType(ApiPage);
}
@@ -1508,6 +1415,17 @@ void ClassNode::addUnresolvedBaseClass(Access access,
}
/*!
+ Add an unresolved \c using clause to this class node's list
+ of \c using clauses. The unresolved \c using clause will be
+ resolved before the generate phase of qdoc. In an unresolved
+ \c using clause, the pointer to the function node is 0.
+ */
+void ClassNode::addUnresolvedUsingClause(const QString& signature)
+{
+ usingClauses_.append(UsingClause(signature));
+}
+
+/*!
*/
void ClassNode::fixBaseClasses()
{
@@ -1614,9 +1532,9 @@ PropertyNode* ClassNode::findPropertyNode(const QString& name)
finds one, it returns the pointer to that QML element. If
it doesn't find one, it returns null.
*/
-QmlClassNode* ClassNode::findQmlBaseNode()
+QmlTypeNode* ClassNode::findQmlBaseNode()
{
- QmlClassNode* result = 0;
+ QmlTypeNode* result = 0;
const QList<RelatedClass>& bases = baseClasses();
if (!bases.isEmpty()) {
@@ -1640,17 +1558,18 @@ QmlClassNode* ClassNode::findQmlBaseNode()
}
/*!
- \class DocNode
+ \class DocumentNode
*/
/*!
- The type of a DocNode is Document, and it has a \a subtype,
- which specifies the type of DocNode. The page type for
+ The type of a DocumentNode is Document, and it has a \a subtype,
+ which specifies the type of DocumentNode. The page type for
the page index is set here.
*/
-DocNode::DocNode(InnerNode* parent, const QString& name, SubType subtype, Node::PageType ptype)
+DocumentNode::DocumentNode(InnerNode* parent, const QString& name, SubType subtype, Node::PageType ptype)
: InnerNode(Document, parent, name), nodeSubtype_(subtype)
{
+ setGenus(Node::DOC);
switch (subtype) {
case Page:
setPageType(ptype);
@@ -1666,14 +1585,14 @@ DocNode::DocNode(InnerNode* parent, const QString& name, SubType subtype, Node::
}
}
-/*! \fn QString DocNode::title() const
+/*! \fn QString DocumentNode::title() const
Returns the document node's title. This is used for the page title.
*/
/*!
Sets the document node's \a title. This is used for the page title.
*/
-void DocNode::setTitle(const QString &title)
+void DocumentNode::setTitle(const QString &title)
{
title_ = title;
parent()->addChild(this, title);
@@ -1684,7 +1603,7 @@ void DocNode::setTitle(const QString &title)
just title(), but for some SubType values is different
from title()
*/
-QString DocNode::fullTitle() const
+QString DocumentNode::fullTitle() const
{
if (nodeSubtype_ == File) {
if (title().isEmpty())
@@ -1712,7 +1631,7 @@ QString DocNode::fullTitle() const
/*!
Returns the subtitle.
*/
-QString DocNode::subTitle() const
+QString DocumentNode::subTitle() const
{
if (!subtitle_.isEmpty())
return subtitle_;
@@ -1735,7 +1654,7 @@ QString DocNode::subTitle() const
EnumNode::EnumNode(InnerNode *parent, const QString& name)
: LeafNode(Enum, parent, name), ft(0)
{
- // nothing.
+ setGenus(Node::CPP);
}
/*!
@@ -1780,6 +1699,7 @@ QString EnumNode::itemValue(const QString &name) const
TypedefNode::TypedefNode(InnerNode *parent, const QString& name)
: LeafNode(Typedef, parent, name), ae(0)
{
+ setGenus(Node::CPP);
}
/*!
@@ -1869,7 +1789,7 @@ FunctionNode::FunctionNode(InnerNode *parent, const QString& name)
rf(0),
ap(0)
{
- // nothing.
+ setGenus(Node::CPP);
}
/*!
@@ -1889,10 +1809,13 @@ FunctionNode::FunctionNode(Type type, InnerNode *parent, const QString& name, bo
rf(0),
ap(0)
{
+ setGenus(Node::QML);
if (type == QmlMethod || type == QmlSignal) {
if (name.startsWith("__"))
setStatus(Internal);
}
+ else if (type == Function)
+ setGenus(Node::CPP);
}
/*!
@@ -2079,7 +2002,7 @@ PropertyNode::PropertyNode(InnerNode *parent, const QString& name)
rev(-1),
overrides(0)
{
- // nothing.
+ setGenus(Node::CPP);
}
/*!
@@ -2133,20 +2056,20 @@ QString PropertyNode::qualifiedDataType() const
}
}
-bool QmlClassNode::qmlOnly = false;
-QMultiMap<QString,Node*> QmlClassNode::inheritedBy;
+bool QmlTypeNode::qmlOnly = false;
+QMultiMap<QString,Node*> QmlTypeNode::inheritedBy;
/*!
Constructs a Qml class node. The new node has the given
\a parent and \a name.
*/
-QmlClassNode::QmlClassNode(InnerNode *parent, const QString& name)
+QmlTypeNode::QmlTypeNode(InnerNode *parent, const QString& name)
: InnerNode(QmlType, parent, name),
abstract_(false),
cnodeRequired_(false),
wrapper_(false),
cnode_(0),
- qmlModule_(0),
+ logicalModule_(0),
qmlBaseNode_(0)
{
int i = 0;
@@ -2156,12 +2079,13 @@ QmlClassNode::QmlClassNode(InnerNode *parent, const QString& name)
}
setTitle(name.mid(i));
setPageType(Node::ApiPage);
+ setGenus(Node::QML);
}
/*!
Needed for printing a debug messages.
*/
-QmlClassNode::~QmlClassNode()
+QmlTypeNode::~QmlTypeNode()
{
// nothing.
}
@@ -2170,7 +2094,7 @@ QmlClassNode::~QmlClassNode()
Clear the static maps so that subsequent runs don't try to use
contents from a previous run.
*/
-void QmlClassNode::terminate()
+void QmlTypeNode::terminate()
{
inheritedBy.clear();
}
@@ -2179,7 +2103,7 @@ void QmlClassNode::terminate()
Record the fact that QML class \a base is inherited by
QML class \a sub.
*/
-void QmlClassNode::addInheritedBy(const QString& base, Node* sub)
+void QmlTypeNode::addInheritedBy(const QString& base, Node* sub)
{
if (inheritedBy.constFind(base,sub) == inheritedBy.constEnd()) {
inheritedBy.insert(base,sub);
@@ -2189,7 +2113,7 @@ void QmlClassNode::addInheritedBy(const QString& base, Node* sub)
/*!
Loads the list \a subs with the nodes of all the subclasses of \a base.
*/
-void QmlClassNode::subclasses(const QString& base, NodeList& subs)
+void QmlTypeNode::subclasses(const QString& base, NodeList& subs)
{
subs.clear();
if (inheritedBy.count(base) > 0) {
@@ -2197,30 +2121,7 @@ void QmlClassNode::subclasses(const QString& base, NodeList& subs)
}
}
-/*!
- This function splits \a arg on the blank character to get a
- QML module name and version number. If the version number is
- present, it spilts the version number on the '.' character to
- get a major version number and a minor vrsion number. If the
- version number is present, both the major and minor version
- numbers should be there, but the minor version number is not
- absolutely necessary.
- */
-void QmlModuleNode::setQmlModuleInfo(const QString& arg)
-{
- QStringList blankSplit = arg.split(QLatin1Char(' '));
- qmlModuleName_ = blankSplit[0];
- if (blankSplit.size() > 1) {
- QStringList dotSplit = blankSplit[1].split(QLatin1Char('.'));
- qmlModuleVersionMajor_ = dotSplit[0];
- if (dotSplit.size() > 1)
- qmlModuleVersionMinor_ = dotSplit[1];
- else
- qmlModuleVersionMinor_ = "0";
- }
-}
-
-QmlClassNode* QmlClassNode::qmlBaseNode()
+QmlTypeNode* QmlTypeNode::qmlBaseNode()
{
if (!qmlBaseNode_ && !qmlBaseName_.isEmpty()) {
qmlBaseNode_ = QDocDatabase::qdocDB()->findQmlType(qmlBaseName_);
@@ -2233,11 +2134,11 @@ QmlClassNode* QmlClassNode::qmlBaseNode()
return the fully qualified name of that QML
type, i.e. <QML-module-name>::<QML-type-name>.
*/
-QString QmlClassNode::qmlFullBaseName() const
+QString QmlTypeNode::qmlFullBaseName() const
{
QString result;
if (qmlBaseNode_) {
- result = qmlBaseNode_->qmlModuleName() + "::" + qmlBaseNode_->name();
+ result = qmlBaseNode_->logicalModuleName() + "::" + qmlBaseNode_->name();
}
return result;
}
@@ -2247,9 +2148,9 @@ QString QmlClassNode::qmlFullBaseName() const
module name from the QML module node. Otherwise, return the
empty string.
*/
-QString QmlClassNode::qmlModuleName() const
+QString QmlTypeNode::logicalModuleName() const
{
- return (qmlModule_ ? qmlModule_->qmlModuleName() : QString());
+ return (logicalModule_ ? logicalModule_->logicalModuleName() : QString());
}
/*!
@@ -2257,9 +2158,9 @@ QString QmlClassNode::qmlModuleName() const
module version from the QML module node. Otherwise, return
the empty string.
*/
-QString QmlClassNode::qmlModuleVersion() const
+QString QmlTypeNode::logicalModuleVersion() const
{
- return (qmlModule_ ? qmlModule_->qmlModuleVersion() : QString());
+ return (logicalModule_ ? logicalModule_->logicalModuleVersion() : QString());
}
/*!
@@ -2267,9 +2168,9 @@ QString QmlClassNode::qmlModuleVersion() const
module identifier from the QML module node. Otherwise, return
the empty string.
*/
-QString QmlClassNode::qmlModuleIdentifier() const
+QString QmlTypeNode::logicalModuleIdentifier() const
{
- return (qmlModule_ ? qmlModule_->qmlModuleIdentifier() : QString());
+ return (logicalModule_ ? logicalModule_->logicalModuleIdentifier() : QString());
}
/*!
@@ -2281,16 +2182,18 @@ QmlBasicTypeNode::QmlBasicTypeNode(InnerNode *parent,
: InnerNode(QmlBasicType, parent, name)
{
setTitle(name);
+ setGenus(Node::QML);
}
/*!
Constructor for the Qml property group node. \a parent is
- always a QmlClassNode.
+ always a QmlTypeNode.
*/
-QmlPropertyGroupNode::QmlPropertyGroupNode(QmlClassNode* parent, const QString& name)
+QmlPropertyGroupNode::QmlPropertyGroupNode(QmlTypeNode* parent, const QString& name)
: InnerNode(QmlPropertyGroup, parent, name)
{
idNumber_ = -1;
+ setGenus(Node::QML);
}
/*!
@@ -2328,6 +2231,7 @@ QmlPropertyNode::QmlPropertyNode(InnerNode* parent,
isAlias_ = true;
if (name.startsWith("__"))
setStatus(Internal);
+ setGenus(Node::QML);
}
/*!
@@ -2347,7 +2251,7 @@ bool QmlPropertyNode::isWritable()
if (readOnly_ != FlagValueDefault)
return !fromFlagValue(readOnly_, false);
- QmlClassNode* qcn = qmlClassNode();
+ QmlTypeNode* qcn = qmlTypeNode();
if (qcn) {
if (qcn->cppClassRequired()) {
if (qcn->classNode()) {
@@ -2358,13 +2262,13 @@ bool QmlPropertyNode::isWritable()
location().warning(tr("No Q_PROPERTY for QML property %1::%2::%3 "
"in C++ class documented as QML type: "
"(property not found in the C++ class or its base classes)")
- .arg(qmlModuleName()).arg(qmlTypeName()).arg(name()));
+ .arg(logicalModuleName()).arg(qmlTypeName()).arg(name()));
}
else
location().warning(tr("No Q_PROPERTY for QML property %1::%2::%3 "
"in C++ class documented as QML type: "
"(C++ class not specified or not found).")
- .arg(qmlModuleName()).arg(qmlTypeName()).arg(name()));
+ .arg(logicalModuleName()).arg(qmlTypeName()).arg(name()));
}
}
return true;
@@ -2378,10 +2282,10 @@ PropertyNode* QmlPropertyNode::findCorrespondingCppProperty()
{
PropertyNode* pn;
Node* n = parent();
- while (n && !n->isQmlType())
+ while (n && !(n->isQmlType() || n->isJsType()))
n = n->parent();
if (n) {
- QmlClassNode* qcn = static_cast<QmlClassNode*>(n);
+ QmlTypeNode* qcn = static_cast<QmlTypeNode*>(n);
ClassNode* cn = qcn->classNode();
if (cn) {
/*
@@ -2443,12 +2347,12 @@ QString Node::fullDocumentName() const
if (!n->name().isEmpty() && !n->isQmlPropertyGroup())
pieces.insert(0, n->name());
- if (n->isQmlType() && !n->qmlModuleName().isEmpty()) {
- pieces.insert(0, n->qmlModuleName());
+ if ((n->isQmlType() || n->isJsType()) && !n->logicalModuleName().isEmpty()) {
+ pieces.insert(0, n->logicalModuleName());
break;
}
- if (n->isDocNode())
+ if (n->isDocumentNode())
break;
// Examine the parent node if one exists.
@@ -2460,10 +2364,10 @@ QString Node::fullDocumentName() const
// Create a name based on the type of the ancestor node.
QString concatenator = "::";
- if (n->isQmlType())
+ if (n->isQmlType() || n->isJsType())
concatenator = QLatin1Char('.');
- if (n->isDocNode())
+ if (n->isDocumentNode())
concatenator = QLatin1Char('#');
return pieces.join(concatenator);
@@ -2474,7 +2378,7 @@ QString Node::fullDocumentName() const
be used as the value of an \e id attribute. Search for NCName
on the internet for details of what can be an NCName.
*/
-QString Node::cleanId(QString str)
+QString Node::cleanId(const QString &str)
{
QString clean;
QString name = str.simplified();
@@ -2644,6 +2548,8 @@ QString Node::idForNode() const
str = "namespace-member-" + func->name();
else if (parent_->isQmlType())
str = "qml-method-" + parent_->name().toLower() + "-" + func->name();
+ else if (parent_->isJsType())
+ str = "js-method-" + parent_->name().toLower() + "-" + func->name();
else if (parent_->type() == Document) {
qDebug() << "qdoc internal error: Node subtype not handled:"
<< parent_->subType() << func->name();
@@ -2658,10 +2564,16 @@ QString Node::idForNode() const
}
break;
case Node::QmlType:
- str = "qml-class-" + name();
+ if (genus() == QML)
+ str = "qml-class-" + name();
+ else
+ str = "js-type-" + name();
break;
case Node::QmlBasicType:
- str = "qml-basic-type-" + name();
+ if (genus() == QML)
+ str = "qml-basic-type-" + name();
+ else
+ str = "js-basic-type-" + name();
break;
case Node::Document:
{
@@ -2702,32 +2614,52 @@ QString Node::idForNode() const
str.replace(QLatin1Char('/'), QLatin1Char('-'));
break;
case Node::QmlModule:
- str = "qml-module-" + name();
+ if (genus() == QML)
+ str = "qml-module-" + name();
+ else
+ str = "js-module-" + name();
break;
case Node::QmlProperty:
+ if (genus() == QML)
+ str = "qml-";
+ else
+ str = "js-";
if (isAttached())
- str = "qml-attached-property-" + name();
+ str += "attached-property-" + name();
else
- str = "qml-property-" + name();
+ str += "property-" + name();
break;
case Node::QmlPropertyGroup:
{
Node* n = const_cast<Node*>(this);
- str = "qml-propertygroup-" + n->name();
+ if (genus() == QML)
+ str = "qml-propertygroup-" + n->name();
+ else
+ str = "js-propertygroup-" + n->name();
}
break;
case Node::Property:
str = "property-" + name();
break;
case Node::QmlSignal:
- str = "qml-signal-" + name();
+ if (genus() == QML)
+ str = "qml-signal-" + name();
+ else
+ str = "js-signal-" + name();
break;
case Node::QmlSignalHandler:
- str = "qml-signal-handler-" + name();
+ if (genus() == QML)
+ str = "qml-signal-handler-" + name();
+ else
+ str = "js-signal-handler-" + name();
break;
case Node::QmlMethod:
func = static_cast<const FunctionNode*>(this);
- str = "qml-method-" + parent_->name().toLower() + "-" + func->name();
+ if (genus() == QML)
+ str = "qml-method-";
+ else
+ str = "js-method-";
+ str += parent_->name().toLower() + "-" + func->name();
if (func->overloadNumber() != 1)
str += QLatin1Char('-') + QString::number(func->overloadNumber());
break;
@@ -2873,4 +2805,48 @@ void CollectionNode::setTitle(const QString& title)
parent()->addChild(this, title);
}
+/*!
+ This function splits \a arg on the blank character to get a
+ logical module name and version number. If the version number
+ is present, it spilts the version number on the '.' character
+ to get a major version number and a minor vrsion number. If
+ the version number is present, both the major and minor version
+ numbers should be there, but the minor version number is not
+ absolutely necessary.
+ */
+void CollectionNode::setLogicalModuleInfo(const QString& arg)
+{
+ QStringList blankSplit = arg.split(QLatin1Char(' '));
+ logicalModuleName_ = blankSplit[0];
+ if (blankSplit.size() > 1) {
+ QStringList dotSplit = blankSplit[1].split(QLatin1Char('.'));
+ logicalModuleVersionMajor_ = dotSplit[0];
+ if (dotSplit.size() > 1)
+ logicalModuleVersionMinor_ = dotSplit[1];
+ else
+ logicalModuleVersionMinor_ = "0";
+ }
+}
+
+/*!
+ This function accepts the logical module \a info as a string
+ list. If the logical module info contains the version number,
+ it spilts the version number on the '.' character to get the
+ major and minor vrsion numbers. Both major and minor version
+ numbers should be provided, but the minor version number is
+ not strictly necessary.
+ */
+void CollectionNode::setLogicalModuleInfo(const QStringList& info)
+{
+ logicalModuleName_ = info[0];
+ if (info.size() > 1) {
+ QStringList dotSplit = info[1].split(QLatin1Char('.'));
+ logicalModuleVersionMajor_ = dotSplit[0];
+ if (dotSplit.size() > 1)
+ logicalModuleVersionMinor_ = dotSplit[1];
+ else
+ logicalModuleVersionMinor_ = "0";
+ }
+}
+
QT_END_NAMESPACE
diff --git a/src/tools/qdoc/node.h b/src/tools/qdoc/node.h
index e25bbd7a4a..b6717b3b1b 100644
--- a/src/tools/qdoc/node.h
+++ b/src/tools/qdoc/node.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
@@ -51,11 +51,10 @@ class ClassNode;
class InnerNode;
class ExampleNode;
class TypedefNode;
-class QmlClassNode;
+class QmlTypeNode;
class QDocDatabase;
class FunctionNode;
class PropertyNode;
-class QmlModuleNode;
class CollectionNode;
class QmlPropertyNode;
@@ -107,7 +106,7 @@ public:
LastSubtype
};
- enum Genus { DontCare, CPP, QML };
+ enum Genus { DontCare, CPP, JS, QML, DOC };
enum Access { Public, Protected, Private };
@@ -170,36 +169,45 @@ public:
const QString& fileNameBase() const { return fileNameBase_; }
bool hasFileNameBase() const { return !fileNameBase_.isEmpty(); }
void setFileNameBase(const QString& t) { fileNameBase_ = t; }
+ Node::Genus genus() const { return (Genus) genus_; }
+ void setGenus(Genus t) { genus_ = (unsigned char) t; }
- void setAccess(Access access) { access_ = access; }
+ void setAccess(Access access) { access_ = (unsigned char) access; }
void setLocation(const Location& location) { loc_ = location; }
void setDoc(const Doc& doc, bool replace = false);
void setStatus(Status status) {
- if (status_ == Obsolete && status == Deprecated)
+ if (status_ == (unsigned char) Obsolete && status == Deprecated)
return;
- status_ = status;
+ status_ = (unsigned char) status;
}
- void setThreadSafeness(ThreadSafeness safeness) { safeness_ = safeness; }
+ void setThreadSafeness(ThreadSafeness safeness) { safeness_ = (unsigned char) safeness; }
void setSince(const QString &since);
void setRelates(InnerNode* pseudoParent);
- void setModuleName(const QString &name) { moduleName_ = name; }
+ void setPhysicalModuleName(const QString &name) { physicalModuleName_ = name; }
void setUrl(const QString& url) { url_ = url; }
void setTemplateStuff(const QString &templateStuff) { templateStuff_ = templateStuff; }
void setReconstitutedBrief(const QString &t) { reconstitutedBrief_ = t; }
- void setPageType(PageType t) { pageType_ = t; }
+ void setPageType(PageType t) { pageType_ = (unsigned char) t; }
void setPageType(const QString& t);
void setParent(InnerNode* n) { parent_ = n; }
void setIndexNodeFlag() { indexNodeFlag_ = true; }
virtual void setOutputFileName(const QString& ) { }
+ bool isQmlNode() const { return genus() == QML; }
+ bool isJsNode() const { return genus() == JS; }
+ bool isCppNode() const { return genus() == CPP; }
+
virtual bool isInnerNode() const = 0;
- virtual bool isDocNode() const { return false; }
virtual bool isCollectionNode() const { return false; }
+ virtual bool isDocumentNode() const { return false; }
virtual bool isGroup() const { return false; }
virtual bool isModule() const { return false; }
virtual bool isQmlModule() const { return false; }
+ virtual bool isJsModule() const { return false; }
virtual bool isQmlType() const { return false; }
+ virtual bool isJsType() const { return false; }
virtual bool isQmlBasicType() const { return false; }
+ virtual bool isJsBasicType() const { return false; }
virtual bool isExample() const { return false; }
virtual bool isExampleFile() const { return false; }
virtual bool isHeaderFile() const { return false; }
@@ -208,11 +216,19 @@ public:
virtual bool isFunction() const { return false; }
virtual bool isNamespace() const { return false; }
virtual bool isClass() const { return false; }
- virtual bool isQmlNode() const { return false; }
- virtual bool isCppNode() const { return false; }
virtual bool isQtQuickNode() const { return false; }
virtual bool isAbstract() const { return false; }
+ virtual bool isProperty() const { return false; }
+ virtual bool isQmlProperty() const { return false; }
+ virtual bool isJsProperty() const { return false; }
virtual bool isQmlPropertyGroup() const { return false; }
+ virtual bool isJsPropertyGroup() const { return false; }
+ virtual bool isQmlSignal() const { return false; }
+ virtual bool isJsSignal() const { return false; }
+ virtual bool isQmlSignalHandler() const { return false; }
+ virtual bool isJsSignalHandler() const { return false; }
+ virtual bool isQmlMethod() const { return false; }
+ virtual bool isJsMethod() const { return false; }
virtual bool isAttached() const { return false; }
virtual bool isAlias() const { return false; }
virtual bool isWrapper() const;
@@ -225,7 +241,6 @@ public:
virtual bool hasClasses() const { return false; }
virtual void setAbstract(bool ) { }
virtual void setWrapper() { }
- virtual Node::Genus genus() const { return DontCare; }
virtual QString title() const { return name(); }
virtual QString fullTitle() const { return name(); }
virtual QString subTitle() const { return QString(); }
@@ -245,14 +260,14 @@ public:
virtual Tree* tree() const;
virtual void findChildren(const QString& , NodeList& nodes) const { nodes.clear(); }
bool isIndexNode() const { return indexNodeFlag_; }
- Type type() const { return nodeType_; }
+ Type type() const { return (Type) nodeType_; }
virtual SubType subType() const { return NoSubType; }
bool match(const NodeTypeList& types) const;
InnerNode* parent() const { return parent_; }
const Node* root() const;
InnerNode* relates() const { return relatesTo_; }
const QString& name() const { return name_; }
- QString moduleName() const;
+ QString physicalModuleName() const;
QString url() const { return url_; }
virtual QString nameForLists() const { return name_; }
virtual QString outputFileName() const { return QString(); }
@@ -264,21 +279,21 @@ public:
const QMap<LinkType, QPair<QString,QString> >& links() const { return linkMap_; }
void setLink(LinkType linkType, const QString &link, const QString &desc);
- Access access() const { return access_; }
- bool isPrivate() const { return access_ == Private; }
+ Access access() const { return (Access) access_; }
+ bool isPrivate() const { return (Access) access_ == Private; }
QString accessString() const;
const Location& location() const { return loc_; }
const Doc& doc() const { return doc_; }
bool hasDoc() const { return !doc_.isEmpty(); }
- Status status() const { return status_; }
+ Status status() const { return (Status) status_; }
Status inheritedStatus() const;
- bool isObsolete() const { return (status_ == Obsolete); }
+ bool isObsolete() const { return (status_ == (unsigned char) Obsolete); }
ThreadSafeness threadSafeness() const;
ThreadSafeness inheritedThreadSafeness() const;
QString since() const { return since_; }
QString templateStuff() const { return templateStuff_; }
const QString& reconstitutedBrief() const { return reconstitutedBrief_; }
- PageType pageType() const { return pageType_; }
+ PageType pageType() const { return (PageType) pageType_; }
QString pageTypeString() const;
QString nodeTypeString() const;
QString nodeSubtypeString() const;
@@ -290,30 +305,31 @@ public:
QString extractClassName(const QString &string) const;
virtual QString qmlTypeName() const { return name_; }
virtual QString qmlFullBaseName() const { return QString(); }
- virtual QString qmlModuleName() const { return QString(); }
- virtual QString qmlModuleVersion() const { return QString(); }
- virtual QString qmlModuleIdentifier() const { return QString(); }
- virtual void setQmlModuleInfo(const QString& ) { }
- virtual QmlModuleNode* qmlModule() const { return 0; }
- virtual void setQmlModule(QmlModuleNode* ) { }
+ virtual QString logicalModuleName() const { return QString(); }
+ virtual QString logicalModuleVersion() const { return QString(); }
+ virtual QString logicalModuleIdentifier() const { return QString(); }
+ virtual void setLogicalModuleInfo(const QString& ) { }
+ virtual void setLogicalModuleInfo(const QStringList& ) { }
+ virtual CollectionNode* logicalModule() const { return 0; }
+ virtual void setQmlModule(CollectionNode* ) { }
virtual ClassNode* classNode() { return 0; }
virtual void setClassNode(ClassNode* ) { }
virtual const Node* applyModuleName(const Node* ) const { return 0; }
virtual QString idNumber() { return "0"; }
- QmlClassNode* qmlClassNode();
+ QmlTypeNode* qmlTypeNode();
ClassNode* declarativeCppNode();
const QString& outputSubdirectory() const { return outSubDir_; }
void setOutputSubdirectory(const QString& t) { outSubDir_ = t; }
QString fullDocumentName() const;
- static QString cleanId(QString str);
+ static QString cleanId(const QString &str);
QString idForNode() const;
static FlagValue toFlagValue(bool b);
static bool fromFlagValue(FlagValue fv, bool defaultValue);
- static QString pageTypeString(unsigned t);
- static QString nodeTypeString(unsigned t);
- static QString nodeSubtypeString(unsigned t);
+ static QString pageTypeString(unsigned char t);
+ static QString nodeTypeString(unsigned char t);
+ static QString nodeSubtypeString(unsigned char t);
static int incPropertyGroupCount();
static void clearPropertyGroupCount();
static void initialize();
@@ -324,11 +340,12 @@ protected:
private:
- Type nodeType_;
- Access access_;
- ThreadSafeness safeness_;
- PageType pageType_;
- Status status_;
+ unsigned char nodeType_;
+ unsigned char genus_;
+ unsigned char access_;
+ unsigned char safeness_;
+ unsigned char pageType_;
+ unsigned char status_;
bool indexNodeFlag_;
InnerNode* parent_;
@@ -338,7 +355,7 @@ private:
Doc doc_;
QMap<LinkType, QPair<QString, QString> > linkMap_;
QString fileNameBase_;
- QString moduleName_;
+ QString physicalModuleName_;
QString url_;
QString since_;
QString templateStuff_;
@@ -359,7 +376,7 @@ public:
//Node* findChildNode(const QString& name, bool qml) const;
Node* findChildNode(const QString& name, Type type);
//void findNodes(const QString& name, NodeList& n);
- virtual void findChildren(const QString& name, NodeList& nodes) const;
+ virtual void findChildren(const QString& name, NodeList& nodes) const Q_DECL_OVERRIDE;
FunctionNode* findFunctionNode(const QString& name) const;
FunctionNode* findFunctionNode(const FunctionNode* clone);
void addInclude(const QString &include);
@@ -370,8 +387,8 @@ public:
void deleteChildren();
void removeFromRelated();
- virtual bool isInnerNode() const { return true; }
- virtual bool isLeaf() const { return false; }
+ virtual bool isInnerNode() const Q_DECL_OVERRIDE { return true; }
+ virtual bool isLeaf() const Q_DECL_OVERRIDE { return false; }
const EnumNode* findEnumNodeForValue(const QString &enumValue) const;
const NodeList & childNodes() const { return children_; }
const NodeList & relatedNodes() const { return related_; }
@@ -384,14 +401,14 @@ public:
QStringList primaryKeys();
QStringList secondaryKeys();
const QStringList& pageKeywords() const { return pageKeywds; }
- virtual void addPageKeywords(const QString& t) { pageKeywds << t; }
- virtual void setOutputFileName(const QString& f) { outputFileName_ = f; }
- virtual QString outputFileName() const { return outputFileName_; }
- virtual QmlPropertyNode* hasQmlProperty(const QString& ) const;
- virtual QmlPropertyNode* hasQmlProperty(const QString&, bool attached) const;
+ virtual void addPageKeywords(const QString& t) Q_DECL_OVERRIDE { pageKeywds << t; }
+ virtual void setOutputFileName(const QString& f) Q_DECL_OVERRIDE { outputFileName_ = f; }
+ virtual QString outputFileName() const Q_DECL_OVERRIDE { return outputFileName_; }
+ virtual QmlPropertyNode* hasQmlProperty(const QString& ) const Q_DECL_OVERRIDE;
+ virtual QmlPropertyNode* hasQmlProperty(const QString&, bool attached) const Q_DECL_OVERRIDE;
void addChild(Node* child, const QString& title);
const QStringList& groupNames() const { return groupNames_; }
- virtual void appendGroupName(const QString& t) { groupNames_.append(t); }
+ virtual void appendGroupName(const QString& t) Q_DECL_OVERRIDE { groupNames_.append(t); }
void printChildren(const QString& title);
protected:
@@ -423,8 +440,8 @@ public:
LeafNode();
virtual ~LeafNode() { }
- virtual bool isInnerNode() const { return false; }
- virtual bool isLeaf() const { return true; }
+ virtual bool isInnerNode() const Q_DECL_OVERRIDE { return false; }
+ virtual bool isLeaf() const Q_DECL_OVERRIDE { return true; }
protected:
LeafNode(Type type, InnerNode* parent, const QString& name);
@@ -436,10 +453,8 @@ class NamespaceNode : public InnerNode
public:
NamespaceNode(InnerNode* parent, const QString& name);
virtual ~NamespaceNode() { }
- virtual bool isNamespace() const { return true; }
- virtual Tree* tree() const { return (parent() ? parent()->tree() : tree_); }
- virtual bool isCppNode() const { return true; }
- virtual Node::Genus genus() const { return Node::CPP; }
+ virtual bool isNamespace() const Q_DECL_OVERRIDE { return true; }
+ virtual Tree* tree() const Q_DECL_OVERRIDE { return (parent() ? parent()->tree() : tree_); }
void setTree(Tree* t) { tree_ = t; }
private:
@@ -464,78 +479,93 @@ struct RelatedClass
QString signature_;
};
+struct UsingClause
+{
+ UsingClause() { }
+ UsingClause(const QString& signature) : node_(0), signature_(signature) { }
+ const QString& signature() const { return signature_; }
+ const Node* node() { return node_; }
+ void setNode(const Node* n) { node_ = n; }
+
+ const Node* node_;
+ QString signature_;
+};
+
class ClassNode : public InnerNode
{
public:
ClassNode(InnerNode* parent, const QString& name);
virtual ~ClassNode() { }
- virtual bool isClass() const { return true; }
- virtual bool isCppNode() const { return true; }
- virtual bool isWrapper() const { return wrapper_; }
- virtual Node::Genus genus() const { return Node::CPP; }
- virtual QString obsoleteLink() const { return obsoleteLink_; }
- virtual void setObsoleteLink(const QString& t) { obsoleteLink_ = t; }
- virtual void setWrapper() { wrapper_ = true; }
+ virtual bool isClass() const Q_DECL_OVERRIDE { return true; }
+ virtual bool isWrapper() const Q_DECL_OVERRIDE { return wrapper_; }
+ virtual QString obsoleteLink() const Q_DECL_OVERRIDE { return obsoleteLink_; }
+ virtual void setObsoleteLink(const QString& t) Q_DECL_OVERRIDE { obsoleteLink_ = t; }
+ virtual void setWrapper() Q_DECL_OVERRIDE { wrapper_ = true; }
void addResolvedBaseClass(Access access, ClassNode* node);
void addDerivedClass(Access access, ClassNode* node);
void addUnresolvedBaseClass(Access access, const QStringList& path, const QString& signature);
+ void addUnresolvedUsingClause(const QString& signature);
void fixBaseClasses();
void fixPropertyUsingBaseClasses(PropertyNode* pn);
QList<RelatedClass>& baseClasses() { return bases_; }
QList<RelatedClass>& derivedClasses() { return derived_; }
QList<RelatedClass>& ignoredBaseClasses() { return ignoredBases_; }
+ QList<UsingClause>& usingClauses() { return usingClauses_; }
const QList<RelatedClass> &baseClasses() const { return bases_; }
const QList<RelatedClass> &derivedClasses() const { return derived_; }
const QList<RelatedClass> &ignoredBaseClasses() const { return ignoredBases_; }
+ const QList<UsingClause>& usingClauses() const { return usingClauses_; }
QString serviceName() const { return sname; }
void setServiceName(const QString& value) { sname = value; }
- QmlClassNode* qmlElement() { return qmlelement; }
- void setQmlElement(QmlClassNode* qcn) { qmlelement = qcn; }
- virtual bool isAbstract() const { return abstract_; }
- virtual void setAbstract(bool b) { abstract_ = b; }
+ QmlTypeNode* qmlElement() { return qmlelement; }
+ void setQmlElement(QmlTypeNode* qcn) { qmlelement = qcn; }
+ virtual bool isAbstract() const Q_DECL_OVERRIDE { return abstract_; }
+ virtual void setAbstract(bool b) Q_DECL_OVERRIDE { abstract_ = b; }
PropertyNode* findPropertyNode(const QString& name);
- QmlClassNode* findQmlBaseNode();
+ QmlTypeNode* findQmlBaseNode();
private:
QList<RelatedClass> bases_;
QList<RelatedClass> derived_;
QList<RelatedClass> ignoredBases_;
+ QList<UsingClause> usingClauses_;
bool abstract_;
bool wrapper_;
QString sname;
QString obsoleteLink_;
- QmlClassNode* qmlelement;
+ QmlTypeNode* qmlelement;
};
-class DocNode : public InnerNode
+class DocumentNode : public InnerNode
{
public:
- DocNode(InnerNode* parent,
+ DocumentNode(InnerNode* parent,
const QString& name,
SubType subType,
PageType ptype);
- virtual ~DocNode() { }
+ virtual ~DocumentNode() { }
- virtual void setTitle(const QString &title);
- virtual void setSubTitle(const QString &subTitle) { subtitle_ = subTitle; }
+ virtual bool isDocumentNode() const Q_DECL_OVERRIDE { return true; }
+ virtual void setTitle(const QString &title) Q_DECL_OVERRIDE;
+ virtual void setSubTitle(const QString &subTitle) Q_DECL_OVERRIDE { subtitle_ = subTitle; }
- SubType subType() const { return nodeSubtype_; }
- virtual QString title() const { return title_; }
- virtual QString fullTitle() const;
- virtual QString subTitle() const;
+ SubType subType() const Q_DECL_OVERRIDE { return nodeSubtype_; }
+ virtual QString title() const Q_DECL_OVERRIDE { return title_; }
+ virtual QString fullTitle() const Q_DECL_OVERRIDE;
+ virtual QString subTitle() const Q_DECL_OVERRIDE;
virtual QString imageFileName() const { return QString(); }
- virtual QString nameForLists() const { return title(); }
+ virtual QString nameForLists() const Q_DECL_OVERRIDE { return title(); }
virtual void setImageFileName(const QString& ) { }
- virtual bool isHeaderFile() const { return (subType() == Node::HeaderFile); }
- virtual bool isExample() const { return (subType() == Node::Example); }
- virtual bool isExampleFile() const { return (parent() && parent()->isExample()); }
- virtual bool isExternalPage() const { return nodeSubtype_ == ExternalPage; }
- virtual bool isDocNode() const { return true; }
+
+ virtual bool isHeaderFile() const Q_DECL_OVERRIDE { return (subType() == Node::HeaderFile); }
+ virtual bool isExample() const Q_DECL_OVERRIDE { return (subType() == Node::Example); }
+ virtual bool isExampleFile() const Q_DECL_OVERRIDE { return (parent() && parent()->isExample()); }
+ virtual bool isExternalPage() const Q_DECL_OVERRIDE { return nodeSubtype_ == ExternalPage; }
protected:
SubType nodeSubtype_;
@@ -543,14 +573,14 @@ protected:
QString subtitle_;
};
-class ExampleNode : public DocNode
+class ExampleNode : public DocumentNode
{
public:
ExampleNode(InnerNode* parent, const QString& name)
- : DocNode(parent, name, Node::Example, Node::ExamplePage) { }
+ : DocumentNode(parent, name, Node::Example, Node::ExamplePage) { }
virtual ~ExampleNode() { }
- virtual QString imageFileName() const { return imageFileName_; }
- virtual void setImageFileName(const QString& ifn) { imageFileName_ = ifn; }
+ virtual QString imageFileName() const Q_DECL_OVERRIDE { return imageFileName_; }
+ virtual void setImageFileName(const QString& ifn) Q_DECL_OVERRIDE { imageFileName_ = ifn; }
private:
QString imageFileName_;
@@ -576,37 +606,39 @@ struct ImportRec {
typedef QList<ImportRec> ImportList;
-class QmlClassNode : public InnerNode
+class QmlTypeNode : public InnerNode
{
public:
- QmlClassNode(InnerNode* parent, const QString& name);
- virtual ~QmlClassNode();
- virtual bool isQmlNode() const { return true; }
- virtual bool isQmlType() const { return true; }
- virtual bool isQtQuickNode() const { return (qmlModuleName() == QLatin1String("QtQuick")); }
- virtual ClassNode* classNode() { return cnode_; }
- virtual void setClassNode(ClassNode* cn) { cnode_ = cn; }
- virtual bool isAbstract() const { return abstract_; }
- virtual bool isWrapper() const { return wrapper_; }
- virtual void setAbstract(bool b) { abstract_ = b; }
- virtual void setWrapper() { wrapper_ = true; }
- virtual bool isInternal() const { return (status() == Internal); }
- virtual QString qmlFullBaseName() const;
- virtual QString obsoleteLink() const { return obsoleteLink_; }
- virtual void setObsoleteLink(const QString& t) { obsoleteLink_ = t; };
- virtual QString qmlModuleName() const;
- virtual QString qmlModuleVersion() const;
- virtual QString qmlModuleIdentifier() const;
- virtual QmlModuleNode* qmlModule() const { return qmlModule_; }
- virtual void setQmlModule(QmlModuleNode* t) { qmlModule_ = t; }
- virtual Node::Genus genus() const { return Node::QML; }
+ QmlTypeNode(InnerNode* parent, const QString& name);
+ virtual ~QmlTypeNode();
+ virtual bool isQmlType() const Q_DECL_OVERRIDE { return genus() == Node::QML; }
+ virtual bool isJsType() const Q_DECL_OVERRIDE { return genus() == Node::JS; }
+ virtual bool isQtQuickNode() const Q_DECL_OVERRIDE {
+ return (logicalModuleName() == QLatin1String("QtQuick"));
+ }
+ virtual ClassNode* classNode() Q_DECL_OVERRIDE { return cnode_; }
+ virtual void setClassNode(ClassNode* cn) Q_DECL_OVERRIDE { cnode_ = cn; }
+ virtual bool isAbstract() const Q_DECL_OVERRIDE { return abstract_; }
+ virtual bool isWrapper() const Q_DECL_OVERRIDE { return wrapper_; }
+ virtual void setAbstract(bool b) Q_DECL_OVERRIDE { abstract_ = b; }
+ virtual void setWrapper() Q_DECL_OVERRIDE { wrapper_ = true; }
+ virtual bool isInternal() const Q_DECL_OVERRIDE { return (status() == Internal); }
+ virtual QString qmlFullBaseName() const Q_DECL_OVERRIDE;
+ virtual QString obsoleteLink() const Q_DECL_OVERRIDE { return obsoleteLink_; }
+ virtual void setObsoleteLink(const QString& t) Q_DECL_OVERRIDE { obsoleteLink_ = t; };
+ virtual QString logicalModuleName() const Q_DECL_OVERRIDE;
+ virtual QString logicalModuleVersion() const Q_DECL_OVERRIDE;
+ virtual QString logicalModuleIdentifier() const Q_DECL_OVERRIDE;
+ virtual CollectionNode* logicalModule() const Q_DECL_OVERRIDE { return logicalModule_; }
+ virtual void setQmlModule(CollectionNode* t) Q_DECL_OVERRIDE { logicalModule_ = t; }
+
const ImportList& importList() const { return importList_; }
void setImportList(const ImportList& il) { importList_ = il; }
const QString& qmlBaseName() const { return qmlBaseName_; }
void setQmlBaseName(const QString& name) { qmlBaseName_ = name; }
bool qmlBaseNodeNotSet() const { return (qmlBaseNode_ == 0); }
- QmlClassNode* qmlBaseNode();
- void setQmlBaseNode(QmlClassNode* b) { qmlBaseNode_ = b; }
+ QmlTypeNode* qmlBaseNode();
+ void setQmlBaseNode(QmlTypeNode* b) { qmlBaseNode_ = b; }
void requireCppClass() { cnodeRequired_ = true; }
bool cppClassRequired() const { return cnodeRequired_; }
static void addInheritedBy(const QString& base, Node* sub);
@@ -624,8 +656,8 @@ private:
ClassNode* cnode_;
QString qmlBaseName_;
QString obsoleteLink_;
- QmlModuleNode* qmlModule_;
- QmlClassNode* qmlBaseNode_;
+ CollectionNode* logicalModule_;
+ QmlTypeNode* qmlBaseNode_;
ImportList importList_;
};
@@ -635,27 +667,30 @@ public:
QmlBasicTypeNode(InnerNode* parent,
const QString& name);
virtual ~QmlBasicTypeNode() { }
- virtual bool isQmlNode() const { return true; }
- virtual bool isQmlBasicType() const { return true; }
- virtual Node::Genus genus() const { return Node::QML; }
+ virtual bool isQmlBasicType() const Q_DECL_OVERRIDE { return (genus() == Node::QML); }
+ virtual bool isJsBasicType() const Q_DECL_OVERRIDE { return (genus() == Node::JS); }
};
class QmlPropertyGroupNode : public InnerNode
{
public:
- QmlPropertyGroupNode(QmlClassNode* parent, const QString& name);
+ QmlPropertyGroupNode(QmlTypeNode* parent, const QString& name);
virtual ~QmlPropertyGroupNode() { }
- virtual bool isQmlNode() const { return true; }
- virtual bool isQtQuickNode() const { return parent()->isQtQuickNode(); }
- virtual QString qmlTypeName() const { return parent()->qmlTypeName(); }
- virtual QString qmlModuleName() const { return parent()->qmlModuleName(); }
- virtual QString qmlModuleVersion() const { return parent()->qmlModuleVersion(); }
- virtual QString qmlModuleIdentifier() const { return parent()->qmlModuleIdentifier(); }
- virtual QString idNumber();
- virtual bool isQmlPropertyGroup() const { return true; }
- virtual Node::Genus genus() const { return Node::QML; }
-
- virtual QString element() const { return parent()->name(); }
+ virtual bool isQtQuickNode() const Q_DECL_OVERRIDE { return parent()->isQtQuickNode(); }
+ virtual QString qmlTypeName() const Q_DECL_OVERRIDE { return parent()->qmlTypeName(); }
+ virtual QString logicalModuleName() const Q_DECL_OVERRIDE {
+ return parent()->logicalModuleName();
+ }
+ virtual QString logicalModuleVersion() const Q_DECL_OVERRIDE {
+ return parent()->logicalModuleVersion();
+ }
+ virtual QString logicalModuleIdentifier() const Q_DECL_OVERRIDE {
+ return parent()->logicalModuleIdentifier();
+ }
+ virtual QString idNumber() Q_DECL_OVERRIDE;
+ virtual bool isQmlPropertyGroup() const Q_DECL_OVERRIDE { return genus() == Node::QML; }
+ virtual bool isJsPropertyGroup() const Q_DECL_OVERRIDE { return genus() == Node::JS; }
+ virtual QString element() const Q_DECL_OVERRIDE { return parent()->name(); }
private:
int idNumber_;
@@ -672,11 +707,10 @@ public:
bool attached);
virtual ~QmlPropertyNode() { }
- virtual Node::Genus genus() const { return Node::QML; }
- virtual void setDataType(const QString& dataType) { type_ = dataType; }
+ virtual void setDataType(const QString& dataType) Q_DECL_OVERRIDE { type_ = dataType; }
void setStored(bool stored) { stored_ = toFlagValue(stored); }
void setDesignable(bool designable) { designable_ = toFlagValue(designable); }
- virtual void setReadOnly(bool ro) { readOnly_ = toFlagValue(ro); }
+ virtual void setReadOnly(bool ro) Q_DECL_OVERRIDE { readOnly_ = toFlagValue(ro); }
void setDefault() { isdefault_ = true; }
const QString &dataType() const { return type_; }
@@ -685,17 +719,24 @@ public:
bool isStored() const { return fromFlagValue(stored_,true); }
bool isDesignable() const { return fromFlagValue(designable_,false); }
bool isWritable();
- virtual bool isDefault() const { return isdefault_; }
- virtual bool isReadOnly() const { return fromFlagValue(readOnly_,false); }
- virtual bool isAlias() const { return isAlias_; }
- virtual bool isAttached() const { return attached_; }
- virtual bool isQmlNode() const { return true; }
- virtual bool isQtQuickNode() const { return parent()->isQtQuickNode(); }
- virtual QString qmlTypeName() const { return parent()->qmlTypeName(); }
- virtual QString qmlModuleName() const { return parent()->qmlModuleName(); }
- virtual QString qmlModuleVersion() const { return parent()->qmlModuleVersion(); }
- virtual QString qmlModuleIdentifier() const { return parent()->qmlModuleIdentifier(); }
- virtual QString element() const;
+ virtual bool isQmlProperty() const Q_DECL_OVERRIDE { return genus() == QML; }
+ virtual bool isJsProperty() const Q_DECL_OVERRIDE { return genus() == JS; }
+ virtual bool isDefault() const Q_DECL_OVERRIDE { return isdefault_; }
+ virtual bool isReadOnly() const Q_DECL_OVERRIDE { return fromFlagValue(readOnly_,false); }
+ virtual bool isAlias() const Q_DECL_OVERRIDE { return isAlias_; }
+ virtual bool isAttached() const Q_DECL_OVERRIDE { return attached_; }
+ virtual bool isQtQuickNode() const Q_DECL_OVERRIDE { return parent()->isQtQuickNode(); }
+ virtual QString qmlTypeName() const Q_DECL_OVERRIDE { return parent()->qmlTypeName(); }
+ virtual QString logicalModuleName() const Q_DECL_OVERRIDE {
+ return parent()->logicalModuleName();
+ }
+ virtual QString logicalModuleVersion() const Q_DECL_OVERRIDE {
+ return parent()->logicalModuleVersion();
+ }
+ virtual QString logicalModuleIdentifier() const Q_DECL_OVERRIDE {
+ return parent()->logicalModuleIdentifier();
+ }
+ virtual QString element() const Q_DECL_OVERRIDE;
private:
PropertyNode* findCorrespondingCppProperty();
@@ -731,8 +772,6 @@ public:
EnumNode(InnerNode* parent, const QString& name);
virtual ~EnumNode() { }
- virtual Node::Genus genus() const { return Node::CPP; }
- virtual bool isCppNode() const { return true; }
void addItem(const EnumItem& item);
void setFlagsType(TypedefNode* typedeff);
bool hasItem(const QString &name) const { return names.contains(name); }
@@ -754,8 +793,6 @@ public:
TypedefNode(InnerNode* parent, const QString& name);
virtual ~TypedefNode() { }
- virtual Node::Genus genus() const { return Node::CPP; }
- virtual bool isCppNode() const { return true; }
const EnumNode* associatedEnum() const { return ae; }
private:
@@ -842,8 +879,14 @@ public:
bool isConst() const { return con; }
bool isStatic() const { return sta; }
bool isOverload() const { return ove; }
- bool isReimp() const { return reimp; }
- bool isFunction() const { return true; }
+ bool isReimp() const Q_DECL_OVERRIDE { return reimp; }
+ bool isFunction() const Q_DECL_OVERRIDE { return true; }
+ virtual bool isQmlSignal() const Q_DECL_OVERRIDE { return genus() == Node::QML; }
+ virtual bool isJsSignal() const Q_DECL_OVERRIDE { return genus() == Node::JS; }
+ virtual bool isQmlSignalHandler() const Q_DECL_OVERRIDE { return genus() == Node::QML; }
+ virtual bool isJsSignalHandler() const Q_DECL_OVERRIDE { return genus() == Node::JS; }
+ virtual bool isQmlMethod() const Q_DECL_OVERRIDE { return genus() == Node::QML; }
+ virtual bool isJsMethod() const Q_DECL_OVERRIDE { return genus() == Node::JS; }
int overloadNumber() const;
const QList<Parameter>& parameters() const { return params; }
QStringList parameterNames() const;
@@ -855,20 +898,19 @@ public:
QStringList reconstructParams(bool values = false) const;
QString signature(bool values = false) const;
- virtual QString element() const { return parent()->name(); }
- virtual bool isAttached() const { return attached_; }
- virtual bool isQmlNode() const {
- return ((type() == QmlSignal) ||
- (type() == QmlMethod) ||
- (type() == QmlSignalHandler));
+ virtual QString element() const Q_DECL_OVERRIDE { return parent()->name(); }
+ virtual bool isAttached() const Q_DECL_OVERRIDE { return attached_; }
+ virtual bool isQtQuickNode() const Q_DECL_OVERRIDE { return parent()->isQtQuickNode(); }
+ virtual QString qmlTypeName() const Q_DECL_OVERRIDE { return parent()->qmlTypeName(); }
+ virtual QString logicalModuleName() const Q_DECL_OVERRIDE {
+ return parent()->logicalModuleName();
+ }
+ virtual QString logicalModuleVersion() const Q_DECL_OVERRIDE {
+ return parent()->logicalModuleVersion();
+ }
+ virtual QString logicalModuleIdentifier() const Q_DECL_OVERRIDE {
+ return parent()->logicalModuleIdentifier();
}
- virtual bool isCppNode() const { return !isQmlNode(); }
- virtual Node::Genus genus() const { return (isQmlNode() ? Node::QML : Node::CPP); }
- virtual bool isQtQuickNode() const { return parent()->isQtQuickNode(); }
- virtual QString qmlTypeName() const { return parent()->qmlTypeName(); }
- virtual QString qmlModuleName() const { return parent()->qmlModuleName(); }
- virtual QString qmlModuleVersion() const { return parent()->qmlModuleVersion(); }
- virtual QString qmlModuleIdentifier() const { return parent()->qmlModuleIdentifier(); }
void debug() const;
@@ -902,9 +944,8 @@ public:
PropertyNode(InnerNode* parent, const QString& name);
virtual ~PropertyNode() { }
- virtual Node::Genus genus() const { return Node::CPP; }
- virtual bool isCppNode() const { return true; }
- virtual void setDataType(const QString& dataType) { type_ = dataType; }
+ virtual void setDataType(const QString& dataType) Q_DECL_OVERRIDE { type_ = dataType; }
+ virtual bool isProperty() const Q_DECL_OVERRIDE { return true; }
void addFunction(FunctionNode* function, FunctionRole role);
void addSignal(FunctionNode* function, FunctionRole role);
void setStored(bool stored) { stored_ = toFlagValue(stored); }
@@ -991,8 +1032,6 @@ public:
VariableNode(InnerNode* parent, const QString &name);
virtual ~VariableNode() { }
- virtual Node::Genus genus() const { return Node::CPP; }
- virtual bool isCppNode() const { return true; }
void setLeftType(const QString &leftType) { lt = leftType; }
void setRightType(const QString &rightType) { rt = rightType; }
void setStatic(bool statique) { sta = statique; }
@@ -1011,14 +1050,14 @@ private:
inline VariableNode::VariableNode(InnerNode* parent, const QString &name)
: LeafNode(Variable, parent, name), sta(false)
{
- // nothing.
+ setGenus(Node::CPP);
}
-class DitaMapNode : public DocNode
+class DitaMapNode : public DocumentNode
{
public:
DitaMapNode(InnerNode* parent, const QString& name)
- : DocNode(parent, name, Node::Page, Node::DitaMapPage) { }
+ : DocumentNode(parent, name, Node::Page, Node::DitaMapPage) { }
virtual ~DitaMapNode() { }
const DitaRefList& map() const { return doc().ditamap(); }
@@ -1027,26 +1066,46 @@ public:
class CollectionNode : public InnerNode
{
public:
- CollectionNode(Type type, InnerNode* parent, const QString& name)
- : InnerNode(type, parent, name), seen_(false) {
+ CollectionNode(Type type,
+ InnerNode* parent,
+ const QString& name,
+ Genus genus) : InnerNode(type, parent, name), seen_(false)
+ {
setPageType(Node::OverviewPage);
+ setGenus(genus);
}
virtual ~CollectionNode() { }
- virtual bool isCollectionNode() const { return true; }
- virtual void addMember(Node* node);
- virtual bool hasMembers() const;
- virtual bool hasNamespaces() const;
- virtual bool hasClasses() const;
- virtual void getMemberNamespaces(NodeMap& out);
- virtual void getMemberClasses(NodeMap& out);
- virtual bool wasSeen() const { return seen_; }
- virtual QString title() const { return title_; }
- virtual QString subTitle() const { return subtitle_; }
- virtual QString fullTitle() const { return title_; }
- virtual QString nameForLists() const { return title_; }
- virtual void setTitle(const QString &title);
- virtual void setSubTitle(const QString &subTitle) { subtitle_ = subTitle; }
+ virtual bool isCollectionNode() const Q_DECL_OVERRIDE { return true; }
+ virtual bool isGroup() const Q_DECL_OVERRIDE { return genus() == Node::DOC; }
+ virtual bool isModule() const Q_DECL_OVERRIDE { return genus() == Node::CPP; }
+ virtual bool isQmlModule() const Q_DECL_OVERRIDE { return genus() == Node::QML; }
+ virtual bool isJsModule() const Q_DECL_OVERRIDE { return genus() == Node::JS; }
+ virtual QString qtVariable() const Q_DECL_OVERRIDE { return qtVariable_; }
+ virtual void setQtVariable(const QString& v) Q_DECL_OVERRIDE { qtVariable_ = v; }
+ virtual void addMember(Node* node) Q_DECL_OVERRIDE;
+ virtual bool hasMembers() const Q_DECL_OVERRIDE;
+ virtual bool hasNamespaces() const Q_DECL_OVERRIDE;
+ virtual bool hasClasses() const Q_DECL_OVERRIDE;
+ virtual void getMemberNamespaces(NodeMap& out) Q_DECL_OVERRIDE;
+ virtual void getMemberClasses(NodeMap& out) Q_DECL_OVERRIDE;
+ virtual bool wasSeen() const Q_DECL_OVERRIDE { return seen_; }
+ virtual QString title() const Q_DECL_OVERRIDE { return title_; }
+ virtual QString subTitle() const Q_DECL_OVERRIDE { return subtitle_; }
+ virtual QString fullTitle() const Q_DECL_OVERRIDE { return title_; }
+ virtual QString nameForLists() const Q_DECL_OVERRIDE { return title_; }
+ virtual void setTitle(const QString &title) Q_DECL_OVERRIDE;
+ virtual void setSubTitle(const QString &subTitle) Q_DECL_OVERRIDE { subtitle_ = subTitle; }
+
+ virtual QString logicalModuleName() const Q_DECL_OVERRIDE { return logicalModuleName_; }
+ virtual QString logicalModuleVersion() const Q_DECL_OVERRIDE {
+ return logicalModuleVersionMajor_ + "." + logicalModuleVersionMinor_;
+ }
+ virtual QString logicalModuleIdentifier() const Q_DECL_OVERRIDE {
+ return logicalModuleName_ + logicalModuleVersionMajor_;
+ }
+ virtual void setLogicalModuleInfo(const QString& arg) Q_DECL_OVERRIDE;
+ virtual void setLogicalModuleInfo(const QStringList& info) Q_DECL_OVERRIDE;
const NodeList& members() const { return members_; }
void printMembers(const QString& title);
@@ -1059,58 +1118,9 @@ class CollectionNode : public InnerNode
QString title_;
QString subtitle_;
NodeList members_;
-};
-
-class GroupNode : public CollectionNode
-{
- public:
- GroupNode(InnerNode* parent, const QString& name)
- : CollectionNode(Node::Group, parent, name) { }
- virtual ~GroupNode() { }
-
- virtual bool isGroup() const { return true; }
-};
-
-class ModuleNode : public CollectionNode
-{
- public:
- ModuleNode(InnerNode* parent, const QString& name)
- : CollectionNode(Node::Module, parent, name) { }
- virtual ~ModuleNode() { }
-
- virtual bool isModule() const { return true; }
- virtual bool isCppNode() const { return true; }
- virtual void setQtVariable(const QString& v) { qtVariable_ = v; }
- virtual QString qtVariable() const { return qtVariable_; }
-
- private:
- QString qtVariable_;
-};
-
-class QmlModuleNode : public CollectionNode
-{
- public:
- QmlModuleNode(InnerNode* parent, const QString& name)
- : CollectionNode(Node::QmlModule, parent, name) { }
- virtual ~QmlModuleNode() { }
-
- virtual bool isQmlNode() const { return true; }
- virtual bool isQmlModule() const { return true; }
- virtual QString qmlModuleName() const { return qmlModuleName_; }
- virtual QString qmlModuleVersion() const {
- return qmlModuleVersionMajor_ + "." + qmlModuleVersionMinor_;
- }
- virtual QString qmlModuleIdentifier() const {
- return qmlModuleName_ + qmlModuleVersionMajor_;
- }
- virtual void setQmlModuleInfo(const QString& );
- virtual void setQtVariable(const QString& v) { qtVariable_ = v; }
- virtual QString qtVariable() const { return qtVariable_; }
-
- private:
- QString qmlModuleName_;
- QString qmlModuleVersionMajor_;
- QString qmlModuleVersionMinor_;
+ QString logicalModuleName_;
+ QString logicalModuleVersionMajor_;
+ QString logicalModuleVersionMinor_;
QString qtVariable_;
};
diff --git a/src/tools/qdoc/openedlist.cpp b/src/tools/qdoc/openedlist.cpp
index 001901d550..6bb4a270e7 100644
--- a/src/tools/qdoc/openedlist.cpp
+++ b/src/tools/qdoc/openedlist.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
diff --git a/src/tools/qdoc/openedlist.h b/src/tools/qdoc/openedlist.h
index c2139248ab..ee45714cfd 100644
--- a/src/tools/qdoc/openedlist.h
+++ b/src/tools/qdoc/openedlist.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
diff --git a/src/tools/qdoc/plaincodemarker.cpp b/src/tools/qdoc/plaincodemarker.cpp
index a35f766637..94561c3f48 100644
--- a/src/tools/qdoc/plaincodemarker.cpp
+++ b/src/tools/qdoc/plaincodemarker.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
diff --git a/src/tools/qdoc/plaincodemarker.h b/src/tools/qdoc/plaincodemarker.h
index df6beebd03..6d41b3dd81 100644
--- a/src/tools/qdoc/plaincodemarker.h
+++ b/src/tools/qdoc/plaincodemarker.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
@@ -48,20 +48,20 @@ public:
PlainCodeMarker();
~PlainCodeMarker();
- bool recognizeCode( const QString& code );
- bool recognizeExtension( const QString& ext );
- bool recognizeLanguage( const QString& lang );
- Atom::Type atomType() const;
- QString markedUpCode( const QString& code, const Node *relative, const Location &location );
+ bool recognizeCode( const QString& code ) Q_DECL_OVERRIDE;
+ bool recognizeExtension( const QString& ext ) Q_DECL_OVERRIDE;
+ bool recognizeLanguage( const QString& lang ) Q_DECL_OVERRIDE;
+ Atom::Type atomType() const Q_DECL_OVERRIDE;
+ QString markedUpCode( const QString& code, const Node *relative, const Location &location ) Q_DECL_OVERRIDE;
QString markedUpSynopsis( const Node *node, const Node *relative,
- SynopsisStyle style );
- QString markedUpName( const Node *node );
- QString markedUpFullName( const Node *node, const Node *relative );
- QString markedUpEnumValue(const QString &enumValue, const Node *relative);
- QString markedUpIncludes( const QStringList& includes );
- QString functionBeginRegExp( const QString& funcName );
- QString functionEndRegExp( const QString& funcName );
- QList<Section> sections(const InnerNode *innerNode, SynopsisStyle style, Status status);
+ SynopsisStyle style ) Q_DECL_OVERRIDE;
+ QString markedUpName( const Node *node ) Q_DECL_OVERRIDE;
+ QString markedUpFullName( const Node *node, const Node *relative ) Q_DECL_OVERRIDE;
+ QString markedUpEnumValue(const QString &enumValue, const Node *relative) Q_DECL_OVERRIDE;
+ QString markedUpIncludes( const QStringList& includes ) Q_DECL_OVERRIDE;
+ QString functionBeginRegExp( const QString& funcName ) Q_DECL_OVERRIDE;
+ QString functionEndRegExp( const QString& funcName ) Q_DECL_OVERRIDE;
+ QList<Section> sections(const InnerNode *innerNode, SynopsisStyle style, Status status) Q_DECL_OVERRIDE;
};
QT_END_NAMESPACE
diff --git a/src/tools/qdoc/puredocparser.cpp b/src/tools/qdoc/puredocparser.cpp
index 7ff4c24399..7029431460 100644
--- a/src/tools/qdoc/puredocparser.cpp
+++ b/src/tools/qdoc/puredocparser.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
@@ -133,6 +133,7 @@ bool PureDocParser::processQdocComments()
QString topic;
bool isQmlPropertyTopic = false;
+ bool isJsPropertyTopic = false;
const TopicList& topics = doc.topicsUsed();
if (!topics.isEmpty()) {
@@ -142,8 +143,13 @@ bool PureDocParser::processQdocComments()
(topic == COMMAND_QMLATTACHEDPROPERTY)) {
isQmlPropertyTopic = true;
}
+ else if ((topic == COMMAND_JSPROPERTY) ||
+ (topic == COMMAND_JSPROPERTYGROUP) ||
+ (topic == COMMAND_JSATTACHEDPROPERTY)) {
+ isJsPropertyTopic = true;
+ }
}
- if (isQmlPropertyTopic && topics.size() > 1) {
+ if ((isQmlPropertyTopic || isJsPropertyTopic) && topics.size() > 1) {
qDebug() << "MULTIPLE TOPICS:" << doc.location().fileName() << doc.location().lineNo();
for (int i=0; i<topics.size(); ++i) {
qDebug() << " " << topics[i].topic << topics[i].args;
@@ -158,9 +164,9 @@ bool PureDocParser::processQdocComments()
"(e.g., '\\%1', '\\%2').")
.arg(COMMAND_MODULE).arg(COMMAND_PAGE));
}
- else if (isQmlPropertyTopic) {
+ else if (isQmlPropertyTopic || isJsPropertyTopic) {
Doc nodeDoc = doc;
- processQmlProperties(nodeDoc, nodes, docs);
+ processQmlProperties(nodeDoc, nodes, docs, isJsPropertyTopic);
}
else {
ArgList args;
diff --git a/src/tools/qdoc/puredocparser.h b/src/tools/qdoc/puredocparser.h
index e6a4eca9d8..20748c882d 100644
--- a/src/tools/qdoc/puredocparser.h
+++ b/src/tools/qdoc/puredocparser.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
@@ -57,8 +57,8 @@ public:
PureDocParser();
virtual ~PureDocParser();
- virtual QStringList sourceFileNameFilter();
- virtual void parseSourceFile(const Location& location, const QString& filePath);
+ virtual QStringList sourceFileNameFilter() Q_DECL_OVERRIDE;
+ virtual void parseSourceFile(const Location& location, const QString& filePath) Q_DECL_OVERRIDE;
private:
bool processQdocComments();
diff --git a/src/tools/qdoc/qdoc.pro b/src/tools/qdoc/qdoc.pro
index 7ec4b4f726..f0df113af8 100644
--- a/src/tools/qdoc/qdoc.pro
+++ b/src/tools/qdoc/qdoc.pro
@@ -26,7 +26,6 @@ HEADERS += atom.h \
config.h \
cppcodemarker.h \
cppcodeparser.h \
- ditaxmlgenerator.h \
doc.h \
editdistance.h \
generator.h \
@@ -52,7 +51,6 @@ SOURCES += atom.cpp \
config.cpp \
cppcodemarker.cpp \
cppcodeparser.cpp \
- ditaxmlgenerator.cpp \
doc.cpp \
editdistance.cpp \
generator.cpp \
diff --git a/src/tools/qdoc/qdocdatabase.cpp b/src/tools/qdoc/qdocdatabase.cpp
index 36dd05bb92..75295613f7 100644
--- a/src/tools/qdoc/qdocdatabase.cpp
+++ b/src/tools/qdoc/qdocdatabase.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
@@ -128,142 +128,54 @@ Tree* QDocForest::nextTree()
*/
/*!
+ Finds the tree for module \a t in the forest and
+ sets the primary tree to be that tree. After the
+ primary tree is set, that tree is removed from the
+ forest.
+
+ \node It gets re-inserted into the forest after the
+ search order is built.
+ */
+void QDocForest::setPrimaryTree(const QString& t)
+{
+ primaryTree_ = findTree(t);
+ forest_.remove(t);
+ if (!primaryTree_)
+ qDebug() << "ERROR: Could not set primary tree to:" << t;
+}
+
+/*!
If the search order array is empty, create the search order.
If the search order array is not empty, do nothing.
*/
-void QDocForest::setSearchOrder()
+void QDocForest::setSearchOrder(QStringList& t)
{
if (!searchOrder_.isEmpty())
return;
- QString primaryName = primaryTree()->moduleName();
- searchOrder_.clear();
+
+ /* Allocate space for the search order. */
searchOrder_.reserve(forest_.size()+1);
+ searchOrder_.clear();
moduleNames_.reserve(forest_.size()+1);
+ moduleNames_.clear();
+
+ /* The primary tree is always first in the search order. */
+ QString primaryName = primaryTree()->physicalModuleName();
searchOrder_.append(primaryTree_);
moduleNames_.append(primaryName);
+ forest_.remove(primaryName);
+
QMap<QString, Tree*>::iterator i;
- if (primaryName != "QtCore") {
- i = forest_.find("QtCore");
- if (i != forest_.end()) {
- searchOrder_.append(i.value());
- moduleNames_.append("QtCore");
- forest_.erase(i);
- }
- }
- if (primaryName != "QtGui") {
- i = forest_.find("QtGui");
- if (i != forest_.end()) {
- searchOrder_.append(i.value());
- moduleNames_.append("QtGui");
- forest_.erase(i);
- }
- }
- if (primaryName != "QtNetwork") {
- i = forest_.find("QtNetwork");
- if (i != forest_.end()) {
- searchOrder_.append(i.value());
- moduleNames_.append("QtNetwork");
- forest_.erase(i);
- }
- }
- if (primaryName != "QtOpenGL") {
- i = forest_.find("QtOpenGL");
- if (i != forest_.end()) {
- searchOrder_.append(i.value());
- moduleNames_.append("QtOpenGL");
- forest_.erase(i);
- }
- }
- if (primaryName != "QtWidgets") {
- i = forest_.find("QtWidgets");
- if (i != forest_.end()) {
- searchOrder_.append(i.value());
- moduleNames_.append("QtWidgets");
- forest_.erase(i);
- }
- }
- if (primaryName != "QtSql") {
- i = forest_.find("QtSql");
- if (i != forest_.end()) {
- searchOrder_.append(i.value());
- moduleNames_.append("QtSql");
- forest_.erase(i);
- }
- }
- if (primaryName != "QtXml") {
- i = forest_.find("QtXml");
- if (i != forest_.end()) {
- searchOrder_.append(i.value());
- moduleNames_.append("QtXml");
- forest_.erase(i);
- }
- }
- if (primaryName != "QtSvg") {
- i = forest_.find("QtSvg");
- if (i != forest_.end()) {
- searchOrder_.append(i.value());
- moduleNames_.append("QtSvg");
- forest_.erase(i);
- }
- }
- if (primaryName != "QtDoc") {
- i = forest_.find("QtDoc");
- if (i != forest_.end()) {
- searchOrder_.append(i.value());
- moduleNames_.append("QtDoc");
- forest_.erase(i);
- }
- }
- if (primaryName != "QtQuick") {
- i = forest_.find("QtQuick");
- if (i != forest_.end()) {
- searchOrder_.append(i.value());
- moduleNames_.append("QtQuick");
- forest_.erase(i);
- }
- }
- if (primaryName != "QtQml") {
- i = forest_.find("QtQml");
- if (i != forest_.end()) {
- searchOrder_.append(i.value());
- moduleNames_.append("QtQml");
- forest_.erase(i);
- }
- }
- if (primaryName != "QtPrintSupport") {
- i = forest_.find("QtPrintSupport");
- if (i != forest_.end()) {
- searchOrder_.append(i.value());
- moduleNames_.append("QtPrintSupport");
- forest_.erase(i);
- }
- }
- if (primaryName != "QtGraphicalEffects") {
- i = forest_.find("QtGraphicalEffects");
- if (i != forest_.end()) {
- searchOrder_.append(i.value());
- moduleNames_.append("QtGraphicalEffects");
- forest_.erase(i);
- }
- }
- if (primaryName != "QtConcurrent") {
- i = forest_.find("QtConcurrent");
- if (i != forest_.end()) {
- searchOrder_.append(i.value());
- moduleNames_.append("QtConcurrent");
- forest_.erase(i);
- }
- }
-#if 0
- if (primaryName != "zzz") {
- i = forest_.find("zzz");
- if (i != forest_.end()) {
- searchOrder_.append(i.value());
- moduleNames_.append("zzz");
- forest_.erase(i);
+ foreach (QString m, t) {
+ if (primaryName != m) {
+ i = forest_.find(m);
+ if (i != forest_.end()) {
+ searchOrder_.append(i.value());
+ moduleNames_.append(m);
+ forest_.remove(m);
+ }
}
}
-#endif
/*
If any trees remain in the forest, just add them
to the search order sequentially, because we don't
@@ -283,15 +195,21 @@ void QDocForest::setSearchOrder()
Rebuild the forest after constructing the search order.
It was destroyed during construction of the search order,
but it is needed for module-specific searches.
+
+ Note that this loop also inserts the primary tree into the
+ forrest. That is a requirement.
*/
for (int i=0; i<searchOrder_.size(); ++i) {
- forest_.insert(moduleNames_.at(i).toLower(), searchOrder_.at(i));
+ if (!forest_.contains(moduleNames_.at(i))) {
+ forest_.insert(moduleNames_.at(i), searchOrder_.at(i));
+ }
}
-
#if 0
- qDebug() << " SEARCH ORDER:";
+ qDebug() << " SEARCH ORDER:";
for (int i=0; i<moduleNames_.size(); ++i)
- qDebug() << " " << i+1 << "." << moduleNames_.at(i);
+ qDebug() << " " << i+1 << "." << moduleNames_.at(i);
+ qDebug() << " FOREST:" << forest_.keys();
+ qDebug() << "SEARCH ORDER:" << moduleNames_;
#endif
}
@@ -363,7 +281,7 @@ NamespaceNode* QDocForest::newIndexTree(const QString& module)
/*!
Create a new Tree for use as the primary tree. This tree
- will represent the primary module.
+ will represent the primary module. \a module is camel case.
*/
void QDocForest::newPrimaryTree(const QString& module)
{
@@ -407,28 +325,58 @@ const Node* QDocForest::findNodeForTarget(QStringList& targetPath,
}
/*!
- This function merges all the collection maps for collection
- nodes of node type \a t into the collection multimap \a cnmm,
- which is cleared before starting.
+ Print the list of module names ordered according
+ to how many successful searches each tree had.
+ */
+void QDocForest::printLinkCounts(const QString& project)
+{
+ Location::null.report(QString("%1: Link Counts").arg(project));
+ QMultiMap<int, QString> m;
+ foreach (Tree* t, searchOrder()) {
+ if (t->linkCount() < 0)
+ m.insert(t->linkCount(), t->physicalModuleName());
+ }
+ QString depends = "depends +=";
+ QString module = project.toLower();
+ QMultiMap<int, QString>::iterator i = m.begin();
+ while (i != m.end()) {
+ QString line = " " + i.value();
+ if (i.value() != module)
+ depends += " " + i.value();
+ int pad = 30 - line.length();
+ for (int k=0; k<pad; ++k)
+ line += " ";
+ line += "%1";
+ Location::null.report(line.arg(-(i.key())));
+ ++i;
+ }
+ Location::null.report("Optimal depends variable:");
+ Location::null.report(depends);
+}
- This is mainly useful for groups, which often cross module
- boundaries. It might be true that neither modules nor QML
- modules cross module boundaries, but this function works for
- those cases as well.
+/*!
+ Print the list of module names ordered according
+ to how many successful searches each tree had.
*/
-void QDocForest::mergeCollectionMaps(Node::Type nt, CNMultiMap& cnmm)
+QString QDocForest::getLinkCounts(QStringList& strings, QVector<int>& counts)
{
+ QMultiMap<int, QString> m;
foreach (Tree* t, searchOrder()) {
- const CNMap& cnm = t->getCollections(nt);
- if (!cnm.isEmpty()) {
- CNMap::const_iterator i = cnm.begin();
- while (i != cnm.end()) {
- if (!i.value()->isInternal())
- cnmm.insert(i.key(), i.value());
- ++i;
- }
+ if (t->linkCount() < 0)
+ m.insert(t->linkCount(), t->physicalModuleName());
+ }
+ QString depends = "depends +=";
+ QString module = Generator::defaultModuleName().toLower();
+ QMultiMap<int, QString>::iterator i = m.begin();
+ while (i != m.end()) {
+ if (i.value() != module) {
+ counts.append(-(i.key()));
+ strings.append(i.value());
+ depends += " " + i.value();
}
+ ++i;
}
+ return depends;
}
/*! \class QDocDatabase
@@ -445,8 +393,19 @@ NodeMap QDocDatabase::typeNodeMap_;
constructs the \a forest_ object, which is also a singleton.
\a showInternal_ is normally false. If it is true, qdoc will
write documentation for nodes marked \c internal.
+
+ \a singleExec_ is false when qdoc is being used in the standard
+ way of running qdoc twices for each module, first with -prepare
+ and then with -generate. First the -prepare phase is run for
+ each module, then the -generate phase is run for each module.
+
+ When \a singleExec_ is true, qdoc is run only once. During the
+ single execution, qdoc processes the qdocconf files for all the
+ modules sequentially in a loop. Each source file for each module
+ is read exactly once.
*/
-QDocDatabase::QDocDatabase() : showInternal_(false), forest_(this)
+QDocDatabase::QDocDatabase()
+ : showInternal_(false), singleExec_(false), forest_(this)
{
// nothing
}
@@ -649,29 +608,30 @@ void QDocDatabase::initializeDB()
*/
/*!
- \fn const GroupMap& QDocDatabase::groups()
+ \fn const CNMap& QDocDatabase::groups()
Returns a const reference to the collection of all
group nodes in the primary tree.
*/
/*!
- \fn const ModuleMap& QDocDatabase::modules()
+ \fn const CNMap& QDocDatabase::modules()
Returns a const reference to the collection of all
module nodes in the primary tree.
*/
/*!
- \fn const QmlModuleMap& QDocDatabase::qmlModules()
+ \fn const CNMap& QDocDatabase::qmlModules()
Returns a const reference to the collection of all
QML module nodes in the primary tree.
*/
-/*! \fn GroupNode* QDocDatabase::getGroup(const QString& name)
- Find the group node named \a name and return a pointer
- to it. If a matching node is not found, return 0.
- */
+/*!
+ \fn const CNMap& QDocDatabase::jsModules()
+ Returns a const reference to the collection of all
+ JovaScript module nodes in the primary tree.
+*/
-/*! \fn GroupNode* QDocDatabase::findGroup(const QString& name)
+/*! \fn CollectionNode* QDocDatabase::findGroup(const QString& name)
Find the group node named \a name and return a pointer
to it. If a matching node is not found, add a new group
node named \a name and return a pointer to that one.
@@ -680,7 +640,7 @@ void QDocDatabase::initializeDB()
and the new group node is marked \e{not seen}.
*/
-/*! \fn ModuleNode* QDocDatabase::findModule(const QString& name)
+/*! \fn CollectionNode* QDocDatabase::findModule(const QString& name)
Find the module node named \a name and return a pointer
to it. If a matching node is not found, add a new module
node named \a name and return a pointer to that one.
@@ -689,16 +649,19 @@ void QDocDatabase::initializeDB()
and the new module node is marked \e{not seen}.
*/
-/*! \fn QmlModuleNode* QDocDatabase::findQmlModule(const QString& name)
+/*! \fn CollectionNode* QDocDatabase::findQmlModule(const QString& name, bool javaScript)
Find the QML module node named \a name and return a pointer
to it. If a matching node is not found, add a new QML module
node named \a name and return a pointer to that one.
- If a new QML module node is added, its parent is the tree root,
- and the new QML module node is marked \e{not seen}.
+ If \a javaScript is set, the return collection must be a
+ JavaScript module.
+
+ If a new QML or JavaScript module node is added, its parent
+ is the tree root, and the new node is marked \e{not seen}.
*/
-/*! \fn GroupNode* QDocDatabase::addGroup(const QString& name)
+/*! \fn CollectionNode* QDocDatabase::addGroup(const QString& name)
Looks up the group named \a name in the primary tree. If
a match is found, a pointer to the node is returned.
Otherwise, a new group node named \a name is created and
@@ -706,7 +669,7 @@ void QDocDatabase::initializeDB()
is returned.
*/
-/*! \fn ModuleNode* QDocDatabase::addModule(const QString& name)
+/*! \fn CollectionNode* QDocDatabase::addModule(const QString& name)
Looks up the module named \a name in the primary tree. If
a match is found, a pointer to the node is returned.
Otherwise, a new module node named \a name is created and
@@ -714,7 +677,7 @@ void QDocDatabase::initializeDB()
is returned.
*/
-/*! \fn QmlModuleNode* QDocDatabase::addQmlModule(const QString& name)
+/*! \fn CollectionNode* QDocDatabase::addQmlModule(const QString& name)
Looks up the QML module named \a name in the primary tree.
If a match is found, a pointer to the node is returned.
Otherwise, a new QML module node named \a name is created
@@ -722,7 +685,15 @@ void QDocDatabase::initializeDB()
node is returned.
*/
-/*! \fn GroupNode* QDocDatabase::addToGroup(const QString& name, Node* node)
+/*! \fn CollectionNode* QDocDatabase::addJsModule(const QString& name)
+ Looks up the JavaScript module named \a name in the primary
+ tree. If a match is found, a pointer to the node is returned.
+ Otherwise, a new JavaScript module node named \a name is
+ created and inserted into the collection, and the pointer to
+ that node is returned.
+ */
+
+/*! \fn CollectionNode* QDocDatabase::addToGroup(const QString& name, Node* node)
Looks up the group node named \a name in the collection
of all group nodes. If a match is not found, a new group
node named \a name is created and inserted into the collection.
@@ -732,7 +703,7 @@ void QDocDatabase::initializeDB()
the group node.
*/
-/*! \fn ModuleNode* QDocDatabase::addToModule(const QString& name, Node* node)
+/*! \fn CollectionNode* QDocDatabase::addToModule(const QString& name, Node* node)
Looks up the module node named \a name in the collection
of all module nodes. If a match is not found, a new module
node named \a name is created and inserted into the collection.
@@ -740,19 +711,25 @@ void QDocDatabase::initializeDB()
\a node is not changed by this function. Returns the module node.
*/
-/*! \fn QmlModuleNode* QDocDatabase::addToQmlModule(const QString& name, Node* node)
+/*! \fn Collection* QDocDatabase::addToQmlModule(const QString& name, Node* node)
Looks up the QML module named \a name. If it isn't there,
create it. Then append \a node to the QML module's member
list. The parent of \a node is not changed by this function.
*/
+/*! \fn Collection* QDocDatabase::addToJsModule(const QString& name, Node* node)
+ Looks up the JavaScript module named \a name. If it isn't there,
+ create it. Then append \a node to the JavaScript module's member
+ list. The parent of \a node is not changed by this function.
+ */
+
/*!
Looks up the QML type node identified by the qualified Qml
type \a name and returns a pointer to the QML type node.
*/
-QmlClassNode* QDocDatabase::findQmlType(const QString& name)
+QmlTypeNode* QDocDatabase::findQmlType(const QString& name)
{
- QmlClassNode* qcn = forest_.lookupQmlType(name);
+ QmlTypeNode* qcn = forest_.lookupQmlType(name);
if (qcn)
return qcn;
return 0;
@@ -766,19 +743,19 @@ QmlClassNode* QDocDatabase::findQmlType(const QString& name)
If the QML module id is empty, it looks up the QML type by
\a name only.
*/
-QmlClassNode* QDocDatabase::findQmlType(const QString& qmid, const QString& name)
+QmlTypeNode* QDocDatabase::findQmlType(const QString& qmid, const QString& name)
{
if (!qmid.isEmpty()) {
QString t = qmid + "::" + name;
- QmlClassNode* qcn = forest_.lookupQmlType(t);
+ QmlTypeNode* qcn = forest_.lookupQmlType(t);
if (qcn)
return qcn;
}
QStringList path(name);
Node* n = forest_.findNodeByNameAndType(path, Node::QmlType);
- if (n && n->isQmlType())
- return static_cast<QmlClassNode*>(n);
+ if (n && (n->isQmlType() || n->isJsType()))
+ return static_cast<QmlTypeNode*>(n);
return 0;
}
@@ -788,7 +765,7 @@ QmlClassNode* QDocDatabase::findQmlType(const QString& qmid, const QString& name
QML type \a name and returns a pointer to the QML type node.
If a QML type node is not found, 0 is returned.
*/
-QmlClassNode* QDocDatabase::findQmlType(const ImportRec& import, const QString& name)
+QmlTypeNode* QDocDatabase::findQmlType(const ImportRec& import, const QString& name)
{
if (!import.isEmpty()) {
QStringList dotSplit;
@@ -800,7 +777,7 @@ QmlClassNode* QDocDatabase::findQmlType(const ImportRec& import, const QString&
qmName = import.importUri_;
for (int i=0; i<dotSplit.size(); ++i) {
QString qualifiedName = qmName + "::" + dotSplit[i];
- QmlClassNode* qcn = forest_.lookupQmlType(qualifiedName);
+ QmlTypeNode* qcn = forest_.lookupQmlType(qualifiedName);
if (qcn)
return qcn;
}
@@ -809,13 +786,41 @@ QmlClassNode* QDocDatabase::findQmlType(const ImportRec& import, const QString&
}
/*!
- This function calls \a func for each tree in the forest.
+ This function calls a set of functions for each tree in the
+ forest that has not already been analyzed. In this way, when
+ running qdoc in \e singleExec mode, each tree is analyzed in
+ turn, and its classes and types are added to the appropriate
+ node maps.
+ */
+void QDocDatabase::processForest()
+{
+ Tree* t = forest_.firstTree();
+ while (t) {
+ findAllNamespaces(t->root());
+ findAllClasses(t->root());
+ findAllFunctions(t->root());
+ findAllObsoleteThings(t->root());
+ findAllLegaleseTexts(t->root());
+ findAllSince(t->root());
+ t->setTreeHasBeenAnalyzed();
+ t = forest_.nextTree();
+ }
+}
+
+/*!
+ This function calls \a func for each tree in the forest,
+ but only if Tree::treeHasBeenAnalyzed() returns false for
+ the tree. In this way, when running qdoc in \e singleExec
+ mode, each tree is analyzed in turn, and its classes and
+ types are added to the appropriate node maps.
*/
void QDocDatabase::processForest(void (QDocDatabase::*func) (InnerNode*))
{
Tree* t = forest_.firstTree();
while (t) {
- (this->*(func))(t->root());
+ if (!t->treeHasBeenAnalyzed()) {
+ (this->*(func))(t->root());
+ }
t = forest_.nextTree();
}
}
@@ -887,7 +892,7 @@ NodeMap& QDocDatabase::getNamespaces()
*/
NodeMap& QDocDatabase::getServiceClasses()
{
- if (nonCompatClasses_.isEmpty() && qmlClasses_.isEmpty())
+ if (cppClasses_.isEmpty() && qmlTypes_.isEmpty())
processForest(&QDocDatabase::findAllClasses);
return serviceClasses_;
}
@@ -899,7 +904,7 @@ NodeMap& QDocDatabase::getServiceClasses()
*/
NodeMap& QDocDatabase::getQmlBasicTypes()
{
- if (nonCompatClasses_.isEmpty() && qmlBasicTypes_.isEmpty())
+ if (cppClasses_.isEmpty() && qmlBasicTypes_.isEmpty())
processForest(&QDocDatabase::findAllClasses);
return qmlBasicTypes_;
}
@@ -911,9 +916,9 @@ NodeMap& QDocDatabase::getQmlBasicTypes()
*/
NodeMap& QDocDatabase::getQmlTypes()
{
- if (nonCompatClasses_.isEmpty() && qmlClasses_.isEmpty())
+ if (cppClasses_.isEmpty() && qmlTypes_.isEmpty())
processForest(&QDocDatabase::findAllClasses);
- return qmlClasses_;
+ return qmlTypes_;
}
/*!
@@ -935,7 +940,7 @@ NodeMap& QDocDatabase::getObsoleteClasses()
*/
NodeMap& QDocDatabase::getCompatibilityClasses()
{
- if (nonCompatClasses_.isEmpty() && qmlClasses_.isEmpty())
+ if (cppClasses_.isEmpty() && qmlTypes_.isEmpty())
processForest(&QDocDatabase::findAllClasses);
return compatClasses_;
}
@@ -950,7 +955,7 @@ NodeMap& QDocDatabase::getCompatibilityClasses()
*/
NodeMap& QDocDatabase::getMainClasses()
{
- if (nonCompatClasses_.isEmpty() && qmlClasses_.isEmpty())
+ if (cppClasses_.isEmpty() && qmlTypes_.isEmpty())
processForest(&QDocDatabase::findAllClasses);
return mainClasses_;
}
@@ -962,9 +967,9 @@ NodeMap& QDocDatabase::getMainClasses()
*/
NodeMap& QDocDatabase::getCppClasses()
{
- if (nonCompatClasses_.isEmpty() && qmlClasses_.isEmpty())
+ if (cppClasses_.isEmpty() && qmlTypes_.isEmpty())
processForest(&QDocDatabase::findAllClasses);
- return nonCompatClasses_;
+ return cppClasses_;
}
/*!
@@ -987,7 +992,7 @@ void QDocDatabase::findAllClasses(InnerNode* node)
compatClasses_.insert(className, *c);
}
else {
- nonCompatClasses_.insert(className, *c);
+ cppClasses_.insert(className, *c);
if ((*c)->status() == Node::Main)
mainClasses_.insert(className, *c);
}
@@ -997,15 +1002,16 @@ void QDocDatabase::findAllClasses(InnerNode* node)
serviceClasses_.insert(serviceName, *c);
}
}
- else if (((*c)->isQmlType() || (*c)->isQmlBasicType())&& !(*c)->doc().isEmpty()) {
+ else if (((*c)->isQmlType() || (*c)->isQmlBasicType() ||
+ (*c)->isJsType() || (*c)->isJsBasicType()) && !(*c)->doc().isEmpty()) {
QString qmlTypeName = (*c)->name();
if (qmlTypeName.startsWith(QLatin1String("QML:")))
- qmlClasses_.insert(qmlTypeName.mid(4),*c);
+ qmlTypes_.insert(qmlTypeName.mid(4),*c);
else
- qmlClasses_.insert(qmlTypeName,*c);
+ qmlTypes_.insert(qmlTypeName,*c);
//also add to the QML basic type map
- if ((*c)->isQmlBasicType())
+ if ((*c)->isQmlBasicType() || (*c)->isJsType())
qmlBasicTypes_.insert(qmlTypeName,*c);
}
else if ((*c)->isInnerNode()) {
@@ -1022,7 +1028,6 @@ void QDocDatabase::findAllClasses(InnerNode* node)
*/
NodeMapMap& QDocDatabase::getFunctionIndex()
{
- funcIndex_.clear();
processForest(&QDocDatabase::findAllFunctions);
return funcIndex_;
}
@@ -1110,10 +1115,10 @@ void QDocDatabase::findAllObsoleteThings(InnerNode* node)
name = (*c)->parent()->name() + "::" + name;
obsoleteClasses_.insert(name, *c);
}
- else if ((*c)->isQmlType()) {
+ else if ((*c)->isQmlType() || (*c)->isJsType()) {
if (name.startsWith(QLatin1String("QML:")))
name = name.mid(4);
- name = (*c)->qmlModuleName() + "::" + name;
+ name = (*c)->logicalModuleName() + "::" + name;
obsoleteQmlTypes_.insert(name,*c);
}
}
@@ -1146,7 +1151,7 @@ void QDocDatabase::findAllObsoleteThings(InnerNode* node)
++p;
}
}
- else if ((*c)->isQmlType()) {
+ else if ((*c)->isQmlType() || (*c)->isJsType()) {
InnerNode* n = static_cast<InnerNode*>(*c);
bool inserted = false;
NodeList::const_iterator p = n->childNodes().constBegin();
@@ -1159,9 +1164,11 @@ void QDocDatabase::findAllObsoleteThings(InnerNode* node)
case Node::QmlMethod:
if ((*c)->parent()) {
Node* parent = (*c)->parent();
- if (parent->type() == Node::QmlPropertyGroup && parent->parent())
+ if ((parent->isQmlPropertyGroup() ||
+ parent->isJsPropertyGroup()) && parent->parent())
parent = parent->parent();
- if (parent && parent->isQmlType() && !parent->name().isEmpty())
+ if (parent && (parent->isQmlType() || parent->isJsType()) &&
+ !parent->name().isEmpty())
name = parent->name() + "::" + name;
}
qmlTypesWithObsoleteMembers_.insert(name,*c);
@@ -1230,7 +1237,7 @@ void QDocDatabase::findAllSince(InnerNode* node)
nsmap.value().insert(className,(*child));
ncmap.value().insert(className,(*child));
}
- else if ((*child)->isQmlType()) {
+ else if ((*child)->isQmlType() || (*child)->isJsType()) {
// Insert QML elements into the since and element maps.
QString className = (*child)->name();
if ((*child)->parent() && !(*child)->parent()->name().isEmpty()) {
@@ -1239,7 +1246,7 @@ void QDocDatabase::findAllSince(InnerNode* node)
nsmap.value().insert(className,(*child));
nqcmap.value().insert(className,(*child));
}
- else if ((*child)->type() == Node::QmlProperty) {
+ else if ((*child)->isQmlProperty() || (*child)->isJsProperty()) {
// Insert QML properties into the since map.
QString propertyName = (*child)->name();
nsmap.value().insert(propertyName,(*child));
@@ -1314,10 +1321,19 @@ const NodeMultiMap& QDocDatabase::getSinceMap(const QString& key)
*/
void QDocDatabase::resolveIssues() {
resolveQmlInheritance(primaryTreeRoot());
- resolveTargets();
+ primaryTree()->resolveTargets(primaryTreeRoot());
primaryTree()->resolveCppToQmlLinks();
}
+void QDocDatabase::resolveStuff()
+{
+ primaryTree()->resolveInheritance();
+ resolveQmlInheritance(primaryTreeRoot());
+ //primaryTree()->resolveTargets(primaryTreeRoot());
+ primaryTree()->resolveCppToQmlLinks();
+ primaryTree()->resolveUsingClauses();
+}
+
/*!
This function is called for autolinking to a \a type,
which could be a function return type or a parameter
@@ -1361,7 +1377,7 @@ const Node* QDocDatabase::findNodeForTarget(const QString& target, const Node* r
return n;
relative = 0;
}
- node = findDocNodeByTitle(target);
+ node = findDocumentNodeByTitle(target);
}
return node;
}
@@ -1378,10 +1394,10 @@ void QDocDatabase::resolveQmlInheritance(InnerNode* root)
NodeMap previousSearches;
// Do we need recursion?
foreach (Node* child, root->childNodes()) {
- if (child->isQmlType()) {
- QmlClassNode* qcn = static_cast<QmlClassNode*>(child);
+ if (child->isQmlType() || child->isJsType()) {
+ QmlTypeNode* qcn = static_cast<QmlTypeNode*>(child);
if (qcn->qmlBaseNodeNotSet() && !qcn->qmlBaseName().isEmpty()) {
- QmlClassNode* bqcn = static_cast<QmlClassNode*>(previousSearches.value(qcn->qmlBaseName()));
+ QmlTypeNode* bqcn = static_cast<QmlTypeNode*>(previousSearches.value(qcn->qmlBaseName()));
if (bqcn)
qcn->setQmlBaseNode(bqcn);
else {
@@ -1424,10 +1440,18 @@ void QDocDatabase::generateTagFile(const QString& name, Generator* g)
}
/*!
- Reads and parses the qdoc index files listed in \a indexFiles.
+ Reads and parses the qdoc index files listed in \a t.
*/
-void QDocDatabase::readIndexes(const QStringList& indexFiles)
+void QDocDatabase::readIndexes(const QStringList& t)
{
+ QStringList indexFiles;
+ foreach (const QString& f, t) {
+ QString fn = f.mid(f.lastIndexOf(QChar('/'))+1);
+ if (!isLoaded(fn))
+ indexFiles << f;
+ else
+ qDebug() << "This index file is already in memory:" << f;
+ }
QDocIndexFiles::qdocIndexFiles()->readIndexes(indexFiles);
QDocIndexFiles::destroyQDocIndexFiles();
}
@@ -1443,6 +1467,8 @@ void QDocDatabase::generateIndex(const QString& fileName,
Generator* g,
bool generateInternalNodes)
{
+ QString t = fileName.mid(fileName.lastIndexOf(QChar('/'))+1);
+ primaryTree()->setIndexFileName(t);
QDocIndexFiles::qdocIndexFiles()->generateIndex(fileName, url, title, g, generateInternalNodes);
QDocIndexFiles::destroyQDocIndexFiles();
}
@@ -1507,20 +1533,30 @@ Node* QDocDatabase::findNodeInOpenNamespace(QStringList& path, Node::Type type)
}
/*!
- Finds all the collection nodes of type \a nt into the
- collection node map \a cnn. Nodes that match \a relative
- are not included.
+ Finds all the collection nodes of the specified \a genus
+ into the collection node map \a cnm. Nodes that match the
+ \a relative node are not included.
*/
-void QDocDatabase::mergeCollections(Node::Type nt, CNMap& cnm, const Node* relative)
+void QDocDatabase::mergeCollections(Node::Genus genus, CNMap& cnm, const Node* relative)
{
- QRegExp singleDigit("\\b([0-9])\\b");
- CNMultiMap cnmm;
- forest_.mergeCollectionMaps(nt, cnmm);
cnm.clear();
+ CNMultiMap cnmm;
+ foreach (Tree* t, searchOrder()) {
+ CNMap* m = t->getCollectionMap(genus);
+ if (m && !m->isEmpty()) {
+ CNMap::const_iterator i = m->begin();
+ while (i != m->end()) {
+ if (!i.value()->isInternal())
+ cnmm.insert(i.key(), i.value());
+ ++i;
+ }
+ }
+ }
if (cnmm.isEmpty())
return;
+ QRegExp singleDigit("\\b([0-9])\\b");
QStringList keys = cnmm.uniqueKeys();
- foreach (QString key, keys) {
+ foreach (const QString &key, keys) {
QList<CollectionNode*> values = cnmm.values(key);
CollectionNode* n = 0;
foreach (CollectionNode* v, values) {
@@ -1551,19 +1587,16 @@ void QDocDatabase::mergeCollections(Node::Type nt, CNMap& cnm, const Node* relat
/*!
Finds all the collection nodes with the same name
- and type as \a cn and merges their members into the
- members list of \a cn.
+ and genus as \a c and merges their members into the
+ members list of \a c.
*/
-void QDocDatabase::mergeCollections(CollectionNode* cn)
+void QDocDatabase::mergeCollections(CollectionNode* c)
{
- CollectionList cl;
- forest_.getCorrespondingCollections(cn, cl);
- if (!cl.empty()) {
- foreach (CollectionNode* v, cl) {
- if (v != cn) {
- foreach (Node* t, v->members())
- cn->addMember(t);
- }
+ foreach (Tree* t, searchOrder()) {
+ CollectionNode* cn = t->getCollection(c->name(), c->genus());
+ if (cn && cn != c) {
+ foreach (Node* n, cn->members())
+ c->addMember(n);
}
}
}
@@ -1577,10 +1610,11 @@ void QDocDatabase::mergeCollections(CollectionNode* cn)
\a ref. If the returned node pointer is null, \a ref is not
valid.
*/
-const Node* QDocDatabase::findNodeForAtom(const Atom* atom, const Node* relative, QString& ref)
+const Node* QDocDatabase::findNodeForAtom(const Atom* a, const Node* relative, QString& ref)
{
const Node* node = 0;
+ Atom* atom = const_cast<Atom*>(a);
QStringList targetPath = atom->string().split("#");
QString first = targetPath.first().trimmed();
@@ -1612,7 +1646,7 @@ const Node* QDocDatabase::findNodeForAtom(const Atom* atom, const Node* relative
target = targetPath.at(0);
targetPath.removeFirst();
}
- if (relative && relative->tree()->moduleName() != domain->moduleName())
+ if (relative && relative->tree()->physicalModuleName() != domain->physicalModuleName())
relative = 0;
node = domain->findNodeForTarget(nodePath, target, relative, flags, genus, ref);
return node;
diff --git a/src/tools/qdoc/qdocdatabase.h b/src/tools/qdoc/qdocdatabase.h
index 8b67aca971..70307aa3ae 100644
--- a/src/tools/qdoc/qdocdatabase.h
+++ b/src/tools/qdoc/qdocdatabase.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
@@ -73,12 +73,22 @@ class QDocForest
Tree* nextTree();
Tree* primaryTree() { return primaryTree_; }
Tree* findTree(const QString& t) { return forest_.value(t); }
+ QStringList keys() {
+ return forest_.keys();
+ }
NamespaceNode* primaryTreeRoot() { return (primaryTree_ ? primaryTree_->root() : 0); }
bool isEmpty() { return searchOrder().isEmpty(); }
bool done() { return (currentIndex_ >= searchOrder().size()); }
const QVector<Tree*>& searchOrder();
const QVector<Tree*>& indexSearchOrder();
- void setSearchOrder();
+ void setSearchOrder(QStringList& t);
+ bool isLoaded(const QString& fn) {
+ foreach (Tree* t, searchOrder()) {
+ if (fn == t->indexFileName())
+ return true;
+ }
+ return false;
+ }
const Node* findNode(const QStringList& path,
const Node* relative,
@@ -157,37 +167,37 @@ class QDocForest
return 0;
}
- const DocNode* findDocNodeByTitle(const QString& title)
+ const DocumentNode* findDocumentNodeByTitle(const QString& title)
{
foreach (Tree* t, searchOrder()) {
- const DocNode* n = t->findDocNodeByTitle(title);
+ const DocumentNode* n = t->findDocumentNodeByTitle(title);
if (n)
return n;
}
return 0;
}
- QmlClassNode* lookupQmlType(const QString& name)
+ QmlTypeNode* lookupQmlType(const QString& name)
{
foreach (Tree* t, searchOrder()) {
- QmlClassNode* qcn = t->lookupQmlType(name);
+ QmlTypeNode* qcn = t->lookupQmlType(name);
if (qcn)
return qcn;
}
return 0;
}
- void mergeCollectionMaps(Node::Type nt, CNMultiMap& cnmm);
- void getCorrespondingCollections(CollectionNode* cn, CollectionList& cl)
+ void clearSearchOrder() { searchOrder_.clear(); }
+ void clearLinkCounts()
{
- foreach (Tree* t, searchOrder()) {
- CollectionNode* ccn = t->getCorrespondingCollection(cn);
- if (ccn)
- cl.append(ccn);
- }
+ foreach (Tree* t, searchOrder())
+ t->clearLinkCount();
}
+ void printLinkCounts(const QString& project);
+ QString getLinkCounts(QStringList& strings, QVector<int>& counts);
private:
void newPrimaryTree(const QString& module);
+ void setPrimaryTree(const QString& t);
NamespaceNode* newIndexTree(const QString& module);
private:
@@ -210,34 +220,44 @@ class QDocDatabase
~QDocDatabase();
Tree* findTree(const QString& t) { return forest_.findTree(t); }
+
+ CollectionNode* getCollection(const QString& name, Node::Genus genus) {
+ return primaryTree()->getCollection(name, genus);
+ }
const CNMap& groups() { return primaryTree()->groups(); }
const CNMap& modules() { return primaryTree()->modules(); }
const CNMap& qmlModules() { return primaryTree()->qmlModules(); }
+ const CNMap& jsModules() { return primaryTree()->jsModules(); }
- GroupNode* getGroup(const QString& name) { return primaryTree()->getGroup(name); }
- GroupNode* findGroup(const QString& name) { return primaryTree()->findGroup(name); }
- ModuleNode* findModule(const QString& name) { return primaryTree()->findModule(name); }
- QmlModuleNode* findQmlModule(const QString& name) { return primaryTree()->findQmlModule(name); }
+ CollectionNode* findGroup(const QString& name) { return primaryTree()->findGroup(name); }
+ CollectionNode* findModule(const QString& name) { return primaryTree()->findModule(name); }
+ CollectionNode* findQmlModule(const QString& name) { return primaryTree()->findQmlModule(name); }
+ CollectionNode* findJsModule(const QString& name) { return primaryTree()->findJsModule(name); }
- GroupNode* addGroup(const QString& name) { return primaryTree()->addGroup(name); }
- ModuleNode* addModule(const QString& name) { return primaryTree()->addModule(name); }
- QmlModuleNode* addQmlModule(const QString& name) { return primaryTree()->addQmlModule(name); }
+ CollectionNode* addGroup(const QString& name) { return primaryTree()->addGroup(name); }
+ CollectionNode* addModule(const QString& name) { return primaryTree()->addModule(name); }
+ CollectionNode* addQmlModule(const QString& name) { return primaryTree()->addQmlModule(name); }
+ CollectionNode* addJsModule(const QString& name) { return primaryTree()->addJsModule(name); }
- GroupNode* addToGroup(const QString& name, Node* node) {
+ CollectionNode* addToGroup(const QString& name, Node* node) {
return primaryTree()->addToGroup(name, node);
}
- ModuleNode* addToModule(const QString& name, Node* node) {
+ CollectionNode* addToModule(const QString& name, Node* node) {
return primaryTree()->addToModule(name, node);
}
- QmlModuleNode* addToQmlModule(const QString& name, Node* node) {
+ CollectionNode* addToQmlModule(const QString& name, Node* node) {
return primaryTree()->addToQmlModule(name, node);
}
+ CollectionNode* addToJsModule(const QString& name, Node* node) {
+ return primaryTree()->addToJsModule(name, node);
+ }
+
void addExampleNode(ExampleNode* n) { primaryTree()->addExampleNode(n); }
ExampleNodeMap& exampleNodeMap() { return primaryTree()->exampleNodeMap(); }
- QmlClassNode* findQmlType(const QString& name);
- QmlClassNode* findQmlType(const QString& qmid, const QString& name);
- QmlClassNode* findQmlType(const ImportRec& import, const QString& name);
+ QmlTypeNode* findQmlType(const QString& name);
+ QmlTypeNode* findQmlType(const QString& qmid, const QString& name);
+ QmlTypeNode* findQmlType(const ImportRec& import, const QString& name);
private:
void findAllClasses(InnerNode *node);
@@ -274,12 +294,10 @@ class QDocDatabase
void resolveInheritance() { primaryTree()->resolveInheritance(); }
void resolveQmlInheritance(InnerNode* root);
void resolveIssues();
+ void resolveStuff();
void fixInheritance() { primaryTree()->fixInheritance(); }
void resolveProperties() { primaryTree()->resolveProperties(); }
- void resolveTargets() {
- primaryTree()->resolveTargets(primaryTreeRoot());
- }
void insertTarget(const QString& name,
const QString& title,
TargetRec::Type type,
@@ -318,8 +336,8 @@ class QDocDatabase
}
const Node* findTypeNode(const QString& type, const Node* relative);
const Node* findNodeForTarget(const QString& target, const Node* relative);
- const DocNode* findDocNodeByTitle(const QString& title) {
- return forest_.findDocNodeByTitle(title);
+ const DocumentNode* findDocumentNodeByTitle(const QString& title) {
+ return forest_.findDocumentNodeByTitle(title);
}
Node* findNodeByNameAndType(const QStringList& path, Node::Type type) {
return forest_.findNodeByNameAndType(path, type);
@@ -355,18 +373,40 @@ class QDocDatabase
void clearOpenNamespaces() { openNamespaces_.clear(); }
void insertOpenNamespace(const QString& path) { openNamespaces_.insert(path); }
void setShowInternal(bool value) { showInternal_ = value; }
+ void setSingleExec(bool value) { singleExec_ = value; }
+ void processForest();
// Try to make this function private.
QDocForest& forest() { return forest_; }
NamespaceNode* primaryTreeRoot() { return forest_.primaryTreeRoot(); }
void newPrimaryTree(const QString& module) { forest_.newPrimaryTree(module); }
+ void setPrimaryTree(const QString& t) { forest_.setPrimaryTree(t); }
NamespaceNode* newIndexTree(const QString& module) { return forest_.newIndexTree(module); }
const QVector<Tree*>& searchOrder() { return forest_.searchOrder(); }
void setLocalSearch() { forest_.searchOrder_ = QVector<Tree*>(1, primaryTree()); }
void setSearchOrder(const QVector<Tree*>& searchOrder) { forest_.searchOrder_ = searchOrder; }
- void setSearchOrder() { forest_.setSearchOrder(); }
- void mergeCollections(Node::Type nt, CNMap& cnm, const Node* relative);
- void mergeCollections(CollectionNode* cn);
+ void setSearchOrder(QStringList& t) { forest_.setSearchOrder(t); }
+ void mergeCollections(Node::Genus genus, CNMap& cnm, const Node* relative);
+ void mergeCollections(CollectionNode* c);
+ void clearSearchOrder() { forest_.clearSearchOrder(); }
+ void incrementLinkCount(const Node* t) { t->tree()->incrementLinkCount(); }
+ void clearLinkCounts() { forest_.clearLinkCounts(); }
+ void printLinkCounts(const QString& t) { forest_.printLinkCounts(t); }
+ QString getLinkCounts(QStringList& strings, QVector<int>& counts) {
+ return forest_.getLinkCounts(strings, counts);
+ }
+ QString getNewLinkTarget(const Node* locNode,
+ const Node* t,
+ const QString& fileName,
+ QString& text,
+ bool broken = false) {
+ return primaryTree()->getNewLinkTarget(locNode, t, fileName, text, broken);
+ }
+ TargetList* getTargetList(const QString& t) { return primaryTree()->getTargetList(t); }
+ QStringList getTargetListKeys() { return primaryTree()->getTargetListKeys(); }
+ QStringList keys() {
+ return forest_.keys();
+ }
private:
friend class QDocIndexFiles;
@@ -379,6 +419,7 @@ class QDocDatabase
return forest_.findNode(path, relative, findFlags, genus);
}
void processForest(void (QDocDatabase::*) (InnerNode*));
+ bool isLoaded(const QString& t) { return forest_.isLoaded(t); }
static void initializeDB();
private:
@@ -394,20 +435,21 @@ class QDocDatabase
static QDocDatabase* qdocDB_;
static NodeMap typeNodeMap_;
bool showInternal_;
+ bool singleExec_;
QString version_;
QDocForest forest_;
- NodeMap nonCompatClasses_;
- NodeMap mainClasses_;
+ NodeMap cppClasses_;
+ NodeMap mainClasses_; // MWS: not needed, should be delete
NodeMap compatClasses_;
NodeMap obsoleteClasses_;
NodeMap classesWithObsoleteMembers_;
NodeMap obsoleteQmlTypes_;
NodeMap qmlTypesWithObsoleteMembers_;
NodeMap namespaceIndex_;
- NodeMap serviceClasses_;
+ NodeMap serviceClasses_; // MWS: not needed, should be deleted
NodeMap qmlBasicTypes_;
- NodeMap qmlClasses_;
+ NodeMap qmlTypes_;
NodeMapMap newClassMaps_;
NodeMapMap newQmlTypeMaps_;
NodeMultiMapMap newSinceMaps_;
diff --git a/src/tools/qdoc/qdocindexfiles.cpp b/src/tools/qdoc/qdocindexfiles.cpp
index 00041b2b65..026c64b587 100644
--- a/src/tools/qdoc/qdocindexfiles.cpp
+++ b/src/tools/qdoc/qdocindexfiles.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
@@ -208,11 +208,11 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element,
node->setAbstract(abstract);
}
else if (element.nodeName() == "qmlclass") {
- QmlClassNode* qcn = new QmlClassNode(parent, name);
+ QmlTypeNode* qcn = new QmlTypeNode(parent, name);
qcn->setTitle(element.attribute("title"));
- QString qmlModuleName = element.attribute("qml-module-name");
- if (!qmlModuleName.isEmpty())
- qdb_->addToQmlModule(qmlModuleName, qcn);
+ QString logicalModuleName = element.attribute("qml-module-name");
+ if (!logicalModuleName.isEmpty())
+ qdb_->addToQmlModule(logicalModuleName, qcn);
bool abstract = false;
if (element.attribute("abstract") == "true")
abstract = true;
@@ -229,6 +229,29 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element,
location = Location(name);
node = qcn;
}
+ else if (element.nodeName() == "jstype") {
+ QmlTypeNode* qcn = new QmlTypeNode(parent, name);
+ qcn->setGenus(Node::JS);
+ qcn->setTitle(element.attribute("title"));
+ QString logicalModuleName = element.attribute("js-module-name");
+ if (!logicalModuleName.isEmpty())
+ qdb_->addToQmlModule(logicalModuleName, qcn);
+ bool abstract = false;
+ if (element.attribute("abstract") == "true")
+ abstract = true;
+ qcn->setAbstract(abstract);
+ QString qmlFullBaseName = element.attribute("js-base-type");
+ if (!qmlFullBaseName.isEmpty()) {
+ qcn->setQmlBaseName(qmlFullBaseName);
+ }
+ if (element.hasAttribute("location"))
+ name = element.attribute("location", QString());
+ if (!indexUrl.isEmpty())
+ location = Location(indexUrl + QLatin1Char('/') + name);
+ else if (!indexUrl.isNull())
+ location = Location(name);
+ node = qcn;
+ }
else if (element.nodeName() == "qmlbasictype") {
QmlBasicTypeNode* qbtn = new QmlBasicTypeNode(parent, name);
qbtn->setTitle(element.attribute("title"));
@@ -240,9 +263,33 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element,
location = Location(name);
node = qbtn;
}
+ else if (element.nodeName() == "jsbasictype") {
+ QmlBasicTypeNode* qbtn = new QmlBasicTypeNode(parent, name);
+ qbtn->setGenus(Node::JS);
+ qbtn->setTitle(element.attribute("title"));
+ if (element.hasAttribute("location"))
+ name = element.attribute("location", QString());
+ if (!indexUrl.isEmpty())
+ location = Location(indexUrl + QLatin1Char('/') + name);
+ else if (!indexUrl.isNull())
+ location = Location(name);
+ node = qbtn;
+ }
else if (element.nodeName() == "qmlpropertygroup") {
- QmlClassNode* qcn = static_cast<QmlClassNode*>(parent);
+ QmlTypeNode* qcn = static_cast<QmlTypeNode*>(parent);
+ QmlPropertyGroupNode* qpgn = new QmlPropertyGroupNode(qcn, name);
+ if (element.hasAttribute("location"))
+ name = element.attribute("location", QString());
+ if (!indexUrl.isEmpty())
+ location = Location(indexUrl + QLatin1Char('/') + name);
+ else if (!indexUrl.isNull())
+ location = Location(name);
+ node = qpgn;
+ }
+ else if (element.nodeName() == "jspropertygroup") {
+ QmlTypeNode* qcn = static_cast<QmlTypeNode*>(parent);
QmlPropertyGroupNode* qpgn = new QmlPropertyGroupNode(qcn, name);
+ qpgn->setGenus(Node::JS);
if (element.hasAttribute("location"))
name = element.attribute("location", QString());
if (!indexUrl.isEmpty())
@@ -261,7 +308,7 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element,
readonly = true;
QmlPropertyNode* qpn = 0;
if (parent->isQmlType()) {
- QmlClassNode* qcn = static_cast<QmlClassNode*>(parent);
+ QmlTypeNode* qcn = static_cast<QmlTypeNode*>(parent);
qpn = new QmlPropertyNode(qcn, name, type, attached);
}
else if (parent->isQmlPropertyGroup()) {
@@ -271,6 +318,27 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element,
qpn->setReadOnly(readonly);
node = qpn;
}
+ else if (element.nodeName() == "jsproperty") {
+ QString type = element.attribute("type");
+ bool attached = false;
+ if (element.attribute("attached") == "true")
+ attached = true;
+ bool readonly = false;
+ if (element.attribute("writable") == "false")
+ readonly = true;
+ QmlPropertyNode* qpn = 0;
+ if (parent->isJsType()) {
+ QmlTypeNode* qcn = static_cast<QmlTypeNode*>(parent);
+ qpn = new QmlPropertyNode(qcn, name, type, attached);
+ }
+ else if (parent->isJsPropertyGroup()) {
+ QmlPropertyGroupNode* qpgn = static_cast<QmlPropertyGroupNode*>(parent);
+ qpn = new QmlPropertyNode(qpgn, name, type, attached);
+ }
+ qpn->setGenus(Node::JS);
+ qpn->setReadOnly(readonly);
+ node = qpn;
+ }
else if ((element.nodeName() == "qmlmethod") ||
(element.nodeName() == "qmlsignal") ||
(element.nodeName() == "qmlsignalhandler")) {
@@ -283,30 +351,58 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element,
FunctionNode* fn = new FunctionNode(t, parent, name, attached);
node = fn;
}
+ else if ((element.nodeName() == "jsmethod") ||
+ (element.nodeName() == "jssignal") ||
+ (element.nodeName() == "jssignalhandler")) {
+ Node::Type t = Node::QmlMethod;
+ if (element.nodeName() == "jssignal")
+ t = Node::QmlSignal;
+ else if (element.nodeName() == "jssignalhandler")
+ t = Node::QmlSignalHandler;
+ bool attached = false;
+ FunctionNode* fn = new FunctionNode(t, parent, name, attached);
+ fn->setGenus(Node::JS);
+ node = fn;
+ }
else if (element.nodeName() == "group") {
- GroupNode* gn = qdb_->addGroup(name);
- gn->setTitle(element.attribute("title"));
- gn->setSubTitle(element.attribute("subtitle"));
+ CollectionNode* cn = qdb_->addGroup(name);
+ cn->setTitle(element.attribute("title"));
+ cn->setSubTitle(element.attribute("subtitle"));
if (element.attribute("seen") == "true")
- gn->markSeen();
- node = gn;
+ cn->markSeen();
+ node = cn;
}
else if (element.nodeName() == "module") {
- ModuleNode* mn = qdb_->addModule(name);
- mn->setTitle(element.attribute("title"));
- mn->setSubTitle(element.attribute("subtitle"));
+ CollectionNode* cn = qdb_->addModule(name);
+ cn->setTitle(element.attribute("title"));
+ cn->setSubTitle(element.attribute("subtitle"));
if (element.attribute("seen") == "true")
- mn->markSeen();
- node = mn;
+ cn->markSeen();
+ node = cn;
}
else if (element.nodeName() == "qmlmodule") {
- QString t = element.attribute("qml-module-name") + " " + element.attribute("qml-module-version");
- QmlModuleNode* qmn = qdb_->addQmlModule(t);
- qmn->setTitle(element.attribute("title"));
- qmn->setSubTitle(element.attribute("subtitle"));
+ QString t = element.attribute("qml-module-name");
+ CollectionNode* cn = qdb_->addQmlModule(t);
+ QStringList info;
+ info << t << element.attribute("qml-module-version");
+ cn->setLogicalModuleInfo(info);
+ cn->setTitle(element.attribute("title"));
+ cn->setSubTitle(element.attribute("subtitle"));
if (element.attribute("seen") == "true")
- qmn->markSeen();
- node = qmn;
+ cn->markSeen();
+ node = cn;
+ }
+ else if (element.nodeName() == "jsmodule") {
+ QString t = element.attribute("js-module-name");
+ CollectionNode* cn = qdb_->addJsModule(t);
+ QStringList info;
+ info << t << element.attribute("js-module-version");
+ cn->setLogicalModuleInfo(info);
+ cn->setTitle(element.attribute("title"));
+ cn->setSubTitle(element.attribute("subtitle"));
+ if (element.attribute("seen") == "true")
+ cn->markSeen();
+ node = cn;
}
else if (element.nodeName() == "page") {
Node::SubType subtype;
@@ -335,7 +431,7 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element,
else
return;
- DocNode* docNode = new DocNode(parent, name, subtype, ptype);
+ DocumentNode* docNode = new DocumentNode(parent, name, subtype, ptype);
docNode->setTitle(element.attribute("title"));
if (element.hasAttribute("location"))
@@ -492,7 +588,9 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element,
if ((element.nodeName() != "page") &&
(element.nodeName() != "qmlclass") &&
- (element.nodeName() != "qmlbasictype")) {
+ (element.nodeName() != "qmlbasictype") &&
+ (element.nodeName() != "jstype") &&
+ (element.nodeName() != "jsbasictype")) {
QString threadSafety = element.attribute("threadsafety");
if (threadSafety == "non-reentrant")
node->setThreadSafeness(Node::NonReentrant);
@@ -524,9 +622,9 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element,
else
node->setStatus(Node::Commendable);
- QString moduleName = element.attribute("module");
- if (!moduleName.isEmpty())
- qdb_->addToModule(moduleName, node);
+ QString physicalModuleName = element.attribute("module");
+ if (!physicalModuleName.isEmpty())
+ qdb_->addToModule(physicalModuleName, node);
if (!href.isEmpty()) {
if (node->isExternalPage())
node->setUrl(href);
@@ -542,7 +640,7 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element,
QString groupsAttr = element.attribute("groups");
if (!groupsAttr.isEmpty()) {
QStringList groupNames = groupsAttr.split(",");
- foreach (QString name, groupNames) {
+ foreach (const QString &name, groupNames) {
qdb_->addToGroup(name, node);
}
}
@@ -564,7 +662,6 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element,
node->setReconstitutedBrief(briefAttr);
}
- // zzz
bool useParent = (element.nodeName() == "namespace" && name.isEmpty());
if (element.hasChildNodes()) {
QDomElement child = element.firstChildElement();
@@ -635,8 +732,8 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer,
return false;
QString nodeName;
- QString qmlModuleName;
- QString qmlModuleVersion;
+ QString logicalModuleName;
+ QString logicalModuleVersion;
QString qmlFullBaseName;
switch (node->type()) {
case Node::Namespace:
@@ -647,15 +744,21 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer,
break;
case Node::QmlType:
{
- nodeName = "qmlclass";
- QmlModuleNode* qmn = node->qmlModule();
- if (qmn)
- qmlModuleName = qmn->qmlModuleName();
+ if (node->isQmlNode())
+ nodeName = "qmlclass";
+ else
+ nodeName = "jstype";
+ CollectionNode* cn = node->logicalModule();
+ if (cn)
+ logicalModuleName = cn->logicalModuleName();
qmlFullBaseName = node->qmlFullBaseName();
}
break;
case Node::QmlBasicType:
- nodeName = "qmlbasictype";
+ if (node->isQmlNode())
+ nodeName = "qmlbasictype";
+ else
+ nodeName = "jsbasictype";
break;
case Node::Document:
nodeName = "page";
@@ -667,7 +770,10 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer,
nodeName = "module";
break;
case Node::QmlModule:
- nodeName = "qmlmodule";
+ if (node->isQmlNode())
+ nodeName = "qmlmodule";
+ else
+ nodeName = "jsmodule";
break;
case Node::Enum:
nodeName = "enum";
@@ -685,19 +791,34 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer,
nodeName = "variable";
break;
case Node::QmlProperty:
- nodeName = "qmlproperty";
+ if (node->isQmlNode())
+ nodeName = "qmlproperty";
+ else
+ nodeName = "jsProperty";
break;
case Node::QmlPropertyGroup:
- nodeName = "qmlpropertygroup";
+ if (node->isQmlNode())
+ nodeName = "qmlpropertygroup";
+ else
+ nodeName = "jspropertygroup";
break;
case Node::QmlSignal:
- nodeName = "qmlsignal";
+ if (node->isQmlNode())
+ nodeName = "qmlsignal";
+ else
+ nodeName = "jssignal";
break;
case Node::QmlSignalHandler:
- nodeName = "qmlsignalhandler";
+ if (node->isQmlNode())
+ nodeName = "qmlsignalhandler";
+ else
+ nodeName = "jssignalhandler";
break;
case Node::QmlMethod:
- nodeName = "qmlmethod";
+ if (node->isQmlNode())
+ nodeName = "qmlmethod";
+ else
+ nodeName = "jsmethod";
break;
default:
return false;
@@ -712,16 +833,6 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer,
access = "protected";
break;
case Node::Private:
-#if 0
- // Do not include private non-internal nodes in the index.
- // (Internal public and protected nodes are marked as private
- // by qdoc. We can check their internal status to determine
- // whether they were really private to begin with.)
- if (node->status() == Node::Internal && generateInternalNodes)
- access = "internal";
- else
- return false;
-#endif
{
access = "private";
bool b = generateInternalNodes;
@@ -742,7 +853,7 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer,
QXmlStreamAttributes attributes;
- if (!node->isDocNode() && !node->isGroup() && !node->isModule() && !node->isQmlModule()) {
+ if (!node->isDocumentNode() && !node->isCollectionNode()) {
QString threadSafety;
switch (node->threadSafeness()) {
case Node::NonReentrant:
@@ -790,15 +901,26 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer,
writer.writeAttribute("name", objName);
if (node->isQmlModule()) {
- qmlModuleName = node->qmlModuleName();
- qmlModuleVersion = node->qmlModuleVersion();
+ logicalModuleName = node->logicalModuleName();
+ logicalModuleVersion = node->logicalModuleVersion();
+ if (!logicalModuleName.isEmpty()) {
+ writer.writeAttribute("qml-module-name", logicalModuleName);
+ if (node->isQmlModule())
+ writer.writeAttribute("qml-module-version", logicalModuleVersion);
+ if (!qmlFullBaseName.isEmpty())
+ writer.writeAttribute("qml-base-type", qmlFullBaseName);
+ }
}
- if (!qmlModuleName.isEmpty()) {
- writer.writeAttribute("qml-module-name", qmlModuleName);
- if (node->isQmlModule())
- writer.writeAttribute("qml-module-version", qmlModuleVersion);
- if (!qmlFullBaseName.isEmpty())
- writer.writeAttribute("qml-base-type", qmlFullBaseName);
+ else if (node->isJsModule()) {
+ logicalModuleName = node->logicalModuleName();
+ logicalModuleVersion = node->logicalModuleVersion();
+ if (!logicalModuleName.isEmpty()) {
+ writer.writeAttribute("js-module-name", logicalModuleName);
+ if (node->isQmlModule())
+ writer.writeAttribute("js-module-version", logicalModuleVersion);
+ if (!qmlFullBaseName.isEmpty())
+ writer.writeAttribute("js-base-type", qmlFullBaseName);
+ }
}
QString href;
@@ -806,20 +928,23 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer,
QString fullName = node->fullDocumentName();
if (fullName != objName)
writer.writeAttribute("fullname", fullName);
+#if 0
if (Generator::useOutputSubdirs())
href = node->outputSubdirectory();
if (!href.isEmpty())
href.append(QLatin1Char('/'));
href.append(gen_->fullDocumentLocation(node));
+#endif
+ href = gen_->fullDocumentLocation(node);
}
else
href = node->name();
- if (node->isQmlNode()) {
+ if (node->isQmlNode() || node->isJsNode()) {
InnerNode* p = node->parent();
if (p) {
- if (p->isQmlPropertyGroup())
+ if (p->isQmlPropertyGroup() || p->isJsPropertyGroup())
p = p->parent();
- if (p && p->isQmlType() && p->isAbstract())
+ if (p && (p->isQmlType() || p->isJsType()) && p->isAbstract())
href.clear();
}
}
@@ -827,7 +952,7 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer,
writer.writeAttribute("href", href);
writer.writeAttribute("status", status);
- if (!node->isDocNode() && !node->isGroup() && !node->isModule() && !node->isQmlModule()) {
+ if (!node->isDocumentNode() && !node->isCollectionNode()) {
writer.writeAttribute("access", access);
if (node->isAbstract())
writer.writeAttribute("abstract", "true");
@@ -858,8 +983,8 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer,
}
if (!baseStrings.isEmpty())
writer.writeAttribute("bases", QStringList(baseStrings.toList()).join(","));
- if (!node->moduleName().isEmpty())
- writer.writeAttribute("module", node->moduleName());
+ if (!node->physicalModuleName().isEmpty())
+ writer.writeAttribute("module", node->physicalModuleName());
if (!classNode->groupNames().isEmpty())
writer.writeAttribute("groups", classNode->groupNames().join(","));
if (!brief.isEmpty())
@@ -869,8 +994,8 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer,
case Node::Namespace:
{
const NamespaceNode* namespaceNode = static_cast<const NamespaceNode*>(node);
- if (!namespaceNode->moduleName().isEmpty())
- writer.writeAttribute("module", namespaceNode->moduleName());
+ if (!namespaceNode->physicalModuleName().isEmpty())
+ writer.writeAttribute("module", namespaceNode->physicalModuleName());
if (!namespaceNode->groupNames().isEmpty())
writer.writeAttribute("groups", namespaceNode->groupNames().join(","));
if (!brief.isEmpty())
@@ -879,7 +1004,7 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer,
break;
case Node::QmlType:
{
- const QmlClassNode* qcn = static_cast<const QmlClassNode*>(node);
+ const QmlTypeNode* qcn = static_cast<const QmlTypeNode*>(node);
writer.writeAttribute("title", qcn->title());
writer.writeAttribute("fulltitle", qcn->fullTitle());
writer.writeAttribute("subtitle", qcn->subTitle());
@@ -896,7 +1021,7 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer,
a title, and other attributes.
*/
bool writeModuleName = false;
- const DocNode* docNode = static_cast<const DocNode*>(node);
+ const DocumentNode* docNode = static_cast<const DocumentNode*>(node);
switch (docNode->subType()) {
case Node::Example:
writer.writeAttribute("subtype", "example");
@@ -922,8 +1047,8 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer,
writer.writeAttribute("title", docNode->title());
writer.writeAttribute("fulltitle", docNode->fullTitle());
writer.writeAttribute("subtitle", docNode->subTitle());
- if (!node->moduleName().isEmpty() && writeModuleName) {
- writer.writeAttribute("module", node->moduleName());
+ if (!node->physicalModuleName().isEmpty() && writeModuleName) {
+ writer.writeAttribute("module", node->physicalModuleName());
}
if (!docNode->groupNames().isEmpty())
writer.writeAttribute("groups", docNode->groupNames().join(","));
@@ -933,22 +1058,22 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer,
break;
case Node::Group:
{
- const GroupNode* gn = static_cast<const GroupNode*>(node);
- writer.writeAttribute("seen", gn->wasSeen() ? "true" : "false");
- writer.writeAttribute("title", gn->title());
- if (!gn->subTitle().isEmpty())
- writer.writeAttribute("subtitle", gn->subTitle());
- if (!gn->moduleName().isEmpty())
- writer.writeAttribute("module", gn->moduleName());
- if (!gn->groupNames().isEmpty())
- writer.writeAttribute("groups", gn->groupNames().join(","));
+ const CollectionNode* cn = static_cast<const CollectionNode*>(node);
+ writer.writeAttribute("seen", cn->wasSeen() ? "true" : "false");
+ writer.writeAttribute("title", cn->title());
+ if (!cn->subTitle().isEmpty())
+ writer.writeAttribute("subtitle", cn->subTitle());
+ if (!cn->physicalModuleName().isEmpty())
+ writer.writeAttribute("module", cn->physicalModuleName());
+ if (!cn->groupNames().isEmpty())
+ writer.writeAttribute("groups", cn->groupNames().join(","));
/*
This is not read back in, so it probably
shouldn't be written out in the first place.
*/
- if (!gn->members().isEmpty()) {
+ if (!cn->members().isEmpty()) {
QStringList names;
- foreach (const Node* member, gn->members())
+ foreach (const Node* member, cn->members())
names.append(member->name());
writer.writeAttribute("members", names.join(","));
}
@@ -958,22 +1083,22 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer,
break;
case Node::Module:
{
- const ModuleNode* mn = static_cast<const ModuleNode*>(node);
- writer.writeAttribute("seen", mn->wasSeen() ? "true" : "false");
- writer.writeAttribute("title", mn->title());
- if (!mn->subTitle().isEmpty())
- writer.writeAttribute("subtitle", mn->subTitle());
- if (!mn->moduleName().isEmpty())
- writer.writeAttribute("module", mn->moduleName());
- if (!mn->groupNames().isEmpty())
- writer.writeAttribute("groups", mn->groupNames().join(","));
+ const CollectionNode* cn = static_cast<const CollectionNode*>(node);
+ writer.writeAttribute("seen", cn->wasSeen() ? "true" : "false");
+ writer.writeAttribute("title", cn->title());
+ if (!cn->subTitle().isEmpty())
+ writer.writeAttribute("subtitle", cn->subTitle());
+ if (!cn->physicalModuleName().isEmpty())
+ writer.writeAttribute("module", cn->physicalModuleName());
+ if (!cn->groupNames().isEmpty())
+ writer.writeAttribute("groups", cn->groupNames().join(","));
/*
This is not read back in, so it probably
shouldn't be written out in the first place.
*/
- if (!mn->members().isEmpty()) {
+ if (!cn->members().isEmpty()) {
QStringList names;
- foreach (const Node* member, mn->members())
+ foreach (const Node* member, cn->members())
names.append(member->name());
writer.writeAttribute("members", names.join(","));
}
@@ -983,22 +1108,22 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer,
break;
case Node::QmlModule:
{
- const QmlModuleNode* qmn = static_cast<const QmlModuleNode*>(node);
- writer.writeAttribute("seen", qmn->wasSeen() ? "true" : "false");
- writer.writeAttribute("title", qmn->title());
- if (!qmn->subTitle().isEmpty())
- writer.writeAttribute("subtitle", qmn->subTitle());
- if (!qmn->moduleName().isEmpty())
- writer.writeAttribute("module", qmn->moduleName());
- if (!qmn->groupNames().isEmpty())
- writer.writeAttribute("groups", qmn->groupNames().join(","));
+ const CollectionNode* cn = static_cast<const CollectionNode*>(node);
+ writer.writeAttribute("seen", cn->wasSeen() ? "true" : "false");
+ writer.writeAttribute("title", cn->title());
+ if (!cn->subTitle().isEmpty())
+ writer.writeAttribute("subtitle", cn->subTitle());
+ if (!cn->physicalModuleName().isEmpty())
+ writer.writeAttribute("module", cn->physicalModuleName());
+ if (!cn->groupNames().isEmpty())
+ writer.writeAttribute("groups", cn->groupNames().join(","));
/*
This is not read back in, so it probably
shouldn't be written out in the first place.
*/
- if (!qmn->members().isEmpty()) {
+ if (!cn->members().isEmpty()) {
QStringList names;
- foreach (const Node* member, qmn->members())
+ foreach (const Node* member, cn->members())
names.append(member->name());
writer.writeAttribute("members", names.join(","));
}
@@ -1193,7 +1318,7 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer,
if (node->doc().hasTargets()) {
bool external = false;
if (node->type() == Node::Document) {
- const DocNode* docNode = static_cast<const DocNode*>(node);
+ const DocumentNode* docNode = static_cast<const DocumentNode*>(node);
if (docNode->subType() == Node::ExternalPage)
external = true;
}
@@ -1293,9 +1418,17 @@ bool compareNodes(const Node* n1, const Node* n2)
return false;
}
- if (n1->isDocNode() && n2->isDocNode()) {
- const DocNode* f1 = static_cast<const DocNode*>(n1);
- const DocNode* f2 = static_cast<const DocNode*>(n2);
+ if (n1->isDocumentNode() && n2->isDocumentNode()) {
+ const DocumentNode* f1 = static_cast<const DocumentNode*>(n1);
+ const DocumentNode* f2 = static_cast<const DocumentNode*>(n2);
+ if (f1->fullTitle() < f2->fullTitle())
+ return true;
+ else if (f1->fullTitle() > f2->fullTitle())
+ return false;
+ }
+ else if (n1->isCollectionNode() && n2->isCollectionNode()) {
+ const CollectionNode* f1 = static_cast<const CollectionNode*>(n1);
+ const CollectionNode* f2 = static_cast<const CollectionNode*>(n2);
if (f1->fullTitle() < f2->fullTitle())
return true;
else if (f1->fullTitle() > f2->fullTitle())
@@ -1319,7 +1452,7 @@ void QDocIndexFiles::generateIndexSections(QXmlStreamWriter& writer,
Note that groups, modules, and QML modules are written
after all the other nodes.
*/
- if (node->isGroup() || node->isModule() || node->isQmlModule())
+ if (node->isGroup() || node->isModule() || node->isQmlModule() || node->isJsModule())
return;
if (generateIndexSection(writer, node, generateInternalNodes)) {
@@ -1372,6 +1505,16 @@ void QDocIndexFiles::generateIndexSections(QXmlStreamWriter& writer,
++g;
}
}
+
+ const CNMap& jsModules = qdb_->jsModules();
+ if (!jsModules.isEmpty()) {
+ CNMap::ConstIterator g = jsModules.constBegin();
+ while (g != jsModules.constEnd()) {
+ if (generateIndexSection(writer, g.value(), generateInternalNodes))
+ writer.writeEndElement();
+ ++g;
+ }
+ }
}
writer.writeEndElement();
diff --git a/src/tools/qdoc/qdocindexfiles.h b/src/tools/qdoc/qdocindexfiles.h
index e9e08eef7e..9a18639251 100644
--- a/src/tools/qdoc/qdocindexfiles.h
+++ b/src/tools/qdoc/qdocindexfiles.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
diff --git a/src/tools/qdoc/qdoctagfiles.cpp b/src/tools/qdoc/qdoctagfiles.cpp
index 6a67d41534..778df33048 100644
--- a/src/tools/qdoc/qdoctagfiles.cpp
+++ b/src/tools/qdoc/qdoctagfiles.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
@@ -149,7 +149,7 @@ void QDocTagFiles::generateTagFileCompounds(QXmlStreamWriter& writer, const Inne
if (node->type() == Node::Class) {
writer.writeTextElement("name", node->fullDocumentName());
- writer.writeTextElement("filename", gen_->fullDocumentLocation(node,Generator::useOutputSubdirs()));
+ writer.writeTextElement("filename", gen_->fullDocumentLocation(node, false));
// Classes contain information about their base classes.
const ClassNode* classNode = static_cast<const ClassNode*>(node);
@@ -169,7 +169,7 @@ void QDocTagFiles::generateTagFileCompounds(QXmlStreamWriter& writer, const Inne
}
else {
writer.writeTextElement("name", node->fullDocumentName());
- writer.writeTextElement("filename", gen_->fullDocumentLocation(node,Generator::useOutputSubdirs()));
+ writer.writeTextElement("filename", gen_->fullDocumentLocation(node, false));
// Recurse to write all members.
generateTagFileMembers(writer, static_cast<const InnerNode*>(node));
@@ -285,7 +285,7 @@ void QDocTagFiles::generateTagFileMembers(QXmlStreamWriter& writer, const InnerN
writer.writeTextElement("type", "virtual " + functionNode->returnType());
writer.writeTextElement("name", objName);
- QStringList pieces = gen_->fullDocumentLocation(node,Generator::useOutputSubdirs()).split(QLatin1Char('#'));
+ QStringList pieces = gen_->fullDocumentLocation(node, false).split(QLatin1Char('#'));
writer.writeTextElement("anchorfile", pieces[0]);
writer.writeTextElement("anchor", pieces[1]);
QString signature = functionNode->signature();
@@ -303,7 +303,7 @@ void QDocTagFiles::generateTagFileMembers(QXmlStreamWriter& writer, const InnerN
const PropertyNode* propertyNode = static_cast<const PropertyNode*>(node);
writer.writeAttribute("type", propertyNode->dataType());
writer.writeTextElement("name", objName);
- QStringList pieces = gen_->fullDocumentLocation(node,Generator::useOutputSubdirs()).split(QLatin1Char('#'));
+ QStringList pieces = gen_->fullDocumentLocation(node, false).split(QLatin1Char('#'));
writer.writeTextElement("anchorfile", pieces[0]);
writer.writeTextElement("anchor", pieces[1]);
writer.writeTextElement("arglist", QString());
@@ -314,7 +314,7 @@ void QDocTagFiles::generateTagFileMembers(QXmlStreamWriter& writer, const InnerN
{
const EnumNode* enumNode = static_cast<const EnumNode*>(node);
writer.writeTextElement("name", objName);
- QStringList pieces = gen_->fullDocumentLocation(node).split(QLatin1Char('#'));
+ QStringList pieces = gen_->fullDocumentLocation(node, false).split(QLatin1Char('#'));
writer.writeTextElement("anchor", pieces[1]);
writer.writeTextElement("arglist", QString());
writer.writeEndElement(); // member
@@ -337,7 +337,7 @@ void QDocTagFiles::generateTagFileMembers(QXmlStreamWriter& writer, const InnerN
else
writer.writeAttribute("type", QString());
writer.writeTextElement("name", objName);
- QStringList pieces = gen_->fullDocumentLocation(node,Generator::useOutputSubdirs()).split(QLatin1Char('#'));
+ QStringList pieces = gen_->fullDocumentLocation(node, false).split(QLatin1Char('#'));
writer.writeTextElement("anchorfile", pieces[0]);
writer.writeTextElement("anchor", pieces[1]);
writer.writeTextElement("arglist", QString());
@@ -358,8 +358,19 @@ void QDocTagFiles::generateTagFileMembers(QXmlStreamWriter& writer, const InnerN
void QDocTagFiles::generateTagFile(const QString& fileName, Generator* g)
{
QFile file(fileName);
- if (!file.open(QFile::WriteOnly | QFile::Text))
- return ;
+ QFileInfo fileInfo(fileName);
+
+ // If no path was specified or it doesn't exist,
+ // default to the output directory
+ if (fileInfo.fileName() == fileName || !fileInfo.dir().exists())
+ file.setFileName(gen_->outputDir() + QLatin1Char('/') +
+ fileInfo.fileName());
+
+ if (!file.open(QFile::WriteOnly | QFile::Text)) {
+ Location::null.warning(
+ QString("Failed to open %1 for writing.").arg(file.fileName()));
+ return;
+ }
gen_ = g;
QXmlStreamWriter writer(&file);
diff --git a/src/tools/qdoc/qdoctagfiles.h b/src/tools/qdoc/qdoctagfiles.h
index f91a3a7006..94d3450478 100644
--- a/src/tools/qdoc/qdoctagfiles.h
+++ b/src/tools/qdoc/qdoctagfiles.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
diff --git a/src/tools/qdoc/qmlcodemarker.cpp b/src/tools/qdoc/qmlcodemarker.cpp
index a5b5d0b43c..f8071c154e 100644
--- a/src/tools/qdoc/qmlcodemarker.cpp
+++ b/src/tools/qdoc/qmlcodemarker.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
diff --git a/src/tools/qdoc/qmlcodemarker.h b/src/tools/qdoc/qmlcodemarker.h
index c6e4aa7e19..805229e366 100644
--- a/src/tools/qdoc/qmlcodemarker.h
+++ b/src/tools/qdoc/qmlcodemarker.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
@@ -51,19 +51,19 @@ public:
QmlCodeMarker();
~QmlCodeMarker();
- virtual bool recognizeCode(const QString &code);
- virtual bool recognizeExtension(const QString &ext);
- virtual bool recognizeLanguage(const QString &language);
- virtual Atom::Type atomType() const;
+ virtual bool recognizeCode(const QString &code) Q_DECL_OVERRIDE;
+ virtual bool recognizeExtension(const QString &ext) Q_DECL_OVERRIDE;
+ virtual bool recognizeLanguage(const QString &language) Q_DECL_OVERRIDE;
+ virtual Atom::Type atomType() const Q_DECL_OVERRIDE;
virtual QString markedUpCode(const QString &code,
const Node *relative,
- const Location &location);
+ const Location &location) Q_DECL_OVERRIDE;
- virtual QString markedUpName(const Node *node);
- virtual QString markedUpFullName(const Node *node, const Node *relative);
- virtual QString markedUpIncludes(const QStringList &includes);
- virtual QString functionBeginRegExp(const QString &funcName);
- virtual QString functionEndRegExp(const QString &funcName);
+ virtual QString markedUpName(const Node *node) Q_DECL_OVERRIDE;
+ virtual QString markedUpFullName(const Node *node, const Node *relative) Q_DECL_OVERRIDE;
+ virtual QString markedUpIncludes(const QStringList &includes) Q_DECL_OVERRIDE;
+ virtual QString functionBeginRegExp(const QString &funcName) Q_DECL_OVERRIDE;
+ virtual QString functionEndRegExp(const QString &funcName) Q_DECL_OVERRIDE;
/* Copied from src/declarative/qml/qdeclarativescriptparser.cpp */
QList<QQmlJS::AST::SourceLocation> extractPragmas(QString &script);
diff --git a/src/tools/qdoc/qmlcodeparser.cpp b/src/tools/qdoc/qmlcodeparser.cpp
index 6e40deb9f7..4f5720a94d 100644
--- a/src/tools/qdoc/qmlcodeparser.cpp
+++ b/src/tools/qdoc/qmlcodeparser.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
@@ -76,6 +76,19 @@ QT_BEGIN_NAMESPACE
#define COMMAND_QMLBASICTYPE Doc::alias("qmlbasictype")
#define COMMAND_QMLMODULE Doc::alias("qmlmodule")
+#define COMMAND_JSTYPE Doc::alias("jstype")
+#define COMMAND_JSMODULE Doc::alias("jsmodule")
+#define COMMAND_JSPROPERTY Doc::alias("jsproperty")
+#define COMMAND_JSPROPERTYGROUP Doc::alias("jspropertygroup")
+#define COMMAND_JSATTACHEDPROPERTY Doc::alias("jsattachedproperty")
+#define COMMAND_INJSMODULE Doc::alias("injsmodule")
+#define COMMAND_JSSIGNAL Doc::alias("jssignal")
+#define COMMAND_JSATTACHEDSIGNAL Doc::alias("jsattachedsignal")
+#define COMMAND_JSMETHOD Doc::alias("jsmethod")
+#define COMMAND_JSATTACHEDMETHOD Doc::alias("jsattachedmethod")
+#define COMMAND_JSBASICTYPE Doc::alias("jsbasictype")
+#define COMMAND_JSMODULE Doc::alias("jsmodule")
+
/*!
Constructs the QML code parser.
*/
@@ -205,7 +218,16 @@ const QSet<QString>& QmlCodeParser::topicCommands()
<< COMMAND_QMLATTACHEDSIGNAL
<< COMMAND_QMLMETHOD
<< COMMAND_QMLATTACHEDMETHOD
- << COMMAND_QMLBASICTYPE;
+ << COMMAND_QMLBASICTYPE
+ << COMMAND_JSTYPE
+ << COMMAND_JSPROPERTY
+ << COMMAND_JSPROPERTYGROUP
+ << COMMAND_JSATTACHEDPROPERTY
+ << COMMAND_JSSIGNAL
+ << COMMAND_JSATTACHEDSIGNAL
+ << COMMAND_JSMETHOD
+ << COMMAND_JSATTACHEDMETHOD
+ << COMMAND_JSBASICTYPE;
}
return topicCommands_;
}
@@ -231,6 +253,7 @@ const QSet<QString>& QmlCodeParser::otherMetaCommands()
<< COMMAND_SINCE
<< COMMAND_QMLABSTRACT
<< COMMAND_INQMLMODULE
+ << COMMAND_INJSMODULE
<< COMMAND_WRAPPER;
}
return otherMetaCommands_;
diff --git a/src/tools/qdoc/qmlcodeparser.h b/src/tools/qdoc/qmlcodeparser.h
index cf60b1d7d7..da5d70568d 100644
--- a/src/tools/qdoc/qmlcodeparser.h
+++ b/src/tools/qdoc/qmlcodeparser.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
@@ -59,12 +59,12 @@ public:
QmlCodeParser();
virtual ~QmlCodeParser();
- virtual void initializeParser(const Config& config);
- virtual void terminateParser();
- virtual QString language();
- virtual QStringList sourceFileNameFilter();
- virtual void parseSourceFile(const Location& location, const QString& filePath);
- virtual void doneParsingSourceFiles();
+ virtual void initializeParser(const Config& config) Q_DECL_OVERRIDE;
+ virtual void terminateParser() Q_DECL_OVERRIDE;
+ virtual QString language() Q_DECL_OVERRIDE;
+ virtual QStringList sourceFileNameFilter() Q_DECL_OVERRIDE;
+ virtual void parseSourceFile(const Location& location, const QString& filePath) Q_DECL_OVERRIDE;
+ virtual void doneParsingSourceFiles() Q_DECL_OVERRIDE;
/* Copied from src/declarative/qml/qdeclarativescriptparser.cpp */
void extractPragmas(QString &script);
diff --git a/src/tools/qdoc/qmlmarkupvisitor.cpp b/src/tools/qdoc/qmlmarkupvisitor.cpp
index 44b6862e61..ee86b6de32 100644
--- a/src/tools/qdoc/qmlmarkupvisitor.cpp
+++ b/src/tools/qdoc/qmlmarkupvisitor.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
diff --git a/src/tools/qdoc/qmlmarkupvisitor.h b/src/tools/qdoc/qmlmarkupvisitor.h
index 09aa1f7400..04d6a57564 100644
--- a/src/tools/qdoc/qmlmarkupvisitor.h
+++ b/src/tools/qdoc/qmlmarkupvisitor.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
@@ -56,92 +56,92 @@ public:
QString markedUpCode();
- virtual bool visit(QQmlJS::AST::UiImport *);
- virtual void endVisit(QQmlJS::AST::UiImport *);
-
- virtual bool visit(QQmlJS::AST::UiPublicMember *);
- virtual bool visit(QQmlJS::AST::UiObjectDefinition *);
-
- virtual bool visit(QQmlJS::AST::UiObjectInitializer *);
- virtual void endVisit(QQmlJS::AST::UiObjectInitializer *);
-
- virtual bool visit(QQmlJS::AST::UiObjectBinding *);
- virtual bool visit(QQmlJS::AST::UiScriptBinding *);
- virtual bool visit(QQmlJS::AST::UiArrayBinding *);
- virtual bool visit(QQmlJS::AST::UiArrayMemberList *);
- virtual bool visit(QQmlJS::AST::UiQualifiedId *);
-
- virtual bool visit(QQmlJS::AST::ThisExpression *);
- virtual bool visit(QQmlJS::AST::IdentifierExpression *);
- virtual bool visit(QQmlJS::AST::NullExpression *);
- virtual bool visit(QQmlJS::AST::TrueLiteral *);
- virtual bool visit(QQmlJS::AST::FalseLiteral *);
- virtual bool visit(QQmlJS::AST::NumericLiteral *);
- virtual bool visit(QQmlJS::AST::StringLiteral *);
- virtual bool visit(QQmlJS::AST::RegExpLiteral *);
- virtual bool visit(QQmlJS::AST::ArrayLiteral *);
-
- virtual bool visit(QQmlJS::AST::ObjectLiteral *);
- virtual void endVisit(QQmlJS::AST::ObjectLiteral *);
-
- virtual bool visit(QQmlJS::AST::ElementList *);
- virtual bool visit(QQmlJS::AST::Elision *);
- virtual bool visit(QQmlJS::AST::PropertyNameAndValue *);
- virtual bool visit(QQmlJS::AST::ArrayMemberExpression *);
- virtual bool visit(QQmlJS::AST::FieldMemberExpression *);
- virtual bool visit(QQmlJS::AST::NewMemberExpression *);
- virtual bool visit(QQmlJS::AST::NewExpression *);
- virtual bool visit(QQmlJS::AST::ArgumentList *);
- virtual bool visit(QQmlJS::AST::PostIncrementExpression *);
- virtual bool visit(QQmlJS::AST::PostDecrementExpression *);
- virtual bool visit(QQmlJS::AST::DeleteExpression *);
- virtual bool visit(QQmlJS::AST::VoidExpression *);
- virtual bool visit(QQmlJS::AST::TypeOfExpression *);
- virtual bool visit(QQmlJS::AST::PreIncrementExpression *);
- virtual bool visit(QQmlJS::AST::PreDecrementExpression *);
- virtual bool visit(QQmlJS::AST::UnaryPlusExpression *);
- virtual bool visit(QQmlJS::AST::UnaryMinusExpression *);
- virtual bool visit(QQmlJS::AST::TildeExpression *);
- virtual bool visit(QQmlJS::AST::NotExpression *);
- virtual bool visit(QQmlJS::AST::BinaryExpression *);
- virtual bool visit(QQmlJS::AST::ConditionalExpression *);
- virtual bool visit(QQmlJS::AST::Expression *);
-
- virtual bool visit(QQmlJS::AST::Block *);
- virtual void endVisit(QQmlJS::AST::Block *);
-
- virtual bool visit(QQmlJS::AST::VariableStatement *);
- virtual bool visit(QQmlJS::AST::VariableDeclarationList *);
- virtual bool visit(QQmlJS::AST::VariableDeclaration *);
- virtual bool visit(QQmlJS::AST::EmptyStatement *);
- virtual bool visit(QQmlJS::AST::ExpressionStatement *);
- virtual bool visit(QQmlJS::AST::IfStatement *);
- virtual bool visit(QQmlJS::AST::DoWhileStatement *);
- virtual bool visit(QQmlJS::AST::WhileStatement *);
- virtual bool visit(QQmlJS::AST::ForStatement *);
- virtual bool visit(QQmlJS::AST::LocalForStatement *);
- virtual bool visit(QQmlJS::AST::ForEachStatement *);
- virtual bool visit(QQmlJS::AST::LocalForEachStatement *);
- virtual bool visit(QQmlJS::AST::ContinueStatement *);
- virtual bool visit(QQmlJS::AST::BreakStatement *);
- virtual bool visit(QQmlJS::AST::ReturnStatement *);
- virtual bool visit(QQmlJS::AST::WithStatement *);
-
- virtual bool visit(QQmlJS::AST::CaseBlock *);
- virtual void endVisit(QQmlJS::AST::CaseBlock *);
-
- virtual bool visit(QQmlJS::AST::SwitchStatement *);
- virtual bool visit(QQmlJS::AST::CaseClause *);
- virtual bool visit(QQmlJS::AST::DefaultClause *);
- virtual bool visit(QQmlJS::AST::LabelledStatement *);
- virtual bool visit(QQmlJS::AST::ThrowStatement *);
- virtual bool visit(QQmlJS::AST::TryStatement *);
- virtual bool visit(QQmlJS::AST::Catch *);
- virtual bool visit(QQmlJS::AST::Finally *);
- virtual bool visit(QQmlJS::AST::FunctionDeclaration *);
- virtual bool visit(QQmlJS::AST::FunctionExpression *);
- virtual bool visit(QQmlJS::AST::FormalParameterList *);
- virtual bool visit(QQmlJS::AST::DebuggerStatement *);
+ virtual bool visit(QQmlJS::AST::UiImport *) Q_DECL_OVERRIDE;
+ virtual void endVisit(QQmlJS::AST::UiImport *) Q_DECL_OVERRIDE;
+
+ virtual bool visit(QQmlJS::AST::UiPublicMember *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::UiObjectDefinition *) Q_DECL_OVERRIDE;
+
+ virtual bool visit(QQmlJS::AST::UiObjectInitializer *) Q_DECL_OVERRIDE;
+ virtual void endVisit(QQmlJS::AST::UiObjectInitializer *) Q_DECL_OVERRIDE;
+
+ virtual bool visit(QQmlJS::AST::UiObjectBinding *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::UiScriptBinding *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::UiArrayBinding *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::UiArrayMemberList *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::UiQualifiedId *) Q_DECL_OVERRIDE;
+
+ virtual bool visit(QQmlJS::AST::ThisExpression *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::IdentifierExpression *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::NullExpression *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::TrueLiteral *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::FalseLiteral *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::NumericLiteral *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::StringLiteral *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::RegExpLiteral *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::ArrayLiteral *) Q_DECL_OVERRIDE;
+
+ virtual bool visit(QQmlJS::AST::ObjectLiteral *) Q_DECL_OVERRIDE;
+ virtual void endVisit(QQmlJS::AST::ObjectLiteral *) Q_DECL_OVERRIDE;
+
+ virtual bool visit(QQmlJS::AST::ElementList *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::Elision *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::PropertyNameAndValue *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::ArrayMemberExpression *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::FieldMemberExpression *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::NewMemberExpression *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::NewExpression *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::ArgumentList *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::PostIncrementExpression *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::PostDecrementExpression *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::DeleteExpression *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::VoidExpression *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::TypeOfExpression *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::PreIncrementExpression *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::PreDecrementExpression *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::UnaryPlusExpression *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::UnaryMinusExpression *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::TildeExpression *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::NotExpression *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::BinaryExpression *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::ConditionalExpression *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::Expression *) Q_DECL_OVERRIDE;
+
+ virtual bool visit(QQmlJS::AST::Block *) Q_DECL_OVERRIDE;
+ virtual void endVisit(QQmlJS::AST::Block *) Q_DECL_OVERRIDE;
+
+ virtual bool visit(QQmlJS::AST::VariableStatement *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::VariableDeclarationList *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::VariableDeclaration *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::EmptyStatement *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::ExpressionStatement *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::IfStatement *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::DoWhileStatement *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::WhileStatement *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::ForStatement *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::LocalForStatement *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::ForEachStatement *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::LocalForEachStatement *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::ContinueStatement *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::BreakStatement *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::ReturnStatement *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::WithStatement *) Q_DECL_OVERRIDE;
+
+ virtual bool visit(QQmlJS::AST::CaseBlock *) Q_DECL_OVERRIDE;
+ virtual void endVisit(QQmlJS::AST::CaseBlock *) Q_DECL_OVERRIDE;
+
+ virtual bool visit(QQmlJS::AST::SwitchStatement *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::CaseClause *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::DefaultClause *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::LabelledStatement *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::ThrowStatement *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::TryStatement *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::Catch *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::Finally *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::FunctionDeclaration *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::FunctionExpression *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::FormalParameterList *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::DebuggerStatement *) Q_DECL_OVERRIDE;
protected:
QString protect(const QString &string);
diff --git a/src/tools/qdoc/qmlparser/qqmljs.g b/src/tools/qdoc/qmlparser/qqmljs.g
index 616e3b3166..ae430e942d 100644
--- a/src/tools/qdoc/qmlparser/qqmljs.g
+++ b/src/tools/qdoc/qmlparser/qqmljs.g
@@ -1,7 +1,7 @@
----------------------------------------------------------------------------
--
--- Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
--- Contact: http://www.qt-project.org/legal
+-- Copyright (C) 2015 The Qt Company Ltd.
+-- Contact: http://www.qt.io/licensing/
--
-- This file is part of the QtQml module of the Qt Toolkit.
--
@@ -10,9 +10,9 @@
-- Licensees holding valid commercial Qt licenses may use this file in
-- accordance with the commercial license agreement provided with the
-- Software or, alternatively, in accordance with the terms contained in
--- a written agreement between you and Digia. For licensing terms and
--- conditions see http://qt.digia.com/licensing. For further information
--- use the contact form at http://qt.digia.com/contact-us.
+-- a written agreement between you and The Qt Company. For licensing terms
+-- and conditions see http://www.qt.io/terms-conditions. For further
+-- information use the contact form at http://www.qt.io/contact-us.
--
-- GNU Lesser General Public License Usage
-- Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
-- requirements will be met: https://www.gnu.org/licenses/lgpl.html and
-- http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
--
--- In addition, as a special exception, Digia gives you certain additional
--- rights. These rights are described in the Digia Qt LGPL Exception
+-- As a special exception, The Qt Company gives you certain additional
+-- rights. These rights are described in The Qt Company LGPL Exception
-- version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
--
-- $QT_END_LICENSE$
@@ -99,8 +99,8 @@
/./****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtQml module of the Qt Toolkit.
**
@@ -109,9 +109,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -122,8 +122,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
@@ -144,8 +144,8 @@
/:/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtQml module of the Qt Toolkit.
**
@@ -154,9 +154,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -167,8 +167,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
diff --git a/src/tools/qdoc/qmlparser/qqmljsast.cpp b/src/tools/qdoc/qmlparser/qqmljsast.cpp
index e18a7ca76a..a834399ae5 100644
--- a/src/tools/qdoc/qmlparser/qqmljsast.cpp
+++ b/src/tools/qdoc/qmlparser/qqmljsast.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtQml module of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
diff --git a/src/tools/qdoc/qmlparser/qqmljsast_p.h b/src/tools/qdoc/qmlparser/qqmljsast_p.h
index fa4b2c3e13..9dbf4bb514 100644
--- a/src/tools/qdoc/qmlparser/qqmljsast_p.h
+++ b/src/tools/qdoc/qmlparser/qqmljsast_p.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtQml module of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
@@ -247,7 +247,7 @@ class QML_PARSER_EXPORT ExpressionNode: public Node
public:
ExpressionNode() {}
- virtual ExpressionNode *expressionCast();
+ virtual ExpressionNode *expressionCast() Q_DECL_OVERRIDE;
};
class QML_PARSER_EXPORT Statement: public Node
@@ -255,7 +255,7 @@ class QML_PARSER_EXPORT Statement: public Node
public:
Statement() {}
- virtual Statement *statementCast();
+ virtual Statement *statementCast() Q_DECL_OVERRIDE;
};
class QML_PARSER_EXPORT NestedExpression: public ExpressionNode
@@ -267,12 +267,12 @@ public:
: expression(expression)
{ kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return lparenToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return rparenToken; }
// attributes
@@ -288,12 +288,12 @@ public:
ThisExpression() { kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return thisToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return thisToken; }
// attributes
@@ -308,12 +308,12 @@ public:
IdentifierExpression(const QStringRef &n):
name (n) { kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return identifierToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return identifierToken; }
// attributes
@@ -328,12 +328,12 @@ public:
NullExpression() { kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return nullToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return nullToken; }
// attributes
@@ -347,12 +347,12 @@ public:
TrueLiteral() { kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return trueToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return trueToken; }
// attributes
@@ -366,12 +366,12 @@ public:
FalseLiteral() { kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return falseToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return falseToken; }
// attributes
@@ -386,12 +386,12 @@ public:
NumericLiteral(double v):
value(v) { kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return literalToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return literalToken; }
// attributes:
@@ -407,12 +407,12 @@ public:
StringLiteral(const QStringRef &v):
value (v) { kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return literalToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return literalToken; }
// attributes:
@@ -428,12 +428,12 @@ public:
RegExpLiteral(const QStringRef &p, int f):
pattern (p), flags (f) { kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return literalToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return literalToken; }
// attributes:
@@ -459,12 +459,12 @@ public:
elements (elts), elision (e)
{ kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return lbracketToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return rbracketToken; }
// attributes
@@ -486,12 +486,12 @@ public:
ObjectLiteral(PropertyAssignmentList *plist):
properties (plist) { kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return lbraceToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return rbraceToken; }
// attributes
@@ -515,12 +515,12 @@ public:
previous->next = this;
}
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return commaToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return next ? next->lastSourceLocation() : commaToken; }
inline Elision *finish ()
@@ -559,16 +559,16 @@ public:
return front;
}
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{
if (elision)
return elision->firstSourceLocation();
return expression->firstSourceLocation();
}
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{
if (next)
return next->lastSourceLocation();
@@ -589,10 +589,10 @@ public:
PropertyName() { kind = K; }
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return propertyNameToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return propertyNameToken; }
// attributes
@@ -630,12 +630,12 @@ public:
return front;
}
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return assignment->firstSourceLocation(); }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return next ? next->lastSourceLocation() : assignment->lastSourceLocation(); }
// attributes
@@ -653,12 +653,12 @@ public:
: name(n), value(v)
{ kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return name->firstSourceLocation(); }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return value->lastSourceLocation(); }
// attributes
@@ -686,12 +686,12 @@ public:
: type(Setter), name(n), formals(f), functionBody (b)
{ kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return getSetToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return rbraceToken; }
// attributes
@@ -714,7 +714,7 @@ public:
IdentifierPropertyName(const QStringRef &n):
id (n) { kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
// attributes
QStringRef id;
@@ -728,7 +728,7 @@ public:
StringLiteralPropertyName(const QStringRef &n):
id (n) { kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
// attributes
QStringRef id;
@@ -742,7 +742,7 @@ public:
NumericLiteralPropertyName(double n):
id (n) { kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
// attributes
double id;
@@ -757,12 +757,12 @@ public:
base (b), expression (e)
{ kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return base->firstSourceLocation(); }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return rbracketToken; }
// attributes
@@ -781,12 +781,12 @@ public:
base (b), name (n)
{ kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return base->firstSourceLocation(); }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return identifierToken; }
// attributes
@@ -805,12 +805,12 @@ public:
base (b), arguments (a)
{ kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return newToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return rparenToken; }
// attributes
@@ -829,12 +829,12 @@ public:
NewExpression(ExpressionNode *e):
expression (e) { kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return newToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return expression->lastSourceLocation(); }
// attributes
@@ -851,12 +851,12 @@ public:
base (b), arguments (a)
{ kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return base->firstSourceLocation(); }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return rparenToken; }
// attributes
@@ -883,12 +883,12 @@ public:
previous->next = this;
}
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return expression->firstSourceLocation(); }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{
if (next)
return next->lastSourceLocation();
@@ -916,12 +916,12 @@ public:
PostIncrementExpression(ExpressionNode *b):
base (b) { kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return base->firstSourceLocation(); }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return incrementToken; }
// attributes
@@ -937,12 +937,12 @@ public:
PostDecrementExpression(ExpressionNode *b):
base (b) { kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return base->firstSourceLocation(); }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return decrementToken; }
// attributes
@@ -958,12 +958,12 @@ public:
DeleteExpression(ExpressionNode *e):
expression (e) { kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return deleteToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return expression->lastSourceLocation(); }
// attributes
@@ -979,12 +979,12 @@ public:
VoidExpression(ExpressionNode *e):
expression (e) { kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return voidToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return expression->lastSourceLocation(); }
// attributes
@@ -1000,12 +1000,12 @@ public:
TypeOfExpression(ExpressionNode *e):
expression (e) { kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return typeofToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return expression->lastSourceLocation(); }
// attributes
@@ -1021,12 +1021,12 @@ public:
PreIncrementExpression(ExpressionNode *e):
expression (e) { kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return incrementToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return expression->lastSourceLocation(); }
// attributes
@@ -1042,12 +1042,12 @@ public:
PreDecrementExpression(ExpressionNode *e):
expression (e) { kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return decrementToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return expression->lastSourceLocation(); }
// attributes
@@ -1063,12 +1063,12 @@ public:
UnaryPlusExpression(ExpressionNode *e):
expression (e) { kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return plusToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return expression->lastSourceLocation(); }
// attributes
@@ -1084,12 +1084,12 @@ public:
UnaryMinusExpression(ExpressionNode *e):
expression (e) { kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return minusToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return expression->lastSourceLocation(); }
// attributes
@@ -1105,12 +1105,12 @@ public:
TildeExpression(ExpressionNode *e):
expression (e) { kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return tildeToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return expression->lastSourceLocation(); }
// attributes
@@ -1126,12 +1126,12 @@ public:
NotExpression(ExpressionNode *e):
expression (e) { kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return notToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return expression->lastSourceLocation(); }
// attributes
@@ -1148,14 +1148,14 @@ public:
left (l), op (o), right (r)
{ kind = K; }
- virtual BinaryExpression *binaryExpressionCast();
+ virtual BinaryExpression *binaryExpressionCast() Q_DECL_OVERRIDE;
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return left->firstSourceLocation(); }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return right->lastSourceLocation(); }
// attributes
@@ -1174,12 +1174,12 @@ public:
expression (e), ok (t), ko (f)
{ kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return expression->firstSourceLocation(); }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return ko->lastSourceLocation(); }
// attributes
@@ -1198,12 +1198,12 @@ public:
Expression(ExpressionNode *l, ExpressionNode *r):
left (l), right (r) { kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return left->firstSourceLocation(); }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return right->lastSourceLocation(); }
// attributes
@@ -1220,12 +1220,12 @@ public:
Block(StatementList *slist):
statements (slist) { kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return lbraceToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return rbraceToken; }
// attributes
@@ -1251,12 +1251,12 @@ public:
previous->next = this;
}
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return statement->firstSourceLocation(); }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return next ? next->lastSourceLocation() : statement->lastSourceLocation(); }
inline StatementList *finish ()
@@ -1280,12 +1280,12 @@ public:
declarations (vlist)
{ kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return declarationKindToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return semicolonToken; }
// attributes
@@ -1303,12 +1303,12 @@ public:
name (n), expression (e), readOnly(false)
{ kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return identifierToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return expression ? expression->lastSourceLocation() : identifierToken; }
// attributes
@@ -1335,12 +1335,12 @@ public:
previous->next = this;
}
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return declaration->firstSourceLocation(); }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{
if (next)
return next->lastSourceLocation();
@@ -1372,12 +1372,12 @@ public:
EmptyStatement() { kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return semicolonToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return semicolonToken; }
// attributes
@@ -1392,12 +1392,12 @@ public:
ExpressionStatement(ExpressionNode *e):
expression (e) { kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return expression->firstSourceLocation(); }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return semicolonToken; }
// attributes
@@ -1414,12 +1414,12 @@ public:
expression (e), ok (t), ko (f)
{ kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return ifToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{
if (ko)
return ko->lastSourceLocation();
@@ -1446,12 +1446,12 @@ public:
statement (stmt), expression (e)
{ kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return doToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return semicolonToken; }
// attributes
@@ -1473,12 +1473,12 @@ public:
expression (e), statement (stmt)
{ kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return whileToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return statement->lastSourceLocation(); }
// attributes
@@ -1498,12 +1498,12 @@ public:
initialiser (i), condition (c), expression (e), statement (stmt)
{ kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return forToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return statement->lastSourceLocation(); }
// attributes
@@ -1527,12 +1527,12 @@ public:
declarations (vlist), condition (c), expression (e), statement (stmt)
{ kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return forToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return statement->lastSourceLocation(); }
// attributes
@@ -1557,12 +1557,12 @@ public:
initialiser (i), expression (e), statement (stmt)
{ kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return forToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return statement->lastSourceLocation(); }
// attributes
@@ -1584,12 +1584,12 @@ public:
declaration (v), expression (e), statement (stmt)
{ kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return forToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return statement->lastSourceLocation(); }
// attributes
@@ -1611,12 +1611,12 @@ public:
ContinueStatement(const QStringRef &l = QStringRef()):
label (l) { kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return continueToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return semicolonToken; }
// attributes
@@ -1634,12 +1634,12 @@ public:
BreakStatement(const QStringRef &l):
label (l) { kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return breakToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return semicolonToken; }
// attributes
@@ -1657,12 +1657,12 @@ public:
ReturnStatement(ExpressionNode *e):
expression (e) { kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return returnToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return semicolonToken; }
// attributes
@@ -1680,12 +1680,12 @@ public:
expression (e), statement (stmt)
{ kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return withToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return statement->lastSourceLocation(); }
// attributes
@@ -1705,12 +1705,12 @@ public:
clauses (c), defaultClause (d), moreClauses (r)
{ kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return lbraceToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return rbraceToken; }
// attributes
@@ -1730,12 +1730,12 @@ public:
expression (e), block (b)
{ kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return switchToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return block->rbraceToken; }
// attributes
@@ -1755,12 +1755,12 @@ public:
expression (e), statements (slist)
{ kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return caseToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return statements ? statements->lastSourceLocation() : colonToken; }
// attributes
@@ -1787,12 +1787,12 @@ public:
previous->next = this;
}
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return clause->firstSourceLocation(); }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return next ? next->lastSourceLocation() : clause->lastSourceLocation(); }
inline CaseClauses *finish ()
@@ -1816,12 +1816,12 @@ public:
statements (slist)
{ kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return defaultToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return statements ? statements->lastSourceLocation() : colonToken; }
// attributes
@@ -1839,12 +1839,12 @@ public:
label (l), statement (stmt)
{ kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return identifierToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return statement->lastSourceLocation(); }
// attributes
@@ -1862,12 +1862,12 @@ public:
ThrowStatement(ExpressionNode *e):
expression (e) { kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return throwToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return semicolonToken; }
// attributes
@@ -1885,12 +1885,12 @@ public:
name (n), statement (stmt)
{ kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return catchToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return statement->lastSourceLocation(); }
// attributes
@@ -1911,12 +1911,12 @@ public:
statement (stmt)
{ kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return finallyToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return statement ? statement->lastSourceLocation() : finallyToken; }
// attributes
@@ -1941,12 +1941,12 @@ public:
statement (stmt), catchExpression (c), finallyExpression (0)
{ kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return tryToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{
if (finallyExpression)
return finallyExpression->statement->rbraceToken;
@@ -1972,12 +1972,12 @@ public:
name (n), formals (f), body (b)
{ kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return functionToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return rbraceToken; }
// attributes
@@ -2001,7 +2001,7 @@ public:
FunctionExpression(n, f, b)
{ kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
};
class QML_PARSER_EXPORT FormalParameterList: public Node
@@ -2021,12 +2021,12 @@ public:
previous->next = this;
}
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return identifierToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return next ? next->lastSourceLocation() : identifierToken; }
inline FormalParameterList *finish ()
@@ -2069,12 +2069,12 @@ public:
previous->next = this;
}
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return element->firstSourceLocation(); }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return next ? next->lastSourceLocation() : element->lastSourceLocation(); }
inline SourceElements *finish ()
@@ -2098,12 +2098,12 @@ public:
elements (elts)
{ kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return elements ? elements->firstSourceLocation() : SourceLocation(); }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return elements ? elements->lastSourceLocation() : SourceLocation(); }
// attributes
@@ -2119,12 +2119,12 @@ public:
elements (elts)
{ kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return elements ? elements->firstSourceLocation() : SourceLocation(); }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return elements ? elements->lastSourceLocation() : SourceLocation(); }
// attributes
@@ -2140,12 +2140,12 @@ public:
declaration (f)
{ kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return declaration->firstSourceLocation(); }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return declaration->lastSourceLocation(); }
// attributes
@@ -2161,12 +2161,12 @@ public:
statement (stmt)
{ kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return statement->firstSourceLocation(); }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return statement->lastSourceLocation(); }
// attributes
@@ -2181,12 +2181,12 @@ public:
DebuggerStatement()
{ kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return debuggerToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return semicolonToken; }
// attributes
@@ -2218,12 +2218,12 @@ public:
return head;
}
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return identifierToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return next ? next->lastSourceLocation() : identifierToken; }
// attributes
@@ -2245,12 +2245,12 @@ public:
: importUri(uri)
{ kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return importToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return semicolonToken; }
// attributes
@@ -2268,10 +2268,10 @@ public:
class QML_PARSER_EXPORT UiObjectMember: public Node
{
public:
- virtual SourceLocation firstSourceLocation() const = 0;
- virtual SourceLocation lastSourceLocation() const = 0;
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE = 0;
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE = 0;
- virtual UiObjectMember *uiObjectMemberCast();
+ virtual UiObjectMember *uiObjectMemberCast() Q_DECL_OVERRIDE;
};
class QML_PARSER_EXPORT UiObjectMemberList: public Node
@@ -2291,12 +2291,12 @@ public:
previous->next = this;
}
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return member->firstSourceLocation(); }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return next ? next->lastSourceLocation() : member->lastSourceLocation(); }
UiObjectMemberList *finish()
@@ -2335,12 +2335,12 @@ public:
return head;
}
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return identifierToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return next ? next->lastSourceLocation() : identifierToken; }
// attributes
@@ -2358,12 +2358,12 @@ public:
: pragmaType(type)
{ kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return pragmaToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return semicolonToken; }
// attributes
@@ -2408,12 +2408,12 @@ public:
return head;
}
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return headerItem->firstSourceLocation(); }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return next ? next->lastSourceLocation() : headerItem->lastSourceLocation(); }
// attributes
@@ -2430,9 +2430,9 @@ public:
: headers(headers), members(members)
{ kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{
if (headers)
return headers->firstSourceLocation();
@@ -2441,7 +2441,7 @@ public:
return SourceLocation();
}
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{
if (members)
return members->lastSourceLocation();
@@ -2472,12 +2472,12 @@ public:
previous->next = this;
}
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return member->firstSourceLocation(); }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return next ? next->lastSourceLocation() : member->lastSourceLocation(); }
UiArrayMemberList *finish()
@@ -2502,12 +2502,12 @@ public:
: members(members)
{ kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return lbraceToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return rbraceToken; }
// attributes
@@ -2533,12 +2533,12 @@ public:
previous->next = this;
}
- virtual void accept0(Visitor *);
+ virtual void accept0(Visitor *) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return propertyTypeToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return next ? next->lastSourceLocation() : identifierToken; }
inline UiParameterList *finish ()
@@ -2573,9 +2573,9 @@ public:
: type(Property), memberType(memberType), name(name), statement(statement), binding(0), isDefaultMember(false), isReadonlyMember(false), parameters(0)
{ kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{
if (defaultToken.isValid())
return defaultToken;
@@ -2585,7 +2585,7 @@ public:
return propertyToken;
}
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{
if (binding)
return binding->lastSourceLocation();
@@ -2625,12 +2625,12 @@ public:
: qualifiedTypeNameId(qualifiedTypeNameId), initializer(initializer)
{ kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return qualifiedTypeNameId->identifierToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return initializer->rbraceToken; }
// attributes
@@ -2647,7 +2647,7 @@ public:
: sourceElement(sourceElement)
{ kind = K; }
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{
if (FunctionDeclaration *funDecl = cast<FunctionDeclaration *>(sourceElement))
return funDecl->firstSourceLocation();
@@ -2657,7 +2657,7 @@ public:
return SourceLocation();
}
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{
if (FunctionDeclaration *funDecl = cast<FunctionDeclaration *>(sourceElement))
return funDecl->lastSourceLocation();
@@ -2667,7 +2667,7 @@ public:
return SourceLocation();
}
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
// attributes
@@ -2688,7 +2688,7 @@ public:
hasOnToken(false)
{ kind = K; }
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{
if (hasOnToken && qualifiedTypeNameId)
return qualifiedTypeNameId->identifierToken;
@@ -2696,10 +2696,10 @@ public:
return qualifiedId->identifierToken;
}
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return initializer->rbraceToken; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
// attributes
@@ -2721,13 +2721,13 @@ public:
statement(statement)
{ kind = K; }
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return qualifiedId->identifierToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return statement->lastSourceLocation(); }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
// attributes
UiQualifiedId *qualifiedId;
@@ -2746,13 +2746,13 @@ public:
members(members)
{ kind = K; }
- virtual SourceLocation firstSourceLocation() const
+ virtual SourceLocation firstSourceLocation() const Q_DECL_OVERRIDE
{ return qualifiedId->identifierToken; }
- virtual SourceLocation lastSourceLocation() const
+ virtual SourceLocation lastSourceLocation() const Q_DECL_OVERRIDE
{ return rbracketToken; }
- virtual void accept0(Visitor *visitor);
+ virtual void accept0(Visitor *visitor) Q_DECL_OVERRIDE;
// attributes
UiQualifiedId *qualifiedId;
diff --git a/src/tools/qdoc/qmlparser/qqmljsastfwd_p.h b/src/tools/qdoc/qmlparser/qqmljsastfwd_p.h
index 4949e3155e..c4cb59293d 100644
--- a/src/tools/qdoc/qmlparser/qqmljsastfwd_p.h
+++ b/src/tools/qdoc/qmlparser/qqmljsastfwd_p.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtQml module of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
diff --git a/src/tools/qdoc/qmlparser/qqmljsastvisitor.cpp b/src/tools/qdoc/qmlparser/qqmljsastvisitor.cpp
index f0f8f928c6..4ba8b24940 100644
--- a/src/tools/qdoc/qmlparser/qqmljsastvisitor.cpp
+++ b/src/tools/qdoc/qmlparser/qqmljsastvisitor.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtQml module of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
diff --git a/src/tools/qdoc/qmlparser/qqmljsastvisitor_p.h b/src/tools/qdoc/qmlparser/qqmljsastvisitor_p.h
index 52221c7bd8..4e15b453f3 100644
--- a/src/tools/qdoc/qmlparser/qqmljsastvisitor_p.h
+++ b/src/tools/qdoc/qmlparser/qqmljsastvisitor_p.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtQml module of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
diff --git a/src/tools/qdoc/qmlparser/qqmljsengine_p.cpp b/src/tools/qdoc/qmlparser/qqmljsengine_p.cpp
index 7ac5dbc9bb..faf05f71f1 100644
--- a/src/tools/qdoc/qmlparser/qqmljsengine_p.cpp
+++ b/src/tools/qdoc/qmlparser/qqmljsengine_p.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtQml module of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
diff --git a/src/tools/qdoc/qmlparser/qqmljsengine_p.h b/src/tools/qdoc/qmlparser/qqmljsengine_p.h
index 661681d19c..210797ffcd 100644
--- a/src/tools/qdoc/qmlparser/qqmljsengine_p.h
+++ b/src/tools/qdoc/qmlparser/qqmljsengine_p.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtQml module of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
diff --git a/src/tools/qdoc/qmlparser/qqmljsglobal_p.h b/src/tools/qdoc/qmlparser/qqmljsglobal_p.h
index 004fe33885..c9b5b4c5b4 100644
--- a/src/tools/qdoc/qmlparser/qqmljsglobal_p.h
+++ b/src/tools/qdoc/qmlparser/qqmljsglobal_p.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtQml module of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
diff --git a/src/tools/qdoc/qmlparser/qqmljsgrammar.cpp b/src/tools/qdoc/qmlparser/qqmljsgrammar.cpp
index 2600a5e14c..609c490d06 100644
--- a/src/tools/qdoc/qmlparser/qqmljsgrammar.cpp
+++ b/src/tools/qdoc/qmlparser/qqmljsgrammar.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
diff --git a/src/tools/qdoc/qmlparser/qqmljsgrammar_p.h b/src/tools/qdoc/qmlparser/qqmljsgrammar_p.h
index 7a369be194..667cae07e9 100644
--- a/src/tools/qdoc/qmlparser/qqmljsgrammar_p.h
+++ b/src/tools/qdoc/qmlparser/qqmljsgrammar_p.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
diff --git a/src/tools/qdoc/qmlparser/qqmljskeywords_p.h b/src/tools/qdoc/qmlparser/qqmljskeywords_p.h
index b8fe50086d..f7368b94d6 100644
--- a/src/tools/qdoc/qmlparser/qqmljskeywords_p.h
+++ b/src/tools/qdoc/qmlparser/qqmljskeywords_p.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtQml module of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
diff --git a/src/tools/qdoc/qmlparser/qqmljslexer.cpp b/src/tools/qdoc/qmlparser/qqmljslexer.cpp
index 4d053b8bd5..69dcb15794 100644
--- a/src/tools/qdoc/qmlparser/qqmljslexer.cpp
+++ b/src/tools/qdoc/qmlparser/qqmljslexer.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtQml module of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
diff --git a/src/tools/qdoc/qmlparser/qqmljslexer_p.h b/src/tools/qdoc/qmlparser/qqmljslexer_p.h
index 9106c94477..20f4b42b8d 100644
--- a/src/tools/qdoc/qmlparser/qqmljslexer_p.h
+++ b/src/tools/qdoc/qmlparser/qqmljslexer_p.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtQml module of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
diff --git a/src/tools/qdoc/qmlparser/qqmljsmemorypool_p.h b/src/tools/qdoc/qmlparser/qqmljsmemorypool_p.h
index 23d6b867cf..f8bb70c54c 100644
--- a/src/tools/qdoc/qmlparser/qqmljsmemorypool_p.h
+++ b/src/tools/qdoc/qmlparser/qqmljsmemorypool_p.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtQml module of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
diff --git a/src/tools/qdoc/qmlparser/qqmljsparser.cpp b/src/tools/qdoc/qmlparser/qqmljsparser.cpp
index 762e60c827..44279260d7 100644
--- a/src/tools/qdoc/qmlparser/qqmljsparser.cpp
+++ b/src/tools/qdoc/qmlparser/qqmljsparser.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtQml module of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
diff --git a/src/tools/qdoc/qmlparser/qqmljsparser_p.h b/src/tools/qdoc/qmlparser/qqmljsparser_p.h
index cf9f641fbc..5042e47112 100644
--- a/src/tools/qdoc/qmlparser/qqmljsparser_p.h
+++ b/src/tools/qdoc/qmlparser/qqmljsparser_p.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtQml module of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
diff --git a/src/tools/qdoc/qmlvisitor.cpp b/src/tools/qdoc/qmlvisitor.cpp
index 9ef5bab5e2..6179e80085 100644
--- a/src/tools/qdoc/qmlvisitor.cpp
+++ b/src/tools/qdoc/qmlvisitor.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
@@ -72,6 +72,18 @@ QT_BEGIN_NAMESPACE
#define COMMAND_QMLREADONLY Doc::alias(QLatin1String("readonly"))
#define COMMAND_QMLBASICTYPE Doc::alias(QLatin1String("qmlbasictype"))
+#define COMMAND_JSTYPE Doc::alias(QLatin1String("jstype"))
+#define COMMAND_JSMODULE Doc::alias(QLatin1String("jsmodule"))
+#define COMMAND_JSPROPERTY Doc::alias(QLatin1String("jsproperty"))
+#define COMMAND_JSPROPERTYGROUP Doc::alias(QLatin1String("jspropertygroup"))
+#define COMMAND_JSATTACHEDPROPERTY Doc::alias(QLatin1String("jsattachedproperty"))
+#define COMMAND_INJSMODULE Doc::alias(QLatin1String("injsmodule"))
+#define COMMAND_JSSIGNAL Doc::alias(QLatin1String("jssignal"))
+#define COMMAND_JSATTACHEDSIGNAL Doc::alias(QLatin1String("jsattachedsignal"))
+#define COMMAND_JSMETHOD Doc::alias(QLatin1String("jsmethod"))
+#define COMMAND_JSATTACHEDMETHOD Doc::alias(QLatin1String("jsattachedmethod"))
+#define COMMAND_JSBASICTYPE Doc::alias(QLatin1String("jsbasictype"))
+
/*!
The constructor stores all the parameters in local data members.
*/
@@ -134,82 +146,6 @@ QQmlJS::AST::SourceLocation QmlDocVisitor::precedingComment(quint32 offset) cons
return QQmlJS::AST::SourceLocation();
}
-#if 0
- ArgList args;
- QSet<QString>::iterator i = metacommands.begin();
- while (i != metacommands.end()) {
- if (topics_.contains(*i)) {
- topic = *i;
- break;
- }
- ++i;
- }
- if (!topic.isEmpty()) {
- args = doc.metaCommandArgs(topic);
- if ((topic == COMMAND_QMLCLASS) || (topic == COMMAND_QMLTYPE)) {
- // do nothing.
- }
- else if (topic == COMMAND_QMLPROPERTY) {
- if (node->type() == Node::QmlProperty) {
- QmlPropertyNode* qpn = static_cast<QmlPropertyNode*>(node);
- qpn->setReadOnly(0);
- if (qpn->dataType() == "alias") {
- QStringList part = args[0].first.split(QLatin1Char(' '));
- qpn->setDataType(part[0]);
- }
- }
- }
- else if (topic == COMMAND_QMLPROPERTYGROUP) {
- // zzz ?
- }
- else if (topic == COMMAND_QMLMODULE) {
- }
- else if (topic == COMMAND_QMLATTACHEDPROPERTY) {
- if (node->type() == Node::QmlProperty) {
- QmlPropertyNode* qpn = static_cast<QmlPropertyNode*>(node);
- qpn->setReadOnly(0);
- }
- }
- else if (topic == COMMAND_QMLSIGNAL) {
- }
- else if (topic == COMMAND_QMLATTACHEDSIGNAL) {
- }
- else if (topic == COMMAND_QMLMETHOD) {
- }
- else if (topic == COMMAND_QMLATTACHEDMETHOD) {
- }
- else if (topic == COMMAND_QMLBASICTYPE) {
- }
- }
-
- if (node->type() == Node::QmlProperty) {
- QmlPropertyNode* qpn = static_cast<QmlPropertyNode*>(node);
- for (int i=0; i<topicsUsed.size(); ++i) {
- if (topicsUsed.at(i).topic == "qmlproperty") {
- /*
- A \qmlproperty command would be used in a QML file
- to document the underlying property for a property
- alias.
- */
- QmlPropArgs qpa;
- if (splitQmlPropertyArg(doc, topicsUsed.at(i).args, qpa)) {
- QmlPropertyNode* n = parent->hasQmlPropertyNode(qpa.name_);
- if (n == 0)
- n = new QmlPropertyNode(qpn, qpa.name_, qpa.type_, false);
- n->setLocation(doc.location());
- n->setReadOnly(qpn->isReadOnly());
- if (qpn->isDefault())
- n->setDefault();
- }
- else
- qDebug() << " FAILED TO PARSE QML PROPERTY:"
- << topicsUsed.at(i).topic << topicsUsed.at(i).args;
- }
- }
- }
-
-#endif
-
/*!
Finds the nearest unused qdoc comment above the QML entity
represented by the \a node and processes the qdoc commands
@@ -241,7 +177,8 @@ bool QmlDocVisitor::applyDocumentation(QQmlJS::AST::SourceLocation location, Nod
nodes.append(node);
if (topicsUsed.size() > 0) {
for (int i=0; i<topicsUsed.size(); ++i) {
- if (topicsUsed.at(i).topic == COMMAND_QMLPROPERTYGROUP) {
+ if ((topicsUsed.at(i).topic == COMMAND_QMLPROPERTYGROUP) ||
+ (topicsUsed.at(i).topic == COMMAND_JSPROPERTYGROUP)) {
qDebug() << "PROPERTY GROUP COMMAND SEEN:" << topicsUsed.at(i).args << filePath_;
break;
}
@@ -249,7 +186,8 @@ bool QmlDocVisitor::applyDocumentation(QQmlJS::AST::SourceLocation location, Nod
for (int i=0; i<topicsUsed.size(); ++i) {
QString topic = topicsUsed.at(i).topic;
QString args = topicsUsed.at(i).args;
- if ((topic == COMMAND_QMLPROPERTY) || (topic == COMMAND_QMLATTACHEDPROPERTY)) {
+ if ((topic == COMMAND_QMLPROPERTY) || (topic == COMMAND_QMLATTACHEDPROPERTY) ||
+ (topic == COMMAND_JSPROPERTY) || (topic == COMMAND_JSATTACHEDPROPERTY)) {
QmlPropArgs qpa;
if (splitQmlPropertyArg(doc, args, qpa)) {
if (qpa.name_ == nodePassedIn->name()) {
@@ -257,7 +195,8 @@ bool QmlDocVisitor::applyDocumentation(QQmlJS::AST::SourceLocation location, Nod
nodePassedIn->setDataType(qpa.type_);
}
else {
- bool isAttached = (topic == COMMAND_QMLATTACHEDPROPERTY);
+ bool isAttached = (topic == COMMAND_QMLATTACHEDPROPERTY) ||
+ (topic == COMMAND_JSATTACHEDPROPERTY);
QmlPropertyNode* n = parent->hasQmlProperty(qpa.name_, isAttached);
if (n == 0)
n = new QmlPropertyNode(parent, qpa.name_, qpa.type_, isAttached);
@@ -268,11 +207,14 @@ bool QmlDocVisitor::applyDocumentation(QQmlJS::AST::SourceLocation location, Nod
n->setDefault();
if (isAttached)
n->setReadOnly(0);
+ if ((topic == COMMAND_JSPROPERTY) ||
+ (topic == COMMAND_JSATTACHEDPROPERTY))
+ n->setGenus(Node::JS);
nodes.append(n);
}
}
else
- qDebug() << " FAILED TO PARSE QML PROPERTY:" << topic << args;
+ qDebug() << " FAILED TO PARSE QML OR JS PROPERTY:" << topic << args;
}
}
}
@@ -357,33 +299,33 @@ void QmlDocVisitor::applyMetacommands(QQmlJS::AST::SourceLocation,
QString command = *i;
ArgList args = doc.metaCommandArgs(command);
if (command == COMMAND_QMLABSTRACT) {
- if (node->isQmlType()) {
+ if (node->isQmlType() || node->isJsType()) {
node->setAbstract(true);
}
}
else if (command == COMMAND_DEPRECATED) {
node->setStatus(Node::Obsolete);
}
- else if (command == COMMAND_INQMLMODULE) {
+ else if ((command == COMMAND_INQMLMODULE) || (command == COMMAND_INJSMODULE)) {
qdb->addToQmlModule(args[0].first,node);
}
else if (command == COMMAND_QMLINHERITS) {
if (node->name() == args[0].first)
doc.location().warning(tr("%1 tries to inherit itself").arg(args[0].first));
- else if (node->isQmlType()) {
- QmlClassNode *qmlClass = static_cast<QmlClassNode*>(node);
- qmlClass->setQmlBaseName(args[0].first);
- QmlClassNode::addInheritedBy(args[0].first,node);
+ else if (node->isQmlType() || node->isJsType()) {
+ QmlTypeNode *qmlType = static_cast<QmlTypeNode*>(node);
+ qmlType->setQmlBaseName(args[0].first);
+ QmlTypeNode::addInheritedBy(args[0].first,node);
}
}
else if (command == COMMAND_QMLDEFAULT) {
- if (node->type() == Node::QmlProperty) {
+ if (node->isQmlProperty() || node->isJsProperty()) {
QmlPropertyNode* qpn = static_cast<QmlPropertyNode*>(node);
qpn->setDefault();
}
}
else if (command == COMMAND_QMLREADONLY) {
- if (node->type() == Node::QmlProperty) {
+ if (node->isQmlProperty() || node->isJsProperty()) {
QmlPropertyNode* qpn = static_cast<QmlPropertyNode*>(node);
qpn->setReadOnly(1);
}
@@ -452,12 +394,12 @@ bool QmlDocVisitor::visit(QQmlJS::AST::UiObjectDefinition *definition)
nestingLevel++;
if (current->type() == Node::Namespace) {
- QmlClassNode *component = new QmlClassNode(current, name);
+ QmlTypeNode *component = new QmlTypeNode(current, name);
component->setTitle(name);
component->setImportList(importList);
importList.clear();
if (applyDocumentation(definition->firstSourceLocation(), component)) {
- QmlClassNode::addInheritedBy(type, component);
+ QmlTypeNode::addInheritedBy(type, component);
component->setQmlBaseName(type);
}
current = component;
@@ -532,9 +474,9 @@ bool QmlDocVisitor::visit(QQmlJS::AST::UiPublicMember *member)
switch (member->type) {
case QQmlJS::AST::UiPublicMember::Signal:
{
- if (current->isQmlType()) {
- QmlClassNode *qmlClass = static_cast<QmlClassNode *>(current);
- if (qmlClass) {
+ if (current->isQmlType() || current->isJsType()) {
+ QmlTypeNode *qmlType = static_cast<QmlTypeNode *>(current);
+ if (qmlType) {
QString name = member->name.toString();
FunctionNode *qmlSignal = new FunctionNode(Node::QmlSignal, current, name, false);
@@ -555,13 +497,16 @@ bool QmlDocVisitor::visit(QQmlJS::AST::UiPublicMember *member)
{
QString type = member->memberType.toString();
QString name = member->name.toString();
- if (current->isQmlType()) {
- QmlClassNode *qmlClass = static_cast<QmlClassNode *>(current);
- if (qmlClass) {
+ if (current->isQmlType() || current->isJsType()) {
+ QmlTypeNode *qmlType = static_cast<QmlTypeNode *>(current);
+ if (qmlType) {
QString name = member->name.toString();
- QmlPropertyNode* qmlPropNode = qmlClass->hasQmlProperty(name);
- if (qmlPropNode == 0)
- qmlPropNode = new QmlPropertyNode(qmlClass, name, type, false);
+ QmlPropertyNode* qmlPropNode = qmlType->hasQmlProperty(name);
+ if (qmlPropNode == 0) {
+ qmlPropNode = new QmlPropertyNode(qmlType, name, type, false);
+ if (current->isJsType())
+ qmlPropNode->setGenus(Node::JS);
+ }
qmlPropNode->setReadOnly(member->isReadonlyMember);
if (member->isDefaultMember)
qmlPropNode->setDefault();
@@ -599,11 +544,13 @@ bool QmlDocVisitor::visit(QQmlJS::AST::FunctionDeclaration* fd)
if (nestingLevel > 1) {
return true;
}
- if (current->isQmlType()) {
- QmlClassNode* qmlClass = static_cast<QmlClassNode*>(current);
- if (qmlClass) {
+ if (current->isQmlType() || current->isJsType()) {
+ QmlTypeNode* qmlType = static_cast<QmlTypeNode*>(current);
+ if (qmlType) {
QString name = fd->name.toString();
FunctionNode* qmlMethod = new FunctionNode(Node::QmlMethod, current, name, false);
+ if (current->isJsType())
+ qmlMethod->setGenus(Node::JS);
int overloads = 0;
NodeList::ConstIterator overloadIterator = current->childNodes().constBegin();
while (overloadIterator != current->childNodes().constEnd()) {
@@ -652,11 +599,11 @@ bool QmlDocVisitor::visit(QQmlJS::AST::UiScriptBinding* )
if (nestingLevel > 1) {
return true;
}
- if (current->isQmlType()) {
+ if (current->isQmlType() || current->isJsType()) {
QString handler = sb->qualifiedId->name.toString();
if (handler.length() > 2 && handler.startsWith("on") && handler.at(2).isUpper()) {
- QmlClassNode* qmlClass = static_cast<QmlClassNode*>(current);
- if (qmlClass) {
+ QmlTypeNode* qmlType = static_cast<QmlTypeNode*>(current);
+ if (qmlType) {
FunctionNode* qmlSH = new FunctionNode(Node::QmlSignalHandler,current,handler,false);
applyDocumentation(sb->firstSourceLocation(), qmlSH);
}
diff --git a/src/tools/qdoc/qmlvisitor.h b/src/tools/qdoc/qmlvisitor.h
index ed9ba7c6eb..cfb167c985 100644
--- a/src/tools/qdoc/qmlvisitor.h
+++ b/src/tools/qdoc/qmlvisitor.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
@@ -67,30 +67,30 @@ public:
const QSet<QString> &topics);
virtual ~QmlDocVisitor();
- bool visit(QQmlJS::AST::UiImport *import);
- void endVisit(QQmlJS::AST::UiImport *definition);
+ bool visit(QQmlJS::AST::UiImport *import) Q_DECL_OVERRIDE;
+ void endVisit(QQmlJS::AST::UiImport *definition) Q_DECL_OVERRIDE;
- bool visit(QQmlJS::AST::UiObjectDefinition *definition);
- void endVisit(QQmlJS::AST::UiObjectDefinition *definition);
+ bool visit(QQmlJS::AST::UiObjectDefinition *definition) Q_DECL_OVERRIDE;
+ void endVisit(QQmlJS::AST::UiObjectDefinition *definition) Q_DECL_OVERRIDE;
- bool visit(QQmlJS::AST::UiPublicMember *member);
- void endVisit(QQmlJS::AST::UiPublicMember *definition);
+ bool visit(QQmlJS::AST::UiPublicMember *member) Q_DECL_OVERRIDE;
+ void endVisit(QQmlJS::AST::UiPublicMember *definition) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::UiObjectBinding *);
- virtual void endVisit(QQmlJS::AST::UiObjectBinding *);
- virtual void endVisit(QQmlJS::AST::UiArrayBinding *);
- virtual bool visit(QQmlJS::AST::UiArrayBinding *);
+ virtual bool visit(QQmlJS::AST::UiObjectBinding *) Q_DECL_OVERRIDE;
+ virtual void endVisit(QQmlJS::AST::UiObjectBinding *) Q_DECL_OVERRIDE;
+ virtual void endVisit(QQmlJS::AST::UiArrayBinding *) Q_DECL_OVERRIDE;
+ virtual bool visit(QQmlJS::AST::UiArrayBinding *) Q_DECL_OVERRIDE;
- bool visit(QQmlJS::AST::IdentifierPropertyName *idproperty);
+ bool visit(QQmlJS::AST::IdentifierPropertyName *idproperty) Q_DECL_OVERRIDE;
- bool visit(QQmlJS::AST::FunctionDeclaration *);
- void endVisit(QQmlJS::AST::FunctionDeclaration *);
+ bool visit(QQmlJS::AST::FunctionDeclaration *) Q_DECL_OVERRIDE;
+ void endVisit(QQmlJS::AST::FunctionDeclaration *) Q_DECL_OVERRIDE;
- bool visit(QQmlJS::AST::UiScriptBinding *);
- void endVisit(QQmlJS::AST::UiScriptBinding *);
+ bool visit(QQmlJS::AST::UiScriptBinding *) Q_DECL_OVERRIDE;
+ void endVisit(QQmlJS::AST::UiScriptBinding *) Q_DECL_OVERRIDE;
- bool visit(QQmlJS::AST::UiQualifiedId *);
- void endVisit(QQmlJS::AST::UiQualifiedId *);
+ bool visit(QQmlJS::AST::UiQualifiedId *) Q_DECL_OVERRIDE;
+ void endVisit(QQmlJS::AST::UiQualifiedId *) Q_DECL_OVERRIDE;
private:
QString getFullyQualifiedId(QQmlJS::AST::UiQualifiedId *id);
diff --git a/src/tools/qdoc/quoter.cpp b/src/tools/qdoc/quoter.cpp
index b1b8f1bfbc..d8a4df33f3 100644
--- a/src/tools/qdoc/quoter.cpp
+++ b/src/tools/qdoc/quoter.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
diff --git a/src/tools/qdoc/quoter.h b/src/tools/qdoc/quoter.h
index 2a894963db..2c3fa3980d 100644
--- a/src/tools/qdoc/quoter.h
+++ b/src/tools/qdoc/quoter.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
diff --git a/src/tools/qdoc/separator.cpp b/src/tools/qdoc/separator.cpp
index b8e8c8857c..3cbcb6930b 100644
--- a/src/tools/qdoc/separator.cpp
+++ b/src/tools/qdoc/separator.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
diff --git a/src/tools/qdoc/separator.h b/src/tools/qdoc/separator.h
index 80a1581e89..281d95994e 100644
--- a/src/tools/qdoc/separator.h
+++ b/src/tools/qdoc/separator.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
diff --git a/src/tools/qdoc/text.cpp b/src/tools/qdoc/text.cpp
index 7268e7218e..b4eebe4c75 100644
--- a/src/tools/qdoc/text.cpp
+++ b/src/tools/qdoc/text.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
diff --git a/src/tools/qdoc/text.h b/src/tools/qdoc/text.h
index 764ed8c18e..7f4eeb3ec2 100644
--- a/src/tools/qdoc/text.h
+++ b/src/tools/qdoc/text.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
diff --git a/src/tools/qdoc/tokenizer.cpp b/src/tools/qdoc/tokenizer.cpp
index 7c9e9f338a..6bfa678bc6 100644
--- a/src/tools/qdoc/tokenizer.cpp
+++ b/src/tools/qdoc/tokenizer.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
@@ -511,6 +511,9 @@ void Tokenizer::initialize(const Config &config)
defines = new QRegExp(d.join('|'));
falsehoods = new QRegExp(config.getStringList(CONFIG_FALSEHOODS).join('|'));
+ /*
+ The keyword hash table is always cleared before any words are inserted.
+ */
memset(kwordHashTable, 0, sizeof(kwordHashTable));
for (int i = 0; i < Tok_LastKeyword - Tok_FirstKeyword + 1; i++)
insertKwordIntoHash(kwords[i], i + 1);
@@ -533,6 +536,11 @@ void Tokenizer::initialize(const Config &config)
}
}
+/*!
+ The heap allocated variables are freed here. The keyword
+ hash table is not cleared here, but it is cleared in the
+ initialize() function, before any keywords are inserted.
+ */
void Tokenizer::terminate()
{
delete comment;
diff --git a/src/tools/qdoc/tokenizer.h b/src/tools/qdoc/tokenizer.h
index c841a62d1d..5827ce9b7d 100644
--- a/src/tools/qdoc/tokenizer.h
+++ b/src/tools/qdoc/tokenizer.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
diff --git a/src/tools/qdoc/tree.cpp b/src/tools/qdoc/tree.cpp
index 2e327a5ac8..6393ad4e6f 100644
--- a/src/tools/qdoc/tree.cpp
+++ b/src/tools/qdoc/tree.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
@@ -65,11 +65,20 @@ QT_BEGIN_NAMESPACE
qdoc database that is constructing the tree. This might not
be necessary, and it might be removed later.
*/
-Tree::Tree(const QString& module, QDocDatabase* qdb)
- : module_(module), qdb_(qdb), root_(0, QString())
+Tree::Tree(const QString& physicalModuleName, QDocDatabase* qdb)
+ : treeHasBeenAnalyzed_(false),
+ docsHaveBeenGenerated_(false),
+ linkCount_(0),
+ physicalModuleName_(physicalModuleName),
+ qdb_(qdb),
+ root_(0, QString()),
+ targetListMap_(0)
{
- root_.setModuleName(module_);
+ root_.setPhysicalModuleName(physicalModuleName_);
root_.setTree(this);
+ if (Generator::writeQaPages()) {
+ targetListMap_ = new TargetListMap;
+ }
}
/*!
@@ -95,6 +104,18 @@ Tree::~Tree()
}
nodesByTargetRef_.clear();
nodesByTargetTitle_.clear();
+ if (Generator::writeQaPages() && targetListMap_) {
+ TargetListMap::iterator i = targetListMap_->begin();
+ while (i != targetListMap_->end()) {
+ TargetList* tlist = i.value();
+ if (tlist) {
+ foreach (TargetLoc* tloc, *tlist)
+ delete tloc;
+ }
+ delete tlist;
+ ++i;
+ }
+ }
}
/* API members */
@@ -167,7 +188,7 @@ FunctionNode* Tree::findFunctionNode(const QStringList& parentPath, const Functi
at the root of the tree. Only a Qml type node named <\a path is
acceptible. If one is not found, 0 is returned.
*/
-QmlClassNode* Tree::findQmlTypeNode(const QStringList& path)
+QmlTypeNode* Tree::findQmlTypeNode(const QStringList& path)
{
/*
If the path contains one or two double colons ("::"),
@@ -178,11 +199,11 @@ QmlClassNode* Tree::findQmlTypeNode(const QStringList& path)
class node.
*/
if (path.size() >= 2 && !path[0].isEmpty()) {
- QmlClassNode* qcn = qdb_->findQmlType(path[0], path[1]);
+ QmlTypeNode* qcn = qdb_->findQmlType(path[0], path[1]);
if (qcn)
return qcn;
}
- return static_cast<QmlClassNode*>(findNodeRecursive(path, 0, root(), Node::QmlType));
+ return static_cast<QmlTypeNode*>(findNodeRecursive(path, 0, root(), Node::QmlType));
}
/*!
@@ -198,13 +219,14 @@ const FunctionNode* Tree::findFunctionNode(const QStringList& path,
int findFlags,
Node::Genus genus) const
{
- if (path.size() == 3 && !path[0].isEmpty() && (genus != Node::CPP)) {
- QmlClassNode* qcn = lookupQmlType(QString(path[0] + "::" + path[1]));
+ if (path.size() == 3 && !path[0].isEmpty() &&
+ ((genus == Node::QML) || (genus == Node::DontCare))) {
+ QmlTypeNode* qcn = lookupQmlType(QString(path[0] + "::" + path[1]));
if (!qcn) {
QStringList p(path[1]);
Node* n = findNodeByNameAndType(p, Node::QmlType);
- if (n && n->isQmlType())
- qcn = static_cast<QmlClassNode*>(n);
+ if (n && (n->isQmlType() || n->isJsType()))
+ qcn = static_cast<QmlTypeNode*>(n);
}
if (qcn)
return static_cast<const FunctionNode*>(qcn->findFunctionNode(path[2]));
@@ -231,7 +253,7 @@ const FunctionNode* Tree::findFunctionNode(const QStringList& path,
else
next = ((InnerNode*) node)->findChildNode(path.at(i), genus);
- if (!next && node->type() == Node::Class && (findFlags & SearchBaseClasses)) {
+ if (!next && node->isClass() && (findFlags & SearchBaseClasses)) {
NodeList baseClasses = allBaseClasses(static_cast<const ClassNode*>(node));
foreach (const Node* baseClass, baseClasses) {
if (i == path.size() - 1)
@@ -467,8 +489,8 @@ void Tree::resolveCppToQmlLinks()
{
foreach (Node* child, root_.childNodes()) {
- if (child->isQmlType()) {
- QmlClassNode* qcn = static_cast<QmlClassNode*>(child);
+ if (child->isQmlType() || child->isJsType()) {
+ QmlTypeNode* qcn = static_cast<QmlTypeNode*>(child);
ClassNode* cn = const_cast<ClassNode*>(qcn->classNode());
if (cn)
cn->setQmlElement(qcn);
@@ -477,6 +499,29 @@ void Tree::resolveCppToQmlLinks()
}
/*!
+ For each C++ class node, resolve any \c using clauses
+ that appeared in the class declaration.
+ */
+void Tree::resolveUsingClauses()
+{
+ foreach (Node* child, root_.childNodes()) {
+ if (child->isClass()) {
+ ClassNode* cn = static_cast<ClassNode*>(child);
+ QList<UsingClause>& usingClauses = cn->usingClauses();
+ QList<UsingClause>::iterator uc = usingClauses.begin();
+ while (uc != usingClauses.end()) {
+ if (!(*uc).node()) {
+ const Node* n = qdb_->findFunctionNode((*uc).signature(), cn, Node::CPP);
+ if (n)
+ (*uc).setNode(n);
+ }
+ ++uc;
+ }
+ }
+ }
+}
+
+/*!
*/
void Tree::fixInheritance(NamespaceNode* rootNode)
{
@@ -670,9 +715,9 @@ const Node* Tree::findNodeForTarget(const QStringList& path,
QString p;
if (path.size() > 1)
p = path.join(QString("::"));
- else {
+ else if ((genus == Node::DontCare) || (genus == Node::DOC)) {
p = path.at(0);
- node = findDocNodeByTitle(p);
+ node = findDocumentNodeByTitle(p);
if (node) {
if (!target.isEmpty()) {
ref = getRef(target, node);
@@ -707,8 +752,9 @@ const Node* Tree::findNodeForTarget(const QStringList& path,
type node.
*/
int path_idx = 0;
- if ((genus != Node::CPP) && (path.size() >= 2) && !path[0].isEmpty()) {
- QmlClassNode* qcn = lookupQmlType(QString(path[0] + "::" + path[1]));
+ if (((genus == Node::QML) || (genus == Node::DontCare)) &&
+ (path.size() >= 2) && !path[0].isEmpty()) {
+ QmlTypeNode* qcn = lookupQmlType(QString(path[0] + "::" + path[1]));
if (qcn) {
current = qcn;
if (path.size() == 2) {
@@ -716,8 +762,7 @@ const Node* Tree::findNodeForTarget(const QStringList& path,
ref = getRef(target, current);
if (!ref.isEmpty())
return current;
- else if (genus == Node::QML)
- return 0;
+ return 0;
}
else
return current;
@@ -803,7 +848,8 @@ const Node* Tree::matchPathAndTarget(const QStringList& path,
return t;
}
}
- if ((genus != Node::QML) && node->isClass() && (flags & SearchBaseClasses)) {
+ if (((genus == Node::CPP) || (genus == Node::DontCare)) &&
+ node->isClass() && (flags & SearchBaseClasses)) {
NodeList baseClasses = allBaseClasses(static_cast<const ClassNode*>(node));
foreach (const Node* bc, baseClasses) {
t = matchPathAndTarget(path, idx, target, bc, flags, genus, ref);
@@ -851,8 +897,9 @@ const Node* Tree::findNode(const QStringList& path,
If the answer is yes, the reference identifies a QML
type node.
*/
- if ((genus != Node::CPP) && (path.size() >= 2) && !path[0].isEmpty()) {
- QmlClassNode* qcn = lookupQmlType(QString(path[0] + "::" + path[1]));
+ if (((genus == Node::QML) || (genus == Node::DontCare)) &&
+ (path.size() >= 2) && !path[0].isEmpty()) {
+ QmlTypeNode* qcn = lookupQmlType(QString(path[0] + "::" + path[1]));
if (qcn) {
node = qcn;
if (path.size() == 2)
@@ -869,7 +916,8 @@ const Node* Tree::findNode(const QStringList& path,
if (!next && (findFlags & SearchEnumValues) && i == path.size()-1) {
next = static_cast<const InnerNode*>(node)->findEnumNodeForValue(path.at(i));
}
- if (!next && (genus != Node::QML) && node->isClass() && (findFlags & SearchBaseClasses)) {
+ if (!next && ((genus == Node::CPP) || (genus == Node::DontCare)) &&
+ node->isClass() && (findFlags & SearchBaseClasses)) {
NodeList baseClasses = allBaseClasses(static_cast<const ClassNode*>(node));
foreach (const Node* baseClass, baseClasses) {
next = static_cast<const InnerNode*>(baseClass)->findChildNode(path.at(i), genus);
@@ -942,12 +990,12 @@ void Tree::resolveTargets(InnerNode* root)
// need recursion
foreach (Node* child, root->childNodes()) {
if (child->type() == Node::Document) {
- DocNode* node = static_cast<DocNode*>(child);
+ DocumentNode* node = static_cast<DocumentNode*>(child);
QString key = node->title();
if (!key.isEmpty()) {
if (key.contains(QChar(' ')))
key = Doc::canonicalTitle(key);
- QList<DocNode*> nodes = docNodesByTitle_.values(key);
+ QList<DocumentNode*> nodes = docNodesByTitle_.values(key);
bool alreadyThere = false;
if (!nodes.empty()) {
for (int i=0; i< nodes.size(); ++i) {
@@ -1070,9 +1118,9 @@ Tree::findUnambiguousTarget(const QString& target, QString& ref) const
/*!
This function searches for a node with the specified \a title.
*/
-const DocNode* Tree::findDocNodeByTitle(const QString& title) const
+const DocumentNode* Tree::findDocumentNodeByTitle(const QString& title) const
{
- DocNodeMultiMap::const_iterator i;
+ DocumentNodeMultiMap::const_iterator i;
if (title.contains(QChar(' ')))
i = docNodesByTitle_.constFind(Doc::canonicalTitle(title));
else
@@ -1083,7 +1131,7 @@ const DocNode* Tree::findDocNodeByTitle(const QString& title) const
overkill. We should report the duplicate file and let
that suffice.
*/
- DocNodeMultiMap::const_iterator j = i;
+ DocumentNodeMultiMap::const_iterator j = i;
++j;
if (j != docNodesByTitle_.constEnd() && j.key() == i.key()) {
QList<Location> internalLocations;
@@ -1114,7 +1162,7 @@ QString Tree::refForAtom(const Atom* atom)
if (atom) {
if (atom->type() == Atom::SectionLeft)
return Doc::canonicalTitle(Text::sectionHeading(atom).toString());
- if (atom->type() == Atom::Target)
+ if ((atom->type() == Atom::Target) || (atom->type() == Atom::Keyword))
return Doc::canonicalTitle(atom->string());
}
return QString();
@@ -1139,62 +1187,89 @@ QString Tree::refForAtom(const Atom* atom)
*/
/*!
- Returns the collection node in this tree that has the same
- name and type as \a cn. Returns 0 if no match is found.
-
- If the matching node is \a cn, return 0.
- */
-CollectionNode* Tree::getCorrespondingCollection(CollectionNode* cn)
-{
- CollectionNode* ccn = 0;
- if (cn->isGroup())
- ccn = getGroup(cn->name());
- else if (cn->isModule())
- ccn = getModule(cn->name());
- else if (cn->isQmlModule())
- ccn = getQmlModule(cn->name());
- if (ccn == cn)
- ccn = 0;
- return ccn;
-}
-
-/*!
- Find the group node named \a name and return a pointer
- to it. If a matching node is not found, return 0.
+ Returns a pointer to the collection map specified by \a genus.
+ Returns null if \a genus is not specified.
*/
-GroupNode* Tree::getGroup(const QString& name)
+CNMap* Tree::getCollectionMap(Node::Genus genus)
{
- CNMap::const_iterator i = groups_.find(name);
- if (i != groups_.end())
- return static_cast<GroupNode*>(i.value());
+ switch (genus) {
+ case Node::DOC:
+ return &groups_;
+ case Node::CPP:
+ return &modules_;
+ case Node::QML:
+ return &qmlModules_;
+ case Node::JS:
+ return &jsModules_;
+ default:
+ break;
+ }
return 0;
}
/*!
- Find the module node named \a name and return a pointer
- to it. If a matching node is not found, return 0.
+ Returns a pointer to the collection named \a name of the
+ specified \a genus in this tree. If there is no matching
+ collection in this tree, 0 is returned.
*/
-ModuleNode* Tree::getModule(const QString& name)
+CollectionNode* Tree::getCollection(const QString& name, Node::Genus genus)
{
- CNMap::const_iterator i = modules_.find(name);
- if (i != modules_.end())
- return static_cast<ModuleNode*>(i.value());
+ CNMap* m = getCollectionMap(genus);
+ if (m) {
+ CNMap::const_iterator i = m->find(name);
+ if (i != m->end())
+ return i.value();
+ }
return 0;
}
/*!
- Find the QML module node named \a name and return a pointer
- to it. If a matching node is not found, return 0.
+ Find the group, module, QML module, or JavaScript module
+ named \a name and return a pointer to that collection node.
+ \a genus specifies which kind of collection node you want.
+ If a collection node with the specified \a name and \a genus
+ is not found, a new one is created, and the pointer to the
+ new one is returned.
+
+ If a new collection node is created, its parent is the tree
+ root, and the new collection node is marked \e{not seen}.
+
+ \a genus must be specified, i.e. it must not be \c{DontCare}.
+ If it is \c{DontCare}, 0 is returned, which is a programming
+ error.
*/
-QmlModuleNode* Tree::getQmlModule(const QString& name)
+CollectionNode* Tree::findCollection(const QString& name, Node::Genus genus)
{
- CNMap::const_iterator i = qmlModules_.find(name);
- if (i != qmlModules_.end())
- return static_cast<QmlModuleNode*>(i.value());
- return 0;
+ CNMap* m = getCollectionMap(genus);
+ if (!m) // error
+ return 0;
+ CNMap::const_iterator i = m->find(name);
+ if (i != m->end())
+ return i.value();
+ Node::Type t = Node::NoType;
+ switch (genus) {
+ case Node::DOC:
+ t = Node::Group;
+ break;
+ case Node::CPP:
+ t = Node::Module;
+ break;
+ case Node::QML:
+ t = Node::QmlModule;
+ break;
+ case Node::JS:
+ t = Node::QmlModule;
+ break;
+ default:
+ break;
+ }
+ CollectionNode* cn = new CollectionNode(t, root(), name, genus);
+ cn->markNotSeen();
+ m->insert(name, cn);
+ return cn;
}
-/*!
+/*! \fn CollectionNode* Tree::findGroup(const QString& name)
Find the group node named \a name and return a pointer
to it. If the group node is not found, add a new group
node named \a name and return a pointer to the new one.
@@ -1202,18 +1277,8 @@ QmlModuleNode* Tree::getQmlModule(const QString& name)
If a new group node is added, its parent is the tree root,
and the new group node is marked \e{not seen}.
*/
-GroupNode* Tree::findGroup(const QString& name)
-{
- CNMap::const_iterator i = groups_.find(name);
- if (i != groups_.end())
- return static_cast<GroupNode*>(i.value());;
- GroupNode* gn = new GroupNode(root(), name);
- gn->markNotSeen();
- groups_.insert(name, gn);
- return gn;
-}
-/*!
+/*! \fn CollectionNode* Tree::findModule(const QString& name)
Find the module node named \a name and return a pointer
to it. If a matching node is not found, add a new module
node named \a name and return a pointer to that one.
@@ -1221,77 +1286,56 @@ GroupNode* Tree::findGroup(const QString& name)
If a new module node is added, its parent is the tree root,
and the new module node is marked \e{not seen}.
*/
-ModuleNode* Tree::findModule(const QString& name)
-{
- CNMap::const_iterator i = modules_.find(name);
- if (i != modules_.end())
- return static_cast<ModuleNode*>(i.value());
- ModuleNode* mn = new ModuleNode(root(), name);
- mn->markNotSeen();
- modules_.insert(name, mn);
- return mn;
-}
-/*!
+/*! \fn CollectionNode* Tree::findQmlModule(const QString& name)
Find the QML module node named \a name and return a pointer
to it. If a matching node is not found, add a new QML module
node named \a name and return a pointer to that one.
If a new QML module node is added, its parent is the tree root,
- and the new QML module node is marked \e{not seen}.
+ and the new node is marked \e{not seen}.
*/
-QmlModuleNode* Tree::findQmlModule(const QString& name)
-{
- CNMap::const_iterator i = qmlModules_.find(name);
- if (i != qmlModules_.end())
- return static_cast<QmlModuleNode*>(i.value());
- QmlModuleNode* qmn = new QmlModuleNode(root(), name);
- qmn->markNotSeen();
- qmn->setQmlModuleInfo(name);
- qmlModules_.insert(name, qmn);
- return qmn;
-}
-/*!
+/*! \fn CollectionNode* Tree::findJsModule(const QString& name)
+ Find the JavaScript module named \a name and return a pointer
+ to it. If a matching node is not found, add a new JavaScript
+ module node named \a name and return a pointer to that one.
+
+ If a new JavaScript module node is added, its parent is the
+ tree root, and the new node is marked \e{not seen}.
+ */
+
+/*! \fn CollectionNode* Tree::addGroup(const QString& name)
Looks up the group node named \a name in the collection
of all group nodes. If a match is found, a pointer to the
node is returned. Otherwise, a new group node named \a name
is created and inserted into the collection, and the pointer
to that node is returned.
*/
-GroupNode* Tree::addGroup(const QString& name)
-{
- GroupNode* group = findGroup(name);
- return group;
-}
-/*!
+/*! \fn CollectionNode* Tree::addModule(const QString& name)
Looks up the module node named \a name in the collection
of all module nodes. If a match is found, a pointer to the
node is returned. Otherwise, a new module node named \a name
is created and inserted into the collection, and the pointer
to that node is returned.
*/
-ModuleNode* Tree::addModule(const QString& name)
-{
- ModuleNode* module = findModule(name);
- return module;
-}
-/*!
+/*! \fn CollectionNode* Tree::addQmlModule(const QString& name)
Looks up the QML module node named \a name in the collection
of all QML module nodes. If a match is found, a pointer to the
node is returned. Otherwise, a new QML module node named \a name
is created and inserted into the collection, and the pointer
to that node is returned.
*/
-QmlModuleNode* Tree::addQmlModule(const QString& name)
-{
- QStringList blankSplit = name.split(QLatin1Char(' '));
- QmlModuleNode* qmn = findQmlModule(blankSplit[0]);
- qmn->setQmlModuleInfo(name);
- return qmn;
-}
+
+/*! \fn CollectionNode* Tree::addJsModule(const QString& name)
+ Looks up the JavaScript module node named \a name in the collection
+ of all JavaScript module nodes. If a match is found, a pointer to the
+ node is returned. Otherwise, a new JavaScrpt module node named \a name
+ is created and inserted into the collection, and the pointer
+ to that node is returned.
+ */
/*!
Looks up the group node named \a name in the collection
@@ -1302,14 +1346,14 @@ QmlModuleNode* Tree::addQmlModule(const QString& name)
\a node is not changed by this function. Returns a pointer to
the group node.
*/
-GroupNode* Tree::addToGroup(const QString& name, Node* node)
+CollectionNode* Tree::addToGroup(const QString& name, Node* node)
{
- GroupNode* gn = findGroup(name);
+ CollectionNode* cn = findGroup(name);
if (!node->isInternal()) {
- gn->addMember(node);
+ cn->addMember(node);
node->appendGroupName(name);
}
- return gn;
+ return cn;
}
/*!
@@ -1319,12 +1363,12 @@ GroupNode* Tree::addToGroup(const QString& name, Node* node)
Then append \a node to the module's members list. The parent of
\a node is not changed by this function. Returns the module node.
*/
-ModuleNode* Tree::addToModule(const QString& name, Node* node)
+CollectionNode* Tree::addToModule(const QString& name, Node* node)
{
- ModuleNode* mn = findModule(name);
- mn->addMember(node);
- node->setModuleName(name);
- return mn;
+ CollectionNode* cn = findModule(name);
+ cn->addMember(node);
+ node->setPhysicalModuleName(name);
+ return cn;
}
/*!
@@ -1333,7 +1377,7 @@ ModuleNode* Tree::addToModule(const QString& name, Node* node)
list. The parent of \a node is not changed by this function.
Returns the pointer to the QML module node.
*/
-QmlModuleNode* Tree::addToQmlModule(const QString& name, Node* node)
+CollectionNode* Tree::addToQmlModule(const QString& name, Node* node)
{
QStringList qmid;
QStringList dotSplit;
@@ -1345,24 +1389,55 @@ QmlModuleNode* Tree::addToQmlModule(const QString& name, Node* node)
qmid.append(blankSplit[0] + dotSplit[0]);
}
- QmlModuleNode* qmn = findQmlModule(blankSplit[0]);
- qmn->addMember(node);
- node->setQmlModule(qmn);
+ CollectionNode* cn = findQmlModule(blankSplit[0]);
+ cn->addMember(node);
+ node->setQmlModule(cn);
if (node->isQmlType()) {
- QmlClassNode* n = static_cast<QmlClassNode*>(node);
+ QmlTypeNode* n = static_cast<QmlTypeNode*>(node);
+ for (int i=0; i<qmid.size(); ++i) {
+ QString key = qmid[i] + "::" + node->name();
+ insertQmlType(key, n);
+ }
+ }
+ return cn;
+}
+
+/*!
+ Looks up the QML module named \a name. If it isn't there,
+ create it. Then append \a node to the QML module's member
+ list. The parent of \a node is not changed by this function.
+ Returns the pointer to the QML module node.
+ */
+CollectionNode* Tree::addToJsModule(const QString& name, Node* node)
+{
+ QStringList qmid;
+ QStringList dotSplit;
+ QStringList blankSplit = name.split(QLatin1Char(' '));
+ qmid.append(blankSplit[0]);
+ if (blankSplit.size() > 1) {
+ qmid.append(blankSplit[0] + blankSplit[1]);
+ dotSplit = blankSplit[1].split(QLatin1Char('.'));
+ qmid.append(blankSplit[0] + dotSplit[0]);
+ }
+
+ CollectionNode* cn = findJsModule(blankSplit[0]);
+ cn->addMember(node);
+ node->setQmlModule(cn);
+ if (node->isJsType()) {
+ QmlTypeNode* n = static_cast<QmlTypeNode*>(node);
for (int i=0; i<qmid.size(); ++i) {
QString key = qmid[i] + "::" + node->name();
insertQmlType(key, n);
}
}
- return qmn;
+ return cn;
}
/*!
If the QML type map does not contain \a key, insert node
\a n with the specified \a key.
*/
-void Tree::insertQmlType(const QString& key, QmlClassNode* n)
+void Tree::insertQmlType(const QString& key, QmlTypeNode* n)
{
if (!qmlTypeMap_.contains(key))
qmlTypeMap_.insert(key,n);
@@ -1371,13 +1446,12 @@ void Tree::insertQmlType(const QString& key, QmlClassNode* n)
/*!
Split \a target on "::" and find the function node with that
path.
-
- Called in HtmlGenerator, DitaXmlGenerator, and QdocDatabase.
*/
const Node* Tree::findFunctionNode(const QString& target, const Node* relative, Node::Genus genus)
{
QString t = target;
- t.chop(2);
+ if (t.endsWith("()"))
+ t.chop(2);
QStringList path = t.split("::");
const FunctionNode* fn = findFunctionNode(path, relative, SearchBaseClasses, genus);
if (fn && fn->metaness() != FunctionNode::MacroWithoutParams)
@@ -1394,4 +1468,51 @@ const Node* Tree::checkForCollision(const QString& name)
return findNode(QStringList(name), 0, 0, Node::DontCare);
}
+/*!
+ Generate a target of the form link-nnn, where the nnn is
+ the current link count for this tree. This target string
+ is returned. It will be output as an HTML anchor just before
+ an HTML link to the node \a t.
+
+ The node \a t
+ */
+QString Tree::getNewLinkTarget(const Node* locNode,
+ const Node* t,
+ const QString& fileName,
+ QString& text,
+ bool broken)
+{
+ QString physicalModuleName;
+ if (t && !broken) {
+ Tree* tree = t->tree();
+ if (tree != this)
+ tree->incrementLinkCount();
+ physicalModuleName = tree->physicalModuleName();
+ }
+ else
+ physicalModuleName = "broken";
+ incrementLinkCount();
+ QString target = QString("qa-target-%1").arg(-(linkCount()));
+ TargetLoc* tloc = new TargetLoc(locNode, target, fileName, text, broken);
+ TargetList* tList = 0;
+ TargetListMap::iterator i = targetListMap_->find(physicalModuleName);
+ if (i == targetListMap_->end()) {
+ tList = new TargetList;
+ i = targetListMap_->insert(physicalModuleName, tList);
+ }
+ else
+ tList = i.value();
+ tList->append(tloc);
+ return target;
+}
+
+/*!
+ Look up the target list for the specified \a module
+ and return a pointer to it.
+ */
+TargetList* Tree::getTargetList(const QString& module)
+{
+ return targetListMap_->value(module);
+}
+
QT_END_NAMESPACE
diff --git a/src/tools/qdoc/tree.h b/src/tools/qdoc/tree.h
index 6bb13ee327..67063ef86a 100644
--- a/src/tools/qdoc/tree.h
+++ b/src/tools/qdoc/tree.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
@@ -67,10 +67,24 @@ struct TargetRec
Type type_;
};
+struct TargetLoc
+{
+ public:
+ TargetLoc(const Node* loc, const QString& t, const QString& fileName, const QString& text, bool broken)
+ : loc_(loc), target_(t), fileName_(fileName), text_(text), broken_(broken) { }
+ const Node* loc_;
+ QString target_;
+ QString fileName_;
+ QString text_;
+ bool broken_;
+};
+
typedef QMultiMap<QString, TargetRec*> TargetMap;
-typedef QMultiMap<QString, DocNode*> DocNodeMultiMap;
-typedef QMap<QString, QmlClassNode*> QmlTypeMap;
+typedef QMultiMap<QString, DocumentNode*> DocumentNodeMultiMap;
+typedef QMap<QString, QmlTypeNode*> QmlTypeMap;
typedef QMultiMap<QString, const ExampleNode*> ExampleNodeMap;
+typedef QVector<TargetLoc*> TargetList;
+typedef QMap<QString, TargetList*> TargetListMap;
class Tree
{
@@ -118,7 +132,7 @@ class Tree
int findFlags, // = 0,
Node::Genus genus) const; // = Node::DontCare) const;
- QmlClassNode* findQmlTypeNode(const QStringList& path);
+ QmlTypeNode* findQmlTypeNode(const QStringList& path);
Node* findNodeByNameAndType(const QStringList& path, Node::Type type) const;
InnerNode* findRelatesNode(const QStringList& path);
@@ -130,7 +144,7 @@ class Tree
int priority);
void resolveTargets(InnerNode* root);
const Node* findUnambiguousTarget(const QString& target, QString& ref) const;
- const DocNode* findDocNodeByTitle(const QString& title) const;
+ const DocumentNode* findDocumentNodeByTitle(const QString& title) const;
void addPropertyFunction(PropertyNode *property,
const QString &funcName,
@@ -139,6 +153,7 @@ class Tree
void resolveInheritanceHelper(int pass, ClassNode* cn);
void resolveProperties();
void resolveCppToQmlLinks();
+ void resolveUsingClauses();
void fixInheritance(NamespaceNode *rootNode = 0);
NamespaceNode *root() { return &root_; }
@@ -153,57 +168,75 @@ class Tree
NodeList allBaseClasses(const ClassNode *classe) const;
QString refForAtom(const Atom* atom);
+ CNMap* getCollectionMap(Node::Genus genus);
const CNMap& groups() const { return groups_; }
const CNMap& modules() const { return modules_; }
const CNMap& qmlModules() const { return qmlModules_; }
- const CNMap& getCollections(Node::Type t) const {
- if (t == Node::Group)
- return groups_;
- if (t == Node::Module)
- return modules_;
- return qmlModules_;
- }
-
- CollectionNode* getCorrespondingCollection(CollectionNode* cn);
-
- GroupNode* getGroup(const QString& name);
- ModuleNode* getModule(const QString& name);
- QmlModuleNode* getQmlModule(const QString& name);
-
- GroupNode* findGroup(const QString& name);
- ModuleNode* findModule(const QString& name);
- QmlModuleNode* findQmlModule(const QString& name);
-
- GroupNode* addGroup(const QString& name);
- ModuleNode* addModule(const QString& name);
- QmlModuleNode* addQmlModule(const QString& name);
-
- GroupNode* addToGroup(const QString& name, Node* node);
- ModuleNode* addToModule(const QString& name, Node* node);
- QmlModuleNode* addToQmlModule(const QString& name, Node* node);
-
- QmlClassNode* lookupQmlType(const QString& name) const { return qmlTypeMap_.value(name); }
- void insertQmlType(const QString& key, QmlClassNode* n);
+ const CNMap& jsModules() const { return jsModules_; }
+
+ CollectionNode* getCollection(const QString& name, Node::Genus genus);
+ CollectionNode* findCollection(const QString& name, Node::Genus genus);
+
+ CollectionNode* findGroup(const QString& name) { return findCollection(name, Node::DOC); }
+ CollectionNode* findModule(const QString& name) { return findCollection(name, Node::CPP); }
+ CollectionNode* findQmlModule(const QString& name) { return findCollection(name, Node::QML); }
+ CollectionNode* findJsModule(const QString& name) { return findCollection(name, Node::JS); }
+
+ CollectionNode* addGroup(const QString& name) { return findGroup(name); }
+ CollectionNode* addModule(const QString& name) { return findModule(name); }
+ CollectionNode* addQmlModule(const QString& name) { return findQmlModule(name); }
+ CollectionNode* addJsModule(const QString& name) { return findJsModule(name); }
+
+ CollectionNode* addToGroup(const QString& name, Node* node);
+ CollectionNode* addToModule(const QString& name, Node* node);
+ CollectionNode* addToQmlModule(const QString& name, Node* node);
+ CollectionNode* addToJsModule(const QString& name, Node* node);
+
+ QmlTypeNode* lookupQmlType(const QString& name) const { return qmlTypeMap_.value(name); }
+ void insertQmlType(const QString& key, QmlTypeNode* n);
void addExampleNode(ExampleNode* n) { exampleNodeMap_.insert(n->title(), n); }
ExampleNodeMap& exampleNodeMap() { return exampleNodeMap_; }
const Node* checkForCollision(const QString& name);
+ void setIndexFileName(const QString& t) { indexFileName_ = t; }
+
+ bool treeHasBeenAnalyzed() const { return treeHasBeenAnalyzed_; }
+ bool docsHaveBeenGenerated() const { return docsHaveBeenGenerated_; }
+ void setTreeHasBeenAnalyzed() { treeHasBeenAnalyzed_ = true; }
+ void setdocsHaveBeenGenerated() { docsHaveBeenGenerated_ = true; }
+ QString getNewLinkTarget(const Node* locNode,
+ const Node* t,
+ const QString& fileName,
+ QString& text,
+ bool broken);
+ TargetList* getTargetList(const QString& module);
+ QStringList getTargetListKeys() { return targetListMap_->keys(); }
public:
- const QString& moduleName() const { return module_; }
+ const QString& physicalModuleName() const { return physicalModuleName_; }
+ const QString& indexFileName() const { return indexFileName_; }
+ long incrementLinkCount() { return --linkCount_; }
+ void clearLinkCount() { linkCount_ = 0; }
+ long linkCount() const { return linkCount_; }
private:
- QString module_;
+ bool treeHasBeenAnalyzed_;
+ bool docsHaveBeenGenerated_;
+ long linkCount_;
+ QString physicalModuleName_;
+ QString indexFileName_;
QDocDatabase* qdb_;
NamespaceNode root_;
PropertyMap unresolvedPropertyMap;
- DocNodeMultiMap docNodesByTitle_;
+ DocumentNodeMultiMap docNodesByTitle_;
TargetMap nodesByTargetRef_;
TargetMap nodesByTargetTitle_;
CNMap groups_;
CNMap modules_;
CNMap qmlModules_;
+ CNMap jsModules_;
QmlTypeMap qmlTypeMap_;
ExampleNodeMap exampleNodeMap_;
+ TargetListMap* targetListMap_;
};
QT_END_NAMESPACE
diff --git a/src/tools/qdoc/yyindent.cpp b/src/tools/qdoc/yyindent.cpp
index 8ed9a43e42..e48a847088 100644
--- a/src/tools/qdoc/yyindent.cpp
+++ b/src/tools/qdoc/yyindent.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$