summaryrefslogtreecommitdiffstats
path: root/src/tools
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/bootstrap/bootstrap.pro1
-rw-r--r--src/tools/qdoc/atom.cpp24
-rw-r--r--src/tools/qdoc/atom.h26
-rw-r--r--src/tools/qdoc/codemarker.cpp7
-rw-r--r--src/tools/qdoc/codemarker.h12
-rw-r--r--src/tools/qdoc/codeparser.cpp27
-rw-r--r--src/tools/qdoc/config.cpp10
-rw-r--r--src/tools/qdoc/cppcodemarker.cpp26
-rw-r--r--src/tools/qdoc/cppcodemarker.h4
-rw-r--r--src/tools/qdoc/cppcodeparser.cpp134
-rw-r--r--src/tools/qdoc/cppcodeparser.h35
-rw-r--r--src/tools/qdoc/doc.cpp59
-rw-r--r--src/tools/qdoc/doc/qdoc-manual-cmdindex.qdoc1
-rw-r--r--src/tools/qdoc/doc/qdoc-manual-contextcmds.qdoc73
-rw-r--r--src/tools/qdoc/doc/qdoc-manual-markupcmds.qdoc14
-rw-r--r--src/tools/qdoc/generator.cpp222
-rw-r--r--src/tools/qdoc/generator.h19
-rw-r--r--src/tools/qdoc/helpprojectwriter.cpp76
-rw-r--r--src/tools/qdoc/helpprojectwriter.h4
-rw-r--r--src/tools/qdoc/htmlgenerator.cpp128
-rw-r--r--src/tools/qdoc/htmlgenerator.h19
-rw-r--r--src/tools/qdoc/jscodemarker.cpp6
-rw-r--r--src/tools/qdoc/jscodemarker.h2
-rw-r--r--src/tools/qdoc/location.cpp21
-rw-r--r--src/tools/qdoc/location.h4
-rw-r--r--src/tools/qdoc/main.cpp7
-rw-r--r--src/tools/qdoc/node.cpp624
-rw-r--r--src/tools/qdoc/node.h375
-rw-r--r--src/tools/qdoc/plaincodemarker.cpp4
-rw-r--r--src/tools/qdoc/plaincodemarker.h4
-rw-r--r--src/tools/qdoc/puredocparser.cpp8
-rw-r--r--src/tools/qdoc/qdocdatabase.cpp53
-rw-r--r--src/tools/qdoc/qdocdatabase.h30
-rw-r--r--src/tools/qdoc/qdocindexfiles.cpp75
-rw-r--r--src/tools/qdoc/qdoctagfiles.cpp14
-rw-r--r--src/tools/qdoc/qdoctagfiles.h6
-rw-r--r--src/tools/qdoc/qmlcodemarker.cpp8
-rw-r--r--src/tools/qdoc/qmlcodemarker.h4
-rw-r--r--src/tools/qdoc/qmlcodeparser.cpp2
-rw-r--r--src/tools/qdoc/qmlmarkupvisitor.cpp15
-rw-r--r--src/tools/qdoc/qmlmarkupvisitor.h4
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsastfwd_p.h45
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsengine_p.cpp3
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsengine_p.h6
-rw-r--r--src/tools/qdoc/qmlvisitor.cpp17
-rw-r--r--src/tools/qdoc/qmlvisitor.h2
-rw-r--r--src/tools/qdoc/text.cpp4
-rw-r--r--src/tools/qdoc/text.h4
-rw-r--r--src/tools/qdoc/tree.cpp73
-rw-r--r--src/tools/qdoc/tree.h18
-rw-r--r--src/tools/uic/cpp/cppwriteincludes.h1
-rw-r--r--src/tools/uic/uic.h1
52 files changed, 1241 insertions, 1120 deletions
diff --git a/src/tools/bootstrap/bootstrap.pro b/src/tools/bootstrap/bootstrap.pro
index a92e5b8f3d..be6bcadacb 100644
--- a/src/tools/bootstrap/bootstrap.pro
+++ b/src/tools/bootstrap/bootstrap.pro
@@ -97,6 +97,7 @@ SOURCES += \
../../corelib/tools/qlocale_tools.cpp \
../../corelib/tools/qmap.cpp \
../../corelib/tools/qregexp.cpp \
+ ../../corelib/tools/qringbuffer.cpp \
../../corelib/tools/qpoint.cpp \
../../corelib/tools/qrect.cpp \
../../corelib/tools/qsize.cpp \
diff --git a/src/tools/qdoc/atom.cpp b/src/tools/qdoc/atom.cpp
index 745da21b30..f50f401c5b 100644
--- a/src/tools/qdoc/atom.cpp
+++ b/src/tools/qdoc/atom.cpp
@@ -64,10 +64,8 @@ QT_BEGIN_NAMESPACE
\also Text
*/
-/*! \enum Atom::Type
+/*! \enum Atom::AtomType
- \value AbstractLeft
- \value AbstractRight
\value AnnotatedList
\value AutoLink
\value BaseName
@@ -149,8 +147,6 @@ static const struct {
const char *english;
int no;
} atms[] = {
- { "AbstractLeft", Atom::AbstractLeft },
- { "AbstractRight", Atom::AbstractRight },
{ "AnnotatedList", Atom::AnnotatedList },
{ "AutoLink", Atom::AutoLink },
{ "BaseName", Atom::BaseName },
@@ -237,27 +233,27 @@ static const struct {
{ 0, 0 }
};
-/*! \fn Atom::Atom(Type type, const QString& string)
+/*! \fn Atom::Atom(AtomType type, const QString& string)
Constructs an atom of the specified \a type with the single
parameter \a string and does not put the new atom in a list.
*/
-/*! \fn Atom::Atom(Type type, const QString& p1, const QString& p2)
+/*! \fn Atom::Atom(AtomType type, const QString& p1, const QString& p2)
Constructs an atom of the specified \a type with the two
parameters \a p1 and \a p2 and does not put the new atom
in a list.
*/
-/*! \fn Atom(Atom *previous, Type type, const QString& string)
+/*! \fn Atom(Atom *previous, AtomType type, const QString& string)
Constructs an atom of the specified \a type with the single
parameter \a string and inserts the new atom into the list
after the \a previous atom.
*/
-/*! \fn Atom::Atom(Atom* previous, Type type, const QString& p1, const QString& p2)
+/*! \fn Atom::Atom(Atom* previous, AtomType type, const QString& p1, const QString& p2)
Constructs an atom of the specified \a type with the two
parameters \a p1 and \a p2 and inserts the new atom into
@@ -289,19 +285,19 @@ static const struct {
*/
/*!
- Return the next Atom in the list if it is of Type \a t.
+ Return the next Atom in the list if it is of AtomType \a t.
Otherwise return 0.
*/
-const Atom* Atom::next(Type t) const
+const Atom* Atom::next(AtomType t) const
{
return (next_ && (next_->type() == t)) ? next_ : 0;
}
/*!
- Return the next Atom in the list if it is of Type \a t
+ Return the next Atom in the list if it is of AtomType \a t
and its string part is \a s. Otherwise return 0.
*/
-const Atom* Atom::next(Type t, const QString& s) const
+const Atom* Atom::next(AtomType t, const QString& s) const
{
return (next_ && (next_->type() == t) && (next_->string() == s)) ? next_ : 0;
}
@@ -311,7 +307,7 @@ const Atom* Atom::next(Type t, const QString& s) const
\also type(), string()
*/
-/*! \fn Type Atom::type() const
+/*! \fn AtomType Atom::type() const
Return the type of this atom.
\also string(), next()
*/
diff --git a/src/tools/qdoc/atom.h b/src/tools/qdoc/atom.h
index ebbba8917e..86b8ba7b3c 100644
--- a/src/tools/qdoc/atom.h
+++ b/src/tools/qdoc/atom.h
@@ -46,9 +46,7 @@ class LinkAtom;
class Atom
{
public:
- enum Type {
- AbstractLeft,
- AbstractRight,
+ enum AtomType {
AnnotatedList,
AutoLink,
BaseName,
@@ -143,13 +141,13 @@ public:
strs << string;
}
- Atom(Type type, const QString& string = "")
+ Atom(AtomType type, const QString& string = "")
: next_(0), type_(type)
{
strs << string;
}
- Atom(Type type, const QString& p1, const QString& p2)
+ Atom(AtomType type, const QString& p1, const QString& p2)
: next_(0), type_(type)
{
strs << p1;
@@ -157,14 +155,14 @@ public:
strs << p2;
}
- Atom(Atom* previous, Type type, const QString& string = "")
+ Atom(Atom* previous, AtomType type, const QString& string = "")
: next_(previous->next_), type_(type)
{
strs << string;
previous->next_ = this;
}
- Atom(Atom* previous, Type type, const QString& p1, const QString& p2)
+ Atom(Atom* previous, AtomType type, const QString& p1, const QString& p2)
: next_(previous->next_), type_(type)
{
strs << p1;
@@ -183,9 +181,9 @@ public:
void setNext(Atom* newNext) { next_ = newNext; }
const Atom* next() const { return next_; }
- const Atom* next(Type t) const;
- const Atom* next(Type t, const QString& s) const;
- Type type() const { return type_; }
+ const Atom* next(AtomType t) const;
+ const Atom* next(AtomType t, const QString& s) const;
+ AtomType type() const { return type_; }
QString typeString() const;
const QString& string() const { return strs[0]; }
const QString& string(int i) const { return strs[i]; }
@@ -197,14 +195,14 @@ public:
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 Node::NodeType goal() { return Node::NoType; }
virtual const QString& error() { return noError_; }
virtual void resolveSquareBracketParams() { }
protected:
static QString noError_;
Atom* next_;
- Type type_;
+ AtomType type_;
QStringList strs;
};
@@ -220,14 +218,14 @@ class LinkAtom : public Atom
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 Node::NodeType 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_;
+ Node::NodeType goal_;
Tree* domain_;
QString error_;
QString squareBracketParams_;
diff --git a/src/tools/qdoc/codemarker.cpp b/src/tools/qdoc/codemarker.cpp
index 2253aca183..56fd3505be 100644
--- a/src/tools/qdoc/codemarker.cpp
+++ b/src/tools/qdoc/codemarker.cpp
@@ -361,8 +361,7 @@ QString CodeMarker::sortName(const Node *node, const QString* name)
else
sortNo = QLatin1String("E");
}
- return sortNo + nodeName + QLatin1Char(' ')
- + QString::number(func->overloadNumber(), 36);
+ return sortNo + nodeName + QLatin1Char(' ') + QString::number(func->overloadNumber(), 36);
}
if (node->type() == Node::Class)
@@ -390,7 +389,7 @@ void CodeMarker::insert(FastSection &fastSection,
bool irrelevant = false;
bool inheritedMember = false;
if (!node->relates()) {
- InnerNode* p = node->parent();
+ Aggregate* p = node->parent();
if (p->isQmlPropertyGroup())
p = p->parent();
if (p != fastSection.parent_) {
@@ -440,7 +439,7 @@ void CodeMarker::insert(FastSection &fastSection,
if (node->parent()->isClass() || node->parent()->isNamespace()) {
if (fastSection.inherited.isEmpty()
|| fastSection.inherited.last().first != node->parent()) {
- QPair<InnerNode *, int> p(node->parent(), 0);
+ QPair<Aggregate *, int> p(node->parent(), 0);
fastSection.inherited.append(p);
}
fastSection.inherited.last().second++;
diff --git a/src/tools/qdoc/codemarker.h b/src/tools/qdoc/codemarker.h
index 7983aa532c..c5226fff04 100644
--- a/src/tools/qdoc/codemarker.h
+++ b/src/tools/qdoc/codemarker.h
@@ -64,7 +64,7 @@ struct Section
QStringList keys;
NodeList members;
NodeList reimpMembers;
- QList<QPair<InnerNode *, int> > inherited;
+ QList<QPair<Aggregate *, int> > inherited;
ClassKeysNodesList classKeysNodesList_;
Section() { }
@@ -83,7 +83,7 @@ struct Section
struct FastSection
{
- const InnerNode *parent_;
+ const Aggregate *parent_;
QString name;
QString divClass;
QString singularMember;
@@ -91,9 +91,9 @@ struct FastSection
QMultiMap<QString, Node *> memberMap;
QMultiMap<QString, Node *> reimpMemberMap;
ClassMapList classMapList_;
- QList<QPair<InnerNode *, int> > inherited;
+ QList<QPair<Aggregate *, int> > inherited;
- FastSection(const InnerNode *parent,
+ FastSection(const Aggregate *parent,
const QString& name0,
const QString& divClass0,
const QString& singularMember0,
@@ -127,7 +127,7 @@ public:
virtual bool recognizeCode(const QString& code) = 0;
virtual bool recognizeExtension(const QString& ext) = 0;
virtual bool recognizeLanguage(const QString& lang) = 0;
- virtual Atom::Type atomType() const = 0;
+ virtual Atom::AtomType atomType() const = 0;
virtual QString markedUpCode(const QString& code,
const Node *relative,
const Location &location) = 0;
@@ -143,7 +143,7 @@ public:
virtual QString markedUpIncludes(const QStringList& includes) = 0;
virtual QString functionBeginRegExp(const QString& funcName) = 0;
virtual QString functionEndRegExp(const QString& funcName) = 0;
- virtual QList<Section> sections(const InnerNode *inner,
+ virtual QList<Section> sections(const Aggregate *inner,
SynopsisStyle style,
Status status) = 0;
virtual QList<Section> qmlSections(QmlTypeNode* qmlTypeNode,
diff --git a/src/tools/qdoc/codeparser.cpp b/src/tools/qdoc/codeparser.cpp
index a99a446cc2..4f80ec80d9 100644
--- a/src/tools/qdoc/codeparser.cpp
+++ b/src/tools/qdoc/codeparser.cpp
@@ -423,33 +423,6 @@ void CodeParser::checkModuleInclusion(Node* n)
.arg(n->name()).arg(Generator::defaultModuleName()));
}
break;
-#if 0
- case Node::Document:
- if (n->access() != Node::Private && !n->doc().isEmpty()) {
- if (n->subType() == Node::HeaderFile) {
-#if 0
- n->doc().location().warning(tr("Header file with title \"%1\" has no \\inmodule command; "
- "using project name by default: %2")
- .arg(n->title()).arg(Generator::defaultModuleName()));
-#endif
- }
- else if (n->subType() == Node::Page) {
-#if 0
- n->doc().location().warning(tr("Page with title \"%1\" has no \\inmodule command; "
- "using project name by default: %2")
- .arg(n->title()).arg(Generator::defaultModuleName()));
-#endif
- }
- else if (n->subType() == Node::Example) {
-#if 0
- n->doc().location().warning(tr("Example with title \"%1\" has no \\inmodule command; "
- "using project name by default: %2")
- .arg(n->title()).arg(Generator::defaultModuleName()));
-#endif
- }
- }
- break;
-#endif
default:
break;
}
diff --git a/src/tools/qdoc/config.cpp b/src/tools/qdoc/config.cpp
index 606bb1c619..13add73322 100644
--- a/src/tools/qdoc/config.cpp
+++ b/src/tools/qdoc/config.cpp
@@ -912,8 +912,10 @@ QStringList Config::loadMaster(const QString& fileName)
*/
void Config::load(Location location, const QString& fileName)
{
- pushWorkingDir(QFileInfo(fileName).path());
- QDir::setCurrent(QFileInfo(fileName).path());
+ QFileInfo fileInfo(fileName);
+ QString path = fileInfo.canonicalPath();
+ pushWorkingDir(path);
+ QDir::setCurrent(path);
QRegExp keySyntax(QLatin1String("\\w+(?:\\.\\w+)*"));
#define SKIP_CHAR() \
@@ -935,7 +937,7 @@ void Config::load(Location location, const QString& fileName)
if (location.depth() > 16)
location.fatal(tr("Too many nested includes"));
- QFile fin(fileName);
+ QFile fin(fileInfo.fileName());
if (!fin.open(QFile::ReadOnly | QFile::Text)) {
if (!Config::installDir.isEmpty()) {
int prefix = location.filePath().length() - location.fileName().length();
@@ -1030,7 +1032,7 @@ void Config::load(Location location, const QString& fileName)
/*
Here is the recursive call.
*/
- load(location, QFileInfo(QFileInfo(fileName).dir(), includeFile).filePath());
+ load(location, QFileInfo(QDir(path), includeFile).filePath());
}
else {
/*
diff --git a/src/tools/qdoc/cppcodemarker.cpp b/src/tools/qdoc/cppcodemarker.cpp
index 4c1e84fe3c..9aec902860 100644
--- a/src/tools/qdoc/cppcodemarker.cpp
+++ b/src/tools/qdoc/cppcodemarker.cpp
@@ -103,7 +103,7 @@ bool CppCodeMarker::recognizeLanguage(const QString &lang)
/*!
Returns the type of atom used to represent C++ code in the documentation.
*/
-Atom::Type CppCodeMarker::atomType() const
+Atom::AtomType CppCodeMarker::atomType() const
{
return Atom::Code;
}
@@ -436,7 +436,7 @@ QString CppCodeMarker::functionEndRegExp(const QString& /* funcName */)
return "^\\}$";
}
-QList<Section> CppCodeMarker::sections(const InnerNode *inner,
+QList<Section> CppCodeMarker::sections(const Aggregate *inner,
SynopsisStyle style,
Status status)
{
@@ -522,10 +522,10 @@ QList<Section> CppCodeMarker::sections(const InnerNode *inner,
++r;
}
- QStack<const InnerNode *> stack;
+ QStack<const Aggregate *> stack;
stack.push(inner);
while (!stack.isEmpty()) {
- const InnerNode* ancestor = stack.pop();
+ const Aggregate* ancestor = stack.pop();
NodeList::ConstIterator c = ancestor->childNodes().constBegin();
while (c != ancestor->childNodes().constEnd()) {
@@ -537,11 +537,9 @@ QList<Section> CppCodeMarker::sections(const InnerNode *inner,
isSlot = (func->metaness() == FunctionNode::Slot);
isSignal = (func->metaness() == FunctionNode::Signal);
isStatic = func->isStatic();
- if (func->associatedProperty()) {
- if (func->associatedProperty()->status() == Node::Obsolete) {
- ++c;
- continue;
- }
+ if (func->hasAssociatedProperties() && !func->hasActiveAssociatedProperty()) {
+ ++c;
+ continue;
}
}
else if ((*c)->type() == Node::Variable) {
@@ -685,7 +683,7 @@ QList<Section> CppCodeMarker::sections(const InnerNode *inner,
}
else if ((*c)->type() == Node::Function) {
FunctionNode *function = static_cast<FunctionNode *>(*c);
- if (!function->associatedProperty())
+ if (!function->hasAssociatedProperties() || !function->doc().isEmpty())
insert(memberFunctions, function, style, status);
}
++c;
@@ -701,11 +699,11 @@ QList<Section> CppCodeMarker::sections(const InnerNode *inner,
else {
FastSection all(inner,QString(),QString(),"member","members");
- QStack<const InnerNode*> stack;
+ QStack<const Aggregate*> stack;
stack.push(inner);
while (!stack.isEmpty()) {
- const InnerNode* ancestor = stack.pop();
+ const Aggregate* ancestor = stack.pop();
NodeList::ConstIterator c = ancestor->childNodes().constBegin();
while (c != ancestor->childNodes().constEnd()) {
if ((*c)->access() != Node::Private && (*c)->type() != Node::Property)
@@ -812,8 +810,8 @@ QList<Section> CppCodeMarker::sections(const InnerNode *inner,
if (!ns->orphans().isEmpty()) {
foreach (Node* n, ns->orphans()) {
// Use inner as a temporary parent when inserting orphans
- InnerNode* p = n->parent();
- n->setParent(const_cast<InnerNode*>(inner));
+ Aggregate* p = n->parent();
+ n->setParent(const_cast<Aggregate*>(inner));
if (n->isClass())
insert(classes, n, style, status);
else if (n->isNamespace())
diff --git a/src/tools/qdoc/cppcodemarker.h b/src/tools/qdoc/cppcodemarker.h
index 509d130a27..aa759f2993 100644
--- a/src/tools/qdoc/cppcodemarker.h
+++ b/src/tools/qdoc/cppcodemarker.h
@@ -53,7 +53,7 @@ public:
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 Atom::AtomType atomType() const Q_DECL_OVERRIDE;
virtual QString markedUpCode(const QString& code,
const Node *relative,
const Location &location) Q_DECL_OVERRIDE;
@@ -67,7 +67,7 @@ public:
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,
+ virtual QList<Section> sections(const Aggregate *innerNode,
SynopsisStyle style,
Status status) Q_DECL_OVERRIDE;
virtual QList<Section> qmlSections(QmlTypeNode* qmlTypeNode,
diff --git a/src/tools/qdoc/cppcodeparser.cpp b/src/tools/qdoc/cppcodeparser.cpp
index f12fb70227..ab79f8f320 100644
--- a/src/tools/qdoc/cppcodeparser.cpp
+++ b/src/tools/qdoc/cppcodeparser.cpp
@@ -250,16 +250,11 @@ void CppCodeParser::doneParsingHeaderFiles()
/*!
This is called after all the source files (i.e., not the
- header files) have been parsed. It traverses the tree to
- resolve property links, normalize overload signatures, and
- do other housekeeping of the database.
+ header files) have been parsed. Currently nothing to do.
*/
void CppCodeParser::doneParsingSourceFiles()
{
- qdb_->primaryTreeRoot()->normalizeOverloads();
- qdb_->fixInheritance();
- qdb_->resolveProperties();
- qdb_->primaryTreeRoot()->makeUndocumentedChildrenInternal();
+ // contents moved to QdocDatabase::resolveIssues()
}
static QSet<QString> topicCommands_;
@@ -408,7 +403,7 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc,
this way to allow the writer to refer to the entity
without including the namespace qualifier.
*/
- Node::Type type = nodeTypeMap[command];
+ Node::NodeType type = nodeTypeMap[command];
QStringList paths = arg.first.split(QLatin1Char(' '));
QStringList path = paths[0].split("::");
Node *node = 0;
@@ -422,7 +417,7 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc,
lastPath_ = path;
}
- else if (node->isInnerNode()) {
+ else if (node->isAggregate()) {
if (type == Node::Namespace) {
NamespaceNode* ns = static_cast<NamespaceNode*>(node);
ns->markSeen();
@@ -520,16 +515,6 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc,
else if (t == "ditamap")
ptype = Node::DitaMapPage;
}
-
-#if 0
- const Node* n = qdb_->checkForCollision(args[0]);
- if (n) {
- QString other = n->doc().location().fileName();
- doc.location().warning(tr("Name/title collision detected: '%1' in '\\%2'")
- .arg(args[0]).arg(command),
- tr("Also used here: %1").arg(other));
- }
-#endif
DocumentNode* dn = 0;
if (ptype == Node::DitaMapPage)
dn = new DitaMapNode(qdb_->primaryTreeRoot(), args[0]);
@@ -572,7 +557,7 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc,
QmlTypeNode* qmlType = qdb_->findQmlType(module, qmlTypeName);
if (qmlType) {
bool attached = false;
- Node::Type nodeType = Node::QmlMethod;
+ Node::NodeType nodeType = Node::QmlMethod;
if ((command == COMMAND_QMLSIGNAL) ||
(command == COMMAND_JSSIGNAL))
nodeType = Node::QmlSignal;
@@ -870,7 +855,8 @@ const QSet<QString>& CppCodeParser::otherMetaCommands()
<< COMMAND_QMLINSTANTIATES
<< COMMAND_QMLDEFAULT
<< COMMAND_QMLREADONLY
- << COMMAND_QMLABSTRACT;
+ << COMMAND_QMLABSTRACT
+ << COMMAND_ABSTRACT;
}
return otherMetaCommands_;
}
@@ -887,22 +873,18 @@ void CppCodeParser::processOtherMetaCommand(const Doc& doc,
{
QString arg = argLocPair.first;
if (command == COMMAND_INHEADERFILE) {
- if (node != 0 && node->isInnerNode()) {
- ((InnerNode *) node)->addInclude(arg);
+ if (node != 0 && node->isAggregate()) {
+ ((Aggregate *) node)->addInclude(arg);
}
else {
- doc.location().warning(tr("Ignored '\\%1'")
- .arg(COMMAND_INHEADERFILE));
+ doc.location().warning(tr("Ignored '\\%1'").arg(COMMAND_INHEADERFILE));
}
}
else if (command == COMMAND_OVERLOAD) {
- if (node != 0 && node->type() == Node::Function) {
- ((FunctionNode *) node)->setOverload(true);
- }
- else {
- doc.location().warning(tr("Ignored '\\%1'")
- .arg(COMMAND_OVERLOAD));
- }
+ if (node && node->isFunction())
+ ((FunctionNode *) node)->setOverloadFlag(true);
+ else
+ doc.location().warning(tr("Ignored '\\%1'").arg(COMMAND_OVERLOAD));
}
else if (command == COMMAND_REIMP) {
if (node != 0 && node->parent() && !node->parent()->isInternal()) {
@@ -928,12 +910,10 @@ void CppCodeParser::processOtherMetaCommand(const Doc& doc,
"because its base function is private "
"or internal").arg(COMMAND_REIMP).arg(node->name()));
}
- func->setReimp(true);
+ func->setReimplemented(true);
}
else {
- doc.location().warning(tr("Ignored '\\%1' in %2")
- .arg(COMMAND_REIMP)
- .arg(node->name()));
+ doc.location().warning(tr("Ignored '\\%1' in %2").arg(COMMAND_REIMP).arg(node->name()));
}
}
}
@@ -943,7 +923,7 @@ void CppCodeParser::processOtherMetaCommand(const Doc& doc,
if (!n)
doc.location().warning(tr("Cannot find '%1' in '\\%2'").arg(arg).arg(COMMAND_RELATES));
else
- node->setRelates(static_cast<InnerNode*>(n));
+ node->setRelates(static_cast<Aggregate*>(n));
}
else if (command == COMMAND_CONTENTSPAGE) {
setLink(node, Node::ContentsLink, arg);
@@ -1014,7 +994,7 @@ void CppCodeParser::processOtherMetaCommand(const Doc& doc,
}
}
}
- else if (command == COMMAND_QMLABSTRACT) {
+ else if ((command == COMMAND_QMLABSTRACT) || (command == COMMAND_ABSTRACT)) {
if (node->isQmlType() || node->isJsType())
node->setAbstract(true);
}
@@ -1051,7 +1031,7 @@ void CppCodeParser::reset()
tokenizer = 0;
tok = 0;
access = Node::Public;
- metaness = FunctionNode::Plain;
+ metaness_ = FunctionNode::Plain;
lastPath_.clear();
physicalModuleName.clear();
}
@@ -1353,7 +1333,7 @@ bool CppCodeParser::matchParameter(FunctionNode *func)
return true;
}
-bool CppCodeParser::matchFunctionDecl(InnerNode *parent,
+bool CppCodeParser::matchFunctionDecl(Aggregate *parent,
QStringList *parentPathPtr,
FunctionNode **funcPtr,
const QString &templateStuff,
@@ -1378,7 +1358,7 @@ bool CppCodeParser::matchFunctionDecl(InnerNode *parent,
}
FunctionNode::Virtualness vir = FunctionNode::NonVirtual;
if (match(Tok_virtual)) {
- vir = FunctionNode::ImpureVirtual;
+ vir = FunctionNode::NormalVirtual;
if (matchCompat())
compat = true;
}
@@ -1516,7 +1496,7 @@ bool CppCodeParser::matchFunctionDecl(InnerNode *parent,
if (compat)
func->setStatus(Node::Compat);
- func->setMetaness(metaness);
+ func->setMetaness(metaness_);
if (parent) {
if (name == parent->name()) {
func->setMetaness(FunctionNode::Ctor);
@@ -1616,7 +1596,7 @@ bool CppCodeParser::matchBaseList(ClassNode *classe, bool isClass)
sufficient for Qt because there are no cases of class nesting more
than one level deep.
*/
-bool CppCodeParser::matchClassDecl(InnerNode *parent,
+bool CppCodeParser::matchClassDecl(Aggregate *parent,
const QString &templateStuff)
{
bool isClass = (tok == Tok_class);
@@ -1631,7 +1611,7 @@ bool CppCodeParser::matchClassDecl(InnerNode *parent,
if (tok == Tok_Gulbrandsen) {
Node* n = parent->findChildNode(previousLexeme(),Node::Class);
if (n) {
- parent = static_cast<InnerNode*>(n);
+ parent = static_cast<Aggregate*>(n);
if (parent) {
readToken();
if (tok != Tok_Ident)
@@ -1663,17 +1643,17 @@ bool CppCodeParser::matchClassDecl(InnerNode *parent,
Node::Access outerAccess = access;
access = isClass ? Node::Private : Node::Public;
- FunctionNode::Metaness outerMetaness = metaness;
- metaness = FunctionNode::Plain;
+ FunctionNode::Metaness outerMetaness = metaness_;
+ metaness_ = FunctionNode::Plain;
bool matches = (matchDeclList(classe) && match(Tok_RightBrace) &&
match(Tok_Semicolon));
access = outerAccess;
- metaness = outerMetaness;
+ metaness_ = outerMetaness;
return matches;
}
-bool CppCodeParser::matchNamespaceDecl(InnerNode *parent)
+bool CppCodeParser::matchNamespaceDecl(Aggregate *parent)
{
readToken(); // skip 'namespace'
if (tok != Tok_Ident)
@@ -1712,7 +1692,7 @@ bool CppCodeParser::matchNamespaceDecl(InnerNode *parent)
member function is added to \a parent as an unresolved
\c using clause.
*/
-bool CppCodeParser::matchUsingDecl(InnerNode* parent)
+bool CppCodeParser::matchUsingDecl(Aggregate* parent)
{
bool usingNamespace = false;
readToken(); // skip 'using'
@@ -1774,17 +1754,25 @@ bool CppCodeParser::matchUsingDecl(InnerNode* parent)
return true;
}
-bool CppCodeParser::matchEnumItem(InnerNode *parent, EnumNode *enume)
+bool CppCodeParser::matchEnumItem(Aggregate *parent, EnumNode *enume)
{
if (!match(Tok_Ident))
return false;
QString name = previousLexeme();
CodeChunk val;
+ int parenLevel = 0;
if (match(Tok_Equal)) {
- while (tok != Tok_Comma && tok != Tok_RightBrace &&
- tok != Tok_Eoi) {
+ while (tok != Tok_RightBrace && tok != Tok_Eoi) {
+ if (tok == Tok_LeftParen)
+ parenLevel++;
+ else if (tok == Tok_RightParen)
+ parenLevel--;
+ else if (tok == Tok_Comma) {
+ if (parenLevel <= 0)
+ break;
+ }
val.append(lexeme());
readToken();
}
@@ -1825,7 +1813,7 @@ bool CppCodeParser::matchEnumItem(InnerNode *parent, EnumNode *enume)
return true;
}
-bool CppCodeParser::matchEnumDecl(InnerNode *parent)
+bool CppCodeParser::matchEnumDecl(Aggregate *parent)
{
QString name;
@@ -1856,7 +1844,7 @@ bool CppCodeParser::matchEnumDecl(InnerNode *parent)
return match(Tok_RightBrace) && match(Tok_Semicolon);
}
-bool CppCodeParser::matchTypedefDecl(InnerNode *parent)
+bool CppCodeParser::matchTypedefDecl(Aggregate *parent)
{
CodeChunk dataType;
QString name;
@@ -1876,7 +1864,7 @@ bool CppCodeParser::matchTypedefDecl(InnerNode *parent)
return true;
}
-bool CppCodeParser::matchProperty(InnerNode *parent)
+bool CppCodeParser::matchProperty(Aggregate *parent)
{
int expected_tok = Tok_LeftParen;
if (match(Tok_Q_PRIVATE_PROPERTY)) {
@@ -1989,7 +1977,7 @@ bool CppCodeParser::matchProperty(InnerNode *parent)
/*!
Parse a C++ declaration.
*/
-bool CppCodeParser::matchDeclList(InnerNode *parent)
+bool CppCodeParser::matchDeclList(Aggregate *parent)
{
ExtraFuncData extra;
QString templateStuff;
@@ -2030,28 +2018,28 @@ bool CppCodeParser::matchDeclList(InnerNode *parent)
case Tok_private:
readToken();
access = Node::Private;
- metaness = FunctionNode::Plain;
+ metaness_ = FunctionNode::Plain;
break;
case Tok_protected:
readToken();
access = Node::Protected;
- metaness = FunctionNode::Plain;
+ metaness_ = FunctionNode::Plain;
break;
case Tok_public:
readToken();
access = Node::Public;
- metaness = FunctionNode::Plain;
+ metaness_ = FunctionNode::Plain;
break;
case Tok_signals:
case Tok_Q_SIGNALS:
readToken();
access = Node::Public;
- metaness = FunctionNode::Signal;
+ metaness_ = FunctionNode::Signal;
break;
case Tok_slots:
case Tok_Q_SLOTS:
readToken();
- metaness = FunctionNode::Slot;
+ metaness_ = FunctionNode::Slot;
break;
case Tok_Q_OBJECT:
readToken();
@@ -2069,29 +2057,25 @@ bool CppCodeParser::matchDeclList(InnerNode *parent)
case Tok_Q_DECLARE_SEQUENTIAL_ITERATOR:
readToken();
if (match(Tok_LeftParen) && match(Tok_Ident))
- sequentialIteratorClasses.insert(previousLexeme(),
- location().fileName());
+ sequentialIteratorClasses.insert(previousLexeme(), location().fileName());
match(Tok_RightParen);
break;
case Tok_Q_DECLARE_MUTABLE_SEQUENTIAL_ITERATOR:
readToken();
if (match(Tok_LeftParen) && match(Tok_Ident))
- mutableSequentialIteratorClasses.insert(previousLexeme(),
- location().fileName());
+ mutableSequentialIteratorClasses.insert(previousLexeme(), location().fileName());
match(Tok_RightParen);
break;
case Tok_Q_DECLARE_ASSOCIATIVE_ITERATOR:
readToken();
if (match(Tok_LeftParen) && match(Tok_Ident))
- associativeIteratorClasses.insert(previousLexeme(),
- location().fileName());
+ associativeIteratorClasses.insert(previousLexeme(), location().fileName());
match(Tok_RightParen);
break;
case Tok_Q_DECLARE_MUTABLE_ASSOCIATIVE_ITERATOR:
readToken();
if (match(Tok_LeftParen) && match(Tok_Ident))
- mutableAssociativeIteratorClasses.insert(previousLexeme(),
- location().fileName());
+ mutableAssociativeIteratorClasses.insert(previousLexeme(), location().fileName());
match(Tok_RightParen);
break;
case Tok_Q_DECLARE_FLAGS:
@@ -2256,15 +2240,15 @@ bool CppCodeParser::matchDocsAndStuff()
processOtherMetaCommands(*d, *n);
(*n)->setDoc(*d);
checkModuleInclusion(*n);
- if ((*n)->isInnerNode() && ((InnerNode *)*n)->includes().isEmpty()) {
- InnerNode *m = static_cast<InnerNode *>(*n);
+ if ((*n)->isAggregate() && ((Aggregate *)*n)->includes().isEmpty()) {
+ Aggregate *m = static_cast<Aggregate *>(*n);
while (m->parent() && m->physicalModuleName().isEmpty()) {
m = m->parent();
}
if (m == *n)
- ((InnerNode *)*n)->addInclude((*n)->name());
+ ((Aggregate *)*n)->addInclude((*n)->name());
else
- ((InnerNode *)*n)->setIncludes(m->includes());
+ ((Aggregate *)*n)->setIncludes(m->includes());
}
++d;
++n;
@@ -2346,8 +2330,8 @@ bool CppCodeParser::makeFunctionNode(const QString& signature,
*/
FunctionNode* CppCodeParser::makeFunctionNode(const Doc& doc,
const QString& sig,
- InnerNode* parent,
- Node::Type type,
+ Aggregate* parent,
+ Node::NodeType type,
bool attached,
QString qdoctag)
{
diff --git a/src/tools/qdoc/cppcodeparser.h b/src/tools/qdoc/cppcodeparser.h
index f9ddcab88c..31964699a2 100644
--- a/src/tools/qdoc/cppcodeparser.h
+++ b/src/tools/qdoc/cppcodeparser.h
@@ -44,7 +44,7 @@ class ClassNode;
class CodeChunk;
class CppCodeParserPrivate;
class FunctionNode;
-class InnerNode;
+class Aggregate;
class Tokenizer;
class CppCodeParser : public CodeParser
@@ -52,12 +52,12 @@ class CppCodeParser : public CodeParser
Q_DECLARE_TR_FUNCTIONS(QDoc::CppCodeParser)
struct ExtraFuncData {
- InnerNode* root; // Used as the parent.
- Node::Type type; // The node type: Function, etc.
+ Aggregate* root; // Used as the parent.
+ Node::NodeType type; // The node type: Function, etc.
bool isAttached; // If true, the method is attached.
bool isMacro; // If true, we are parsing a macro signature.
ExtraFuncData() : root(0), type(Node::Function), isAttached(false), isMacro(false) { }
- ExtraFuncData(InnerNode* r, Node::Type t, bool a)
+ ExtraFuncData(Aggregate* r, Node::NodeType t, bool a)
: root(r), type(t), isAttached(a), isMacro(false) { }
};
@@ -117,22 +117,22 @@ protected:
bool matchTemplateHeader();
bool matchDataType(CodeChunk *type, QString *var = 0);
bool matchParameter(FunctionNode *func);
- bool matchFunctionDecl(InnerNode *parent,
+ bool matchFunctionDecl(Aggregate *parent,
QStringList *parentPathPtr,
FunctionNode **funcPtr,
const QString &templateStuff,
ExtraFuncData& extra);
bool matchBaseSpecifier(ClassNode *classe, bool isClass);
bool matchBaseList(ClassNode *classe, bool isClass);
- bool matchClassDecl(InnerNode *parent,
+ bool matchClassDecl(Aggregate *parent,
const QString &templateStuff = QString());
- bool matchNamespaceDecl(InnerNode *parent);
- bool matchUsingDecl(InnerNode* parent);
- bool matchEnumItem(InnerNode *parent, EnumNode *enume);
- bool matchEnumDecl(InnerNode *parent);
- bool matchTypedefDecl(InnerNode *parent);
- bool matchProperty(InnerNode *parent);
- bool matchDeclList(InnerNode *parent);
+ bool matchNamespaceDecl(Aggregate *parent);
+ bool matchUsingDecl(Aggregate* parent);
+ bool matchEnumItem(Aggregate *parent, EnumNode *enume);
+ bool matchEnumDecl(Aggregate *parent);
+ bool matchTypedefDecl(Aggregate *parent);
+ bool matchProperty(Aggregate *parent);
+ bool matchDeclList(Aggregate *parent);
bool matchDocsAndStuff();
bool makeFunctionNode(const QString &synopsis,
QStringList *parentPathPtr,
@@ -140,8 +140,8 @@ protected:
ExtraFuncData& params);
FunctionNode* makeFunctionNode(const Doc& doc,
const QString& sig,
- InnerNode* parent,
- Node::Type type,
+ Aggregate* parent,
+ Node::NodeType type,
bool attached,
QString qdoctag);
void parseQiteratorDotH(const Location &location, const QString &filePath);
@@ -151,11 +151,11 @@ protected:
void createExampleFileNodes(DocumentNode *dn);
protected:
- QMap<QString, Node::Type> nodeTypeMap;
+ QMap<QString, Node::NodeType> nodeTypeMap;
Tokenizer *tokenizer;
int tok;
Node::Access access;
- FunctionNode::Metaness metaness;
+ FunctionNode::Metaness metaness_;
QString physicalModuleName;
QStringList lastPath_;
QRegExp varComment;
@@ -177,6 +177,7 @@ protected:
QString exampleImageFilter;
};
+#define COMMAND_ABSTRACT Doc::alias("abstract")
#define COMMAND_CLASS Doc::alias("class")
#define COMMAND_CONTENTSPAGE Doc::alias("contentspage")
#define COMMAND_DITAMAP Doc::alias("ditamap")
diff --git a/src/tools/qdoc/doc.cpp b/src/tools/qdoc/doc.cpp
index 92c6d405de..f322bd9360 100644
--- a/src/tools/qdoc/doc.cpp
+++ b/src/tools/qdoc/doc.cpp
@@ -69,7 +69,6 @@ struct Macro
enum {
CMD_A,
- CMD_ABSTRACT,
CMD_ANNOTATEDLIST,
CMD_B,
CMD_BADCODE,
@@ -85,7 +84,6 @@ enum {
CMD_DOTS,
CMD_E,
CMD_ELSE,
- CMD_ENDABSTRACT,
CMD_ENDCHAPTER,
CMD_ENDCODE,
CMD_ENDDIV,
@@ -187,7 +185,6 @@ static struct {
QString *alias;
} cmds[] = {
{ "a", CMD_A, 0 },
- { "abstract", CMD_ABSTRACT, 0 },
{ "annotatedlist", CMD_ANNOTATEDLIST, 0 },
{ "b", CMD_B, 0 },
{ "badcode", CMD_BADCODE, 0 },
@@ -203,7 +200,6 @@ static struct {
{ "dots", CMD_DOTS, 0 },
{ "e", CMD_E, 0 },
{ "else", CMD_ELSE, 0 },
- { "endabstract", CMD_ENDABSTRACT, 0 },
{ "endchapter", CMD_ENDCHAPTER, 0 },
{ "endcode", CMD_ENDCODE, 0 },
{ "enddiv", CMD_ENDDIV, 0 },
@@ -469,16 +465,16 @@ private:
void endSection(int unit, int endCmd);
void parseAlso();
void append(const QString &string);
- void append(Atom::Type type, const QString& string = QString());
- void append(Atom::Type type, const QString& p1, const QString& p2);
+ void append(Atom::AtomType type, const QString& string = QString());
+ void append(Atom::AtomType type, const QString& p1, const QString& p2);
void append(const QString& p1, const QString& p2);
void appendChar(QChar ch);
void appendWord(const QString &word);
void appendToCode(const QString &code);
- void appendToCode(const QString &code, Atom::Type defaultType);
+ void appendToCode(const QString &code, Atom::AtomType defaultType);
void startNewPara();
- void enterPara(Atom::Type leftType = Atom::ParaLeft,
- Atom::Type rightType = Atom::ParaRight,
+ void enterPara(Atom::AtomType leftType = Atom::ParaLeft,
+ Atom::AtomType rightType = Atom::ParaRight,
const QString& string = QString());
void leavePara();
void leaveValue();
@@ -525,8 +521,8 @@ private:
bool inTableRow;
bool inTableItem;
bool indexStartedPara; // ### rename
- Atom::Type pendingParaLeftType;
- Atom::Type pendingParaRightType;
+ Atom::AtomType pendingParaLeftType;
+ Atom::AtomType pendingParaRightType;
QString pendingParaString;
int braceDepth;
@@ -631,12 +627,6 @@ void DocParser::parse(const QString& source,
append(Atom::FormattingRight,ATOM_FORMATTING_PARAMETER);
priv->params.insert(p1);
break;
- case CMD_ABSTRACT:
- if (openCommand(cmd)) {
- leavePara();
- append(Atom::AbstractLeft);
- }
- break;
case CMD_BADCODE:
leavePara();
append(Atom::CodeBad,getCode(CMD_BADCODE, marker));
@@ -748,12 +738,6 @@ void DocParser::parse(const QString& source,
location().warning(tr("Unexpected '\\%1'").arg(cmdName(CMD_ELSE)));
}
break;
- case CMD_ENDABSTRACT:
- if (closeCommand(cmd)) {
- leavePara();
- append(Atom::AbstractRight);
- }
- break;
case CMD_ENDCHAPTER:
endSection(Doc::Chapter, cmd);
break;
@@ -1830,11 +1814,6 @@ bool DocParser::openCommand(int cmd)
if (outer == CMD_LIST) {
ok = (cmd == CMD_FOOTNOTE || cmd == CMD_LIST);
}
- else if (outer == CMD_ABSTRACT) {
- ok = (cmd == CMD_LIST ||
- cmd == CMD_QUOTATION ||
- cmd == CMD_TABLE);
- }
else if (outer == CMD_SIDEBAR) {
ok = (cmd == CMD_LIST ||
cmd == CMD_QUOTATION ||
@@ -1984,9 +1963,9 @@ void DocParser::parseAlso()
}
}
-void DocParser::append(Atom::Type type, const QString &string)
+void DocParser::append(Atom::AtomType type, const QString &string)
{
- Atom::Type lastType = priv->text.lastAtom()->type();
+ Atom::AtomType lastType = priv->text.lastAtom()->type();
if ((lastType == Atom::Code) && priv->text.lastAtom()->string().endsWith(QLatin1String("\n\n")))
priv->text.lastAtom()->chopString();
priv->text << Atom(type, string);
@@ -1994,15 +1973,15 @@ void DocParser::append(Atom::Type type, const QString &string)
void DocParser::append(const QString &string)
{
- Atom::Type lastType = priv->text.lastAtom()->type();
+ Atom::AtomType 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); // The Atom type is Link.
}
-void DocParser::append(Atom::Type type, const QString& p1, const QString& p2)
+void DocParser::append(Atom::AtomType type, const QString& p1, const QString& p2)
{
- Atom::Type lastType = priv->text.lastAtom()->type();
+ Atom::AtomType lastType = priv->text.lastAtom()->type();
if ((lastType == Atom::Code) && priv->text.lastAtom()->string().endsWith(QLatin1String("\n\n")))
priv->text.lastAtom()->chopString();
priv->text << Atom(type, p1, p2);
@@ -2010,7 +1989,7 @@ void DocParser::append(Atom::Type type, const QString& p1, const QString& p2)
void DocParser::append(const QString& p1, const QString& p2)
{
- Atom::Type lastType = priv->text.lastAtom()->type();
+ Atom::AtomType lastType = priv->text.lastAtom()->type();
if ((lastType == Atom::Code) && priv->text.lastAtom()->string().endsWith(QLatin1String("\n\n")))
priv->text.lastAtom()->chopString();
if (p2.isEmpty())
@@ -2043,15 +2022,15 @@ void DocParser::appendWord(const QString &word)
void DocParser::appendToCode(const QString& markedCode)
{
- Atom::Type lastType = priv->text.lastAtom()->type();
+ Atom::AtomType lastType = priv->text.lastAtom()->type();
if (lastType != Atom::Qml && lastType != Atom::Code && lastType != Atom::JavaScript)
append(Atom::Qml);
priv->text.lastAtom()->appendString(markedCode);
}
-void DocParser::appendToCode(const QString &markedCode, Atom::Type defaultType)
+void DocParser::appendToCode(const QString &markedCode, Atom::AtomType defaultType)
{
- Atom::Type lastType = priv->text.lastAtom()->type();
+ Atom::AtomType lastType = priv->text.lastAtom()->type();
if (lastType != Atom::Qml && lastType != Atom::Code && lastType != Atom::JavaScript)
append(defaultType, markedCode);
else
@@ -2064,8 +2043,8 @@ void DocParser::startNewPara()
enterPara();
}
-void DocParser::enterPara(Atom::Type leftType,
- Atom::Type rightType,
+void DocParser::enterPara(Atom::AtomType leftType,
+ Atom::AtomType rightType,
const QString& string)
{
if (paraState == OutsideParagraph) {
@@ -2674,8 +2653,6 @@ void DocParser::skipToNextPreprocessorCommand()
int DocParser::endCmdFor(int cmd)
{
switch (cmd) {
- case CMD_ABSTRACT:
- return CMD_ENDABSTRACT;
case CMD_BADCODE:
return CMD_ENDCODE;
case CMD_CHAPTER:
diff --git a/src/tools/qdoc/doc/qdoc-manual-cmdindex.qdoc b/src/tools/qdoc/doc/qdoc-manual-cmdindex.qdoc
index 87416fcd14..63fcee6469 100644
--- a/src/tools/qdoc/doc/qdoc-manual-cmdindex.qdoc
+++ b/src/tools/qdoc/doc/qdoc-manual-cmdindex.qdoc
@@ -106,6 +106,7 @@
\li \l {printto-command} {\\printto}
\li \l {printuntil-command} {\\printuntil}
\li \l {property-command} {\\property}
+ \li \l {qmlabstract-command} {\\qmlabstract}
\li \l {qmlattachedproperty-command} {\\qmlattachedproperty}
\li \l {qmlattachedsignal-command} {\\qmlattachedsignal}
\li \l {qmlbasictype-command} {\\qmlbasictype}
diff --git a/src/tools/qdoc/doc/qdoc-manual-contextcmds.qdoc b/src/tools/qdoc/doc/qdoc-manual-contextcmds.qdoc
index 77987d6d95..3bf63214ad 100644
--- a/src/tools/qdoc/doc/qdoc-manual-contextcmds.qdoc
+++ b/src/tools/qdoc/doc/qdoc-manual-contextcmds.qdoc
@@ -46,6 +46,7 @@
below the \l {Topic Commands} {topic} command.
\list
+ \li \l {abstract-command} {\\abstract}
\li \l {compat-command}{\\compat},
\li \l {contentspage-command}{\\contentspage},
\li \l {indexpage-command}{\\indexpage},
@@ -59,6 +60,7 @@
\li \l {overload-command}{\\overload},
\li \l {preliminary-command}{\\preliminary},
\li \l {previouspage-command}{\\previouspage},
+ \li \l {qmlabstract-command} {\\qmlabstract}
\li \l {reentrant-command}{\\reentrant},
\li \l {reimp-command}{\\reimp},
\li \l {relates-command}{\\relates},
@@ -199,21 +201,41 @@
index page of the collection.
*/
-
/*!
\page 16-qdoc-commands-status.html
\previouspage Document Navigation
\contentspage QDoc Manual
\nextpage Thread Support
- \title Reporting Status
-
- These commands are for indicating that a documented element is
- still under development, is becoming obsolete, is provided for
- compatibility reasons, or is simply not to be included in the
- public interface. The \l {since-command}{\\since} command is for
- including information about the version when a function or class
- first appeared.
+ \title Status
+
+ These commands are for indicating that a documented element has
+ some special status. The element could be marked as about to be
+ made obsolete, or that it is provided for compatibility with an
+ earlier version, or is simply not to be included in the public
+ interface. The \l {since-command}{\\since} command is for
+ specifying the version number in which a function or class first
+ appeared. The \l {qmlabstract-command} {\\qmlabstract} command is
+ for marking a QML type as an abstract base class.
+
+ \target abstract-command
+ \target qmlabstract-command
+ \section1 \\abstract and \\qmlabstract
+
+ \\abstract is a synonym for the \\qmlabstract command. Add this
+ command to the \l {qmltype-command} {\\qmltype} comment for a QML
+ type when that type is meant to be used \e {only} as an abstract
+ base type. When a QML type is abstract, it means that the QML type
+ that can't be instantiated. Instead, the properties in its public
+ API are included in the public properties list on the reference
+ page for each QML type that inherits the abstract QML type. The
+ properties are documented as if they are properties of the
+ inheriting QML type.
+
+ Normally, when a QML type is marked with \e{\\qmlabstract}, it is
+ also marked with \e{\\internal} so that its reference page is not
+ generated. It the abstract QML type is not marked internal, it
+ will have a reference page in the documentation.
\target compat-command
\section1 \\compat
@@ -412,13 +434,14 @@
/ *!
\preliminary
- Returns information about the joining properties of the
- character (needed for certain languages such as
- Arabic).
+ Returns information about the joining type attributes of the
+ character (needed for certain languages such as Arabic or
+ Syriac).
+
* /
- QChar::Joining QChar::joining() const
+ QChar::JoiningType QChar::joiningType() const
{
- return ::joining(*this);
+ return QChar::joiningType(ucs);
}
\endcode
@@ -427,28 +450,25 @@
\quotation
\raw HTML
<h3>
- <a href="http://doc.qt.io/qt-5/qchar.html#JoiningType-enum">Joining</a>
- QChar::joining () const</h3>
+ <a href="http://doc.qt.io/qt-5/qchar.html#JoiningType-enum">JoiningType</a>
+ QChar::joiningType() const</h3>
\endraw
\b {This function is under development and
subject to change.}
- Returns information about the joining properties of the
- character (needed for certain languages such as
- Arabic).
+ Returns information about the joining type attributes of the
+ character (needed for certain languages such as Arabic or
+ Syriac).
\endquotation
- And the function's entry in QChar's list of functions will be
+ And the function's entry in QChar's list of public functions will be
rendered as:
\quotation
\list
\li ...
- \li Joining
- \l {Joining-enum}
- {joining}()
- const \c (preliminary)
+ \li JoiningType \l {QChar::joiningType()} {joiningType}() const \c (preliminary)
\li ...
\endlist
\endquotation
@@ -791,7 +811,7 @@
</h3>
\endraw
- This function overloads \l {addAction} {addAction()}
+ This function overloads \l {QMenu::addAction()} {addAction()}
This convenience function creates a new action with an
\e icon and some \e text. The function adds the newly
@@ -799,8 +819,7 @@
returns it.
See also
- \l {addAction}
- {QWidget::addAction}().
+ \l {QWidget::addAction()} {QWidget::addAction}().
\endquotation
If you don't include the function name with the \b{\\overload}
diff --git a/src/tools/qdoc/doc/qdoc-manual-markupcmds.qdoc b/src/tools/qdoc/doc/qdoc-manual-markupcmds.qdoc
index d764cde89d..fc576157f7 100644
--- a/src/tools/qdoc/doc/qdoc-manual-markupcmds.qdoc
+++ b/src/tools/qdoc/doc/qdoc-manual-markupcmds.qdoc
@@ -38,7 +38,6 @@
\list
\li \l {a-command} {\\a}
- \li \l {abstract-command} {\\abstract}
\li \l {annotatedlist-command} {\\annotatedlist}
\li \l {b-command} {\\b} \span {class="newStuff"}
\li \l {b-command} {\\bold} {(deprecated, use \\b)}
@@ -2886,19 +2885,6 @@
parts with a special rendering, conceptual meaning or
function.
- \target abstract-command
- \section1 \\abstract
-
- The \\abstract and \\endabstract commands delimit a
- document's abstract section.
-
- The abstract section is rendered as an indented italicized
- paragraph.
-
- \warning The \b{\\abstract} and \b{\\endabstract} commands
- have not been implemented. The abstract section is rendered as a
- regular HTML paragraph.
-
\target quotation-command
\section1 \\quotation
diff --git a/src/tools/qdoc/generator.cpp b/src/tools/qdoc/generator.cpp
index d22ec507f6..831d975591 100644
--- a/src/tools/qdoc/generator.cpp
+++ b/src/tools/qdoc/generator.cpp
@@ -259,7 +259,7 @@ void Generator::writeOutFileNames()
Attaches a QTextStream to the created file, which is written
to all over the place using out().
*/
-void Generator::beginSubPage(const InnerNode* node, const QString& fileName)
+void Generator::beginSubPage(const Aggregate* node, const QString& fileName)
{
QString path = outputDir() + QLatin1Char('/');
if (Generator::useOutputSubdirs() && !node->outputSubdirectory().isEmpty() &&
@@ -281,7 +281,7 @@ void Generator::beginSubPage(const InnerNode* node, const QString& fileName)
out->setCodec(outputCodec);
#endif
outStreamStack.push(out);
- const_cast<InnerNode*>(node)->setOutputFileName(fileName);
+ const_cast<Aggregate*>(node)->setOutputFileName(fileName);
}
/*!
@@ -300,7 +300,7 @@ QString Generator::fileBase(const Node *node) const
{
if (node->relates())
node = node->relates();
- else if (!node->isInnerNode())
+ else if (!node->isAggregate())
node = node->parent();
if (node->type() == Node::QmlPropertyGroup) {
node = node->parent();
@@ -564,20 +564,19 @@ QString Generator::fullDocumentLocation(const Node *node, bool useSubdir)
break;
case Node::Function:
{
- const FunctionNode *functionNode =
- static_cast<const FunctionNode *>(node);
+ const FunctionNode *fn = static_cast<const FunctionNode *>(node);
- if (functionNode->metaness() == FunctionNode::Dtor)
- anchorRef = "#dtor." + functionNode->name().mid(1);
+ if (fn->metaness() == FunctionNode::Dtor)
+ anchorRef = "#dtor." + fn->name().mid(1);
- else if (functionNode->associatedProperty())
- return fullDocumentLocation(functionNode->associatedProperty());
+ else if (fn->hasOneAssociatedProperty() && fn->doc().isEmpty())
+ return fullDocumentLocation(fn->firstAssociatedProperty());
- else if (functionNode->overloadNumber() > 1)
- anchorRef = QLatin1Char('#') + cleanRef(functionNode->name())
- + QLatin1Char('-') + QString::number(functionNode->overloadNumber());
+ else if (fn->overloadNumber() > 0)
+ anchorRef = QLatin1Char('#') + cleanRef(fn->name())
+ + QLatin1Char('-') + QString::number(fn->overloadNumber());
else
- anchorRef = QLatin1Char('#') + cleanRef(functionNode->name());
+ anchorRef = QLatin1Char('#') + cleanRef(fn->name());
break;
}
/*
@@ -750,12 +749,12 @@ void Generator::generateBody(const Node *node, CodeMarker *marker)
if (node->type() == Node::Document) {
const DocumentNode *dn = static_cast<const DocumentNode *>(node);
- if ((dn->subType() == Node::File) || (dn->subType() == Node::Image)) {
+ if ((dn->docSubtype() == Node::File) || (dn->docSubtype() == Node::Image)) {
quiet = true;
}
}
if (node->doc().isEmpty()) {
- if (!node->isWrapper() && !quiet && !node->isReimp()) { // ### might be unnecessary
+ if (!node->isWrapper() && !quiet && !node->isReimplemented()) { // ### might be unnecessary
node->location().warning(tr("No documentation for '%1'").arg(node->plainFullName()));
}
}
@@ -767,7 +766,7 @@ void Generator::generateBody(const Node *node, CodeMarker *marker)
}
if (!generateText(node->doc().body(), node, marker)) {
- if (node->isReimp())
+ if (node->isReimplemented())
return;
}
@@ -840,9 +839,8 @@ void Generator::generateBody(const Node *node, CodeMarker *marker)
}
else if (!(*a).isEmpty() && !documentedParams.contains(*a)) {
bool needWarning = (func->status() > Node::Obsolete);
- if (func->overloadNumber() > 1) {
- FunctionNode *primaryFunc =
- func->parent()->findFunctionNode(func->name());
+ if (func->overloadNumber() > 0) {
+ FunctionNode *primaryFunc = func->parent()->findFunctionNode(func->name());
if (primaryFunc) {
foreach (const Parameter &param,
primaryFunc->parameters()) {
@@ -853,7 +851,7 @@ void Generator::generateBody(const Node *node, CodeMarker *marker)
}
}
}
- if (needWarning && !func->isReimp())
+ if (needWarning && !func->isReimplemented())
node->doc().location().warning(
tr("Undocumented parameter '%1' in %2")
.arg(*a).arg(node->plainFullName()));
@@ -879,7 +877,7 @@ void Generator::generateBody(const Node *node, CodeMarker *marker)
if (dn->isExample()) {
generateExampleFiles(dn, marker);
}
- else if (dn->subType() == Node::File) {
+ else if (dn->docSubtype() == Node::File) {
Text text;
Quoter quoter;
Doc::quoteFromFile(dn->doc().location(), quoter, dn->name());
@@ -891,7 +889,7 @@ void Generator::generateBody(const Node *node, CodeMarker *marker)
}
}
-void Generator::generateClassLikeNode(InnerNode* /* classe */, CodeMarker* /* marker */)
+void Generator::generateClassLikeNode(Aggregate* /* classe */, CodeMarker* /* marker */)
{
}
@@ -920,7 +918,7 @@ void Generator::generateCollectionNode(CollectionNode* , CodeMarker* )
*/
void Generator::generateFileList(const DocumentNode* dn,
CodeMarker* marker,
- Node::SubType subtype,
+ Node::DocSubtype subtype,
const QString& tag)
{
int count = 0;
@@ -931,7 +929,7 @@ void Generator::generateFileList(const DocumentNode* dn,
<< Atom(Atom::ListLeft, openedList.styleString());
foreach (const Node* child, dn->childNodes()) {
- if (child->subType() == subtype) {
+ if (child->docSubtype() == subtype) {
++count;
QString file = child->name();
if (subtype == Node::Image) {
@@ -945,16 +943,10 @@ void Generator::generateFileList(const DocumentNode* dn,
exampleImgExts,
userFriendlyFilePath);
userFriendlyFilePath.truncate(userFriendlyFilePath.lastIndexOf('/'));
-
QString imgOutDir = outDir_ + "/images/used-in-examples/" + userFriendlyFilePath;
if (!dirInfo.mkpath(imgOutDir))
- dn->location().fatal(tr("Cannot create output directory '%1'")
- .arg(imgOutDir));
-
- QString imgOutName = Config::copyFile(dn->location(),
- srcPath,
- file,
- imgOutDir);
+ dn->location().fatal(tr("Cannot create output directory '%1'").arg(imgOutDir));
+ Config::copyFile(dn->location(), srcPath, file, imgOutDir);
}
}
@@ -1030,7 +1022,7 @@ void Generator::generateInherits(const ClassNode *classe, CodeMarker *marker)
/*!
Recursive writing of HTML files from the root \a node.
*/
-void Generator::generateInnerNode(InnerNode* node)
+void Generator::generateAggregate(Aggregate* node)
{
if (!node->url().isNull())
return;
@@ -1041,11 +1033,11 @@ void Generator::generateInnerNode(InnerNode* node)
if (node->isDocumentNode()) {
DocumentNode* docNode = static_cast<DocumentNode*>(node);
- if (docNode->subType() == Node::ExternalPage)
+ if (docNode->docSubtype() == Node::ExternalPage)
return;
- if (docNode->subType() == Node::Image)
+ if (docNode->docSubtype() == Node::Image)
return;
- if (docNode->subType() == Node::Page) {
+ if (docNode->docSubtype() == Node::Page) {
if (node->count() > 0)
qDebug("PAGE %s HAS CHILDREN", qPrintable(docNode->title()));
}
@@ -1115,8 +1107,8 @@ void Generator::generateInnerNode(InnerNode* node)
int i = 0;
while (i < node->childNodes().count()) {
Node *c = node->childNodes().at(i);
- if (c->isInnerNode() && c->access() != Node::Private) {
- generateInnerNode((InnerNode*)c);
+ if (c->isAggregate() && c->access() != Node::Private) {
+ generateAggregate((Aggregate*)c);
}
++i;
}
@@ -1125,7 +1117,7 @@ void Generator::generateInnerNode(InnerNode* node)
/*!
Generate a list of maintainers in the output
*/
-void Generator::generateMaintainerList(const InnerNode* node, CodeMarker* marker)
+void Generator::generateMaintainerList(const Aggregate* node, CodeMarker* marker)
{
QStringList sl = getMetadataElements(node,"maintainer");
@@ -1250,7 +1242,8 @@ void Generator::generateStatus(const Node *node, CodeMarker *marker)
Text text;
switch (node->status()) {
- case Node::Commendable:
+ case Node::Active:
+ // Do nothing.
break;
case Node::Preliminary:
text << Atom::ParaLeft
@@ -1263,19 +1256,19 @@ void Generator::generateStatus(const Node *node, CodeMarker *marker)
break;
case Node::Deprecated:
text << Atom::ParaLeft;
- if (node->isInnerNode())
+ if (node->isAggregate())
text << Atom(Atom::FormattingLeft, ATOM_FORMATTING_BOLD);
text << "This " << typeString(node) << " is deprecated.";
- if (node->isInnerNode())
+ if (node->isAggregate())
text << Atom(Atom::FormattingRight, ATOM_FORMATTING_BOLD);
text << Atom::ParaRight;
break;
case Node::Obsolete:
text << Atom::ParaLeft;
- if (node->isInnerNode())
+ if (node->isAggregate())
text << Atom(Atom::FormattingLeft, ATOM_FORMATTING_BOLD);
text << "This " << typeString(node) << " is obsolete.";
- if (node->isInnerNode())
+ if (node->isAggregate())
text << Atom(Atom::FormattingRight, ATOM_FORMATTING_BOLD);
text << " It is provided to keep old source code working. "
<< "We strongly advise against "
@@ -1283,7 +1276,7 @@ void Generator::generateStatus(const Node *node, CodeMarker *marker)
break;
case Node::Compat:
// reimplemented in HtmlGenerator subclass
- if (node->isInnerNode()) {
+ if (node->isAggregate()) {
text << Atom::ParaLeft
<< Atom(Atom::FormattingLeft, ATOM_FORMATTING_BOLD)
<< "This "
@@ -1382,8 +1375,8 @@ void Generator::generateThreadSafeness(const Node *node, CodeMarker *marker)
<< Atom(Atom::FormattingRight,ATOM_FORMATTING_BOLD)
<< " ";
- if (node->isInnerNode()) {
- const InnerNode* innerNode = static_cast<const InnerNode*>(node);
+ if (node->isAggregate()) {
+ const Aggregate* innerNode = static_cast<const Aggregate*>(node);
text << "All functions in this "
<< typeString(node)
<< " are ";
@@ -1483,11 +1476,80 @@ void Generator::generateThreadSafeness(const Node *node, CodeMarker *marker)
}
/*!
- Traverses the current tree to generate all the documentation.
+ If the node is an overloaded signal, and a node with an example on how to connect to it
+ */
+void Generator::generateOverloadedSignal(const Node* node, CodeMarker* marker)
+{
+ if (node->type() != Node::Function)
+ return;
+ const FunctionNode *func = static_cast<const FunctionNode *>(node);
+ if (func->metaness() != FunctionNode::Signal)
+ return;
+ if (node->parent()->overloads(node->name()).count() <= 1)
+ return;
+
+
+ // Compute a friendly name for the object of that instance.
+ // e.g: "QAbstractSocket" -> "abstractSocket"
+ QString objectName = node->parent()->name();
+ if (objectName.size() >= 2) {
+ if (objectName[0] == 'Q')
+ objectName = objectName.mid(1);
+ objectName[0] = objectName[0].toLower();
+ }
+
+
+ // We have an overloaded signal, show an example
+ QString code = "connect(" + objectName + ", static_cast<" + func->returnType()
+ + "(" + func->parent()->name() + "::*)(";
+ for (int i = 0; i < func->parameters().size(); ++i) {
+ if (i != 0)
+ code += ", ";
+ const Parameter &p = func->parameters().at(i);
+ code += p.leftType() + p.rightType();
+ }
+
+ code += ")";
+ if (func->isConst())
+ code += " const";
+ code += ">(&" + func->parent()->name() + "::" + func->name() + "),\n [=](";
+
+ for (int i = 0; i < func->parameters().size(); ++i) {
+ if (i != 0)
+ code += ", ";
+ const Parameter &p = func->parameters().at(i);
+ code += p.leftType();
+ if (code[code.size()-1].isLetterOrNumber())
+ code += " ";
+ code += p.name() + p.rightType();
+ }
+
+ code += "){ /* ... */ });";
+
+ Text text;
+ text << Atom::ParaLeft
+ << Atom(Atom::FormattingLeft,ATOM_FORMATTING_BOLD)
+ << "Note:"
+ << Atom(Atom::FormattingRight,ATOM_FORMATTING_BOLD)
+ << "Signal "
+ << Atom(Atom::FormattingLeft,ATOM_FORMATTING_ITALIC)
+ << node->name()
+ << Atom(Atom::FormattingRight,ATOM_FORMATTING_ITALIC)
+ << " is overloaded in this class. "
+ "To connect to this one using the function pointer syntax, you must "
+ "specify the signal type in a static cast, as shown in this example:"
+ << Atom(Atom::Code, marker->markedUpCode(code, node, func->location()));
+
+ generateText(text, node, marker);
+}
+
+
+/*!
+ Traverses the database recursivly to generate all the documentation.
*/
void Generator::generateDocs()
{
- generateInnerNode(qdb_->primaryTreeRoot());
+ generateAggregate(qdb_->primaryTreeRoot());
}
Generator *Generator::generatorForFormat(const QString& format)
@@ -1510,7 +1572,7 @@ Generator *Generator::generatorForFormat(const QString& format)
i.e. Once you call this function for a particular \a t,
you consume \a t.
*/
-QString Generator::getMetadataElement(const InnerNode* inner, const QString& t)
+QString Generator::getMetadataElement(const Aggregate* inner, const QString& t)
{
QString s;
QStringMultiMap& metaTagMap = const_cast<QStringMultiMap&>(inner->doc().metaTagMap());
@@ -1531,7 +1593,7 @@ QString Generator::getMetadataElement(const InnerNode* inner, const QString& t)
having the key \a t are erased. i.e. Once you call this
function for a particular \a t, you consume \a t.
*/
-QStringList Generator::getMetadataElements(const InnerNode* inner, const QString& t)
+QStringList Generator::getMetadataElements(const Aggregate* inner, const QString& t)
{
QStringList s;
QStringMultiMap& metaTagMap = const_cast<QStringMultiMap&>(inner->doc().metaTagMap());
@@ -1626,12 +1688,6 @@ void Generator::initialize(const Config &config)
if (!dirInfo.exists(outDir_ + "/images") && !dirInfo.mkdir(outDir_ + "/images"))
config.lastLocation().fatal(tr("Cannot create images directory '%1'").arg(outDir_ + "/images"));
- if (!dirInfo.exists(outDir_ + "/images/used-in-examples") && !dirInfo.mkdir(outDir_ + "/images/used-in-examples"))
- config.lastLocation().fatal(tr("Cannot create images used in examples directory '%1'").arg(outDir_ + "/images/used-in-examples"));
- if (!dirInfo.exists(outDir_ + "/scripts") && !dirInfo.mkdir(outDir_ + "/scripts"))
- config.lastLocation().fatal(tr("Cannot create scripts directory '%1'").arg(outDir_ + "/scripts"));
- if (!dirInfo.exists(outDir_ + "/style") && !dirInfo.mkdir(outDir_ + "/style"))
- config.lastLocation().fatal(tr("Cannot create style directory '%1'").arg(outDir_ + "/style"));
}
imageFiles = config.getCanonicalPathList(CONFIG_IMAGES);
@@ -1670,23 +1726,41 @@ void Generator::initialize(const Config &config)
// Documentation template handling
QStringList scripts = config.getCanonicalPathList((*g)->format()+Config::dot+CONFIG_SCRIPTS, true);
- e = scripts.constBegin();
- while (e != scripts.constEnd()) {
- QString filePath = *e;
- if (!filePath.isEmpty())
- Config::copyFile(config.lastLocation(), filePath, filePath,
- (*g)->outputDir() + "/scripts");
- ++e;
+ if (!scripts.isEmpty()) {
+ QDir dirInfo;
+ if (!dirInfo.exists(outDir_ + "/scripts") && !dirInfo.mkdir(outDir_ + "/scripts")) {
+ config.lastLocation().fatal(tr("Cannot create scripts directory '%1'")
+ .arg(outDir_ + "/scripts"));
+ }
+ else {
+ e = scripts.constBegin();
+ while (e != scripts.constEnd()) {
+ QString filePath = *e;
+ if (!filePath.isEmpty())
+ Config::copyFile(config.lastLocation(), filePath, filePath,
+ (*g)->outputDir() + "/scripts");
+ ++e;
+ }
+ }
}
QStringList styles = config.getCanonicalPathList((*g)->format()+Config::dot+CONFIG_STYLESHEETS, true);
- e = styles.constBegin();
- while (e != styles.constEnd()) {
- QString filePath = *e;
- if (!filePath.isEmpty())
- Config::copyFile(config.lastLocation(), filePath, filePath,
- (*g)->outputDir() + "/style");
- ++e;
+ if (!styles.isEmpty()) {
+ QDir dirInfo;
+ if (!dirInfo.exists(outDir_ + "/style") && !dirInfo.mkdir(outDir_ + "/style")) {
+ config.lastLocation().fatal(tr("Cannot create style directory '%1'")
+ .arg(outDir_ + "/style"));
+ }
+ else {
+ e = styles.constBegin();
+ while (e != styles.constEnd()) {
+ QString filePath = *e;
+ if (!filePath.isEmpty())
+ Config::copyFile(config.lastLocation(), filePath, filePath,
+ (*g)->outputDir() + "/style");
+ ++e;
+ }
+ }
}
}
++g;
@@ -1768,7 +1842,7 @@ void Generator::initializeGenerator(const Config& config)
singleExec_ = config.getBool(CONFIG_SINGLEEXEC);
}
-bool Generator::matchAhead(const Atom *atom, Atom::Type expectedAtomType)
+bool Generator::matchAhead(const Atom *atom, Atom::AtomType expectedAtomType)
{
return atom->next() != 0 && atom->next()->type() == expectedAtomType;
}
@@ -1915,7 +1989,7 @@ void Generator::singularPlural(Text& text, const NodeList& nodes)
text << " are";
}
-int Generator::skipAtoms(const Atom *atom, Atom::Type type) const
+int Generator::skipAtoms(const Atom *atom, Atom::AtomType type) const
{
int skipAhead = 0;
atom = atom->next();
@@ -1945,7 +2019,7 @@ void Generator::supplementAlsoList(const Node *node, QList<Text> &alsoList)
{
if (node->type() == Node::Function) {
const FunctionNode *func = static_cast<const FunctionNode *>(node);
- if (func->overloadNumber() == 1) {
+ if (func->overloadNumber() == 0) {
QString alternateName;
const FunctionNode *alternateFunc = 0;
diff --git a/src/tools/qdoc/generator.h b/src/tools/qdoc/generator.h
index 9a1672dac4..e4bcd29e52 100644
--- a/src/tools/qdoc/generator.h
+++ b/src/tools/qdoc/generator.h
@@ -106,7 +106,7 @@ public:
static QString cleanRef(const QString& ref);
protected:
- virtual void beginSubPage(const InnerNode* node, const QString& fileName);
+ virtual void beginSubPage(const Aggregate* node, const QString& fileName);
virtual void endSubPage();
virtual QString fileBase(const Node* node) const;
virtual QString fileExtension() const = 0;
@@ -114,15 +114,15 @@ protected:
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 generateClassLikeNode(Aggregate* inner, CodeMarker* marker);
virtual void generateQmlTypePage(QmlTypeNode* , CodeMarker* ) { }
virtual void generateQmlBasicTypePage(QmlBasicTypeNode* , CodeMarker* ) { }
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 generateAggregate(Aggregate* node);
+ virtual void generateMaintainerList(const Aggregate* node, CodeMarker* marker);
virtual void generateQmlInheritedBy(const QmlTypeNode* qcn, CodeMarker* marker);
virtual void generateQmlInherits(QmlTypeNode* qcn, CodeMarker* marker);
virtual bool generateQmlText(const Text& text,
@@ -131,10 +131,10 @@ protected:
const QString& qmlName);
virtual bool generateText(const Text& text, const Node *relative, CodeMarker *marker);
virtual QString imageFileName(const Node *relative, const QString& fileBase);
- virtual int skipAtoms(const Atom *atom, Atom::Type type) const;
+ virtual int skipAtoms(const Atom *atom, Atom::AtomType type) const;
virtual QString typeString(const Node *node);
- static bool matchAhead(const Atom *atom, Atom::Type expectedAtomType);
+ static bool matchAhead(const Atom *atom, Atom::AtomType expectedAtomType);
static QString outputPrefix(const QString &nodeType);
static void singularPlural(Text& text, const NodeList& nodes);
static void supplementAlsoList(const Node *node, QList<Text> &alsoList);
@@ -153,14 +153,15 @@ protected:
void generateExampleFiles(const DocumentNode *dn, CodeMarker *marker);
void generateFileList(const DocumentNode* dn,
CodeMarker* marker,
- Node::SubType subtype,
+ Node::DocSubtype subtype,
const QString& tag);
void generateSince(const Node *node, CodeMarker *marker);
void generateStatus(const Node *node, CodeMarker *marker);
void generatePrivateSignalNote(const Node* node, CodeMarker* marker);
void generateThreadSafeness(const Node *node, CodeMarker *marker);
- QString getMetadataElement(const InnerNode* inner, const QString& t);
- QStringList getMetadataElements(const InnerNode* inner, const QString& t);
+ QString getMetadataElement(const Aggregate* inner, const QString& t);
+ QStringList getMetadataElements(const Aggregate* inner, const QString& t);
+ void generateOverloadedSignal(const Node *node, CodeMarker *marker);
QString indent(int level, const QString& markedCode);
QTextStream& out();
QString outFileName();
diff --git a/src/tools/qdoc/helpprojectwriter.cpp b/src/tools/qdoc/helpprojectwriter.cpp
index 90b1d9cfe3..e98b2f5cb1 100644
--- a/src/tools/qdoc/helpprojectwriter.cpp
+++ b/src/tools/qdoc/helpprojectwriter.cpp
@@ -107,13 +107,13 @@ void HelpProjectWriter::reset(const Config &config,
subproject.sortPages = config.getBool(subprefix + "sortPages");
subproject.type = config.getString(subprefix + "type");
readSelectors(subproject, config.getStringList(subprefix + "selectors"));
- project.subprojects[name] = subproject;
+ project.subprojects.append(subproject);
}
if (project.subprojects.isEmpty()) {
SubProject subproject;
readSelectors(subproject, config.getStringList(prefix + "selectors"));
- project.subprojects.insert(QString(), subproject);
+ project.subprojects.insert(0, subproject);
}
projects.append(project);
@@ -122,7 +122,7 @@ void HelpProjectWriter::reset(const Config &config,
void HelpProjectWriter::readSelectors(SubProject &subproject, const QStringList &selectors)
{
- QHash<QString, Node::Type> typeHash;
+ QHash<QString, Node::NodeType> typeHash;
typeHash["namespace"] = Node::Namespace;
typeHash["class"] = Node::Class;
typeHash["fake"] = Node::Document;
@@ -142,14 +142,14 @@ void HelpProjectWriter::readSelectors(SubProject &subproject, const QStringList
typeHash["qmlclass"] = Node::QmlType;
typeHash["qmlbasictype"] = Node::QmlBasicType;
- QHash<QString, Node::SubType> subTypeHash;
- subTypeHash["example"] = Node::Example;
- subTypeHash["headerfile"] = Node::HeaderFile;
- subTypeHash["file"] = Node::File;
- subTypeHash["page"] = Node::Page;
- subTypeHash["externalpage"] = Node::ExternalPage;
+ QHash<QString, Node::DocSubtype> docSubtypeHash;
+ docSubtypeHash["example"] = Node::Example;
+ docSubtypeHash["headerfile"] = Node::HeaderFile;
+ docSubtypeHash["file"] = Node::File;
+ docSubtypeHash["page"] = Node::Page;
+ docSubtypeHash["externalpage"] = Node::ExternalPage;
- QSet<Node::SubType> allSubTypes = QSet<Node::SubType>::fromList(subTypeHash.values());
+ QSet<Node::DocSubtype> allSubTypes = QSet<Node::DocSubtype>::fromList(docSubtypeHash.values());
foreach (const QString &selector, selectors) {
QStringList pieces = selector.split(QLatin1Char(':'));
@@ -161,13 +161,13 @@ void HelpProjectWriter::readSelectors(SubProject &subproject, const QStringList
QString lower = pieces[0].toLower();
pieces = pieces[1].split(QLatin1Char(','));
if (typeHash.contains(lower)) {
- QSet<Node::SubType> subTypes;
+ QSet<Node::DocSubtype> docSubtypes;
for (int i = 0; i < pieces.size(); ++i) {
QString lower = pieces[i].toLower();
- if (subTypeHash.contains(lower))
- subTypes.insert(subTypeHash[lower]);
+ if (docSubtypeHash.contains(lower))
+ docSubtypes.insert(docSubtypeHash[lower]);
}
- subproject.selectors[typeHash[lower]] = subTypes;
+ subproject.selectors[typeHash[lower]] = docSubtypes;
}
}
}
@@ -260,25 +260,25 @@ bool HelpProjectWriter::generateSection(HelpProject &project,
// Only add nodes to the set for each subproject if they match a selector.
// Those that match will be listed in the table of contents.
- foreach (const QString &name, project.subprojects.keys()) {
- SubProject subproject = project.subprojects[name];
+ for (int i = 0; i < project.subprojects.length(); i++) {
+ SubProject subproject = project.subprojects[i];
// No selectors: accept all nodes.
if (subproject.selectors.isEmpty()) {
- project.subprojects[name].nodes[objName] = node;
+ project.subprojects[i].nodes[objName] = node;
}
else if (subproject.selectors.contains(node->type())) {
// Accept only the node types in the selectors hash.
if (node->type() != Node::Document)
- project.subprojects[name].nodes[objName] = node;
+ project.subprojects[i].nodes[objName] = node;
else {
// Accept only fake nodes with subtypes contained in the selector's
// mask.
const DocumentNode *docNode = static_cast<const DocumentNode *>(node);
- if (subproject.selectors[node->type()].contains(docNode->subType()) &&
- docNode->subType() != Node::ExternalPage &&
+ if (subproject.selectors[node->type()].contains(docNode->docSubtype()) &&
+ docNode->docSubtype() != Node::ExternalPage &&
!docNode->fullTitle().isEmpty()) {
- project.subprojects[name].nodes[objName] = node;
+ project.subprojects[i].nodes[objName] = node;
}
}
}
@@ -417,11 +417,11 @@ bool HelpProjectWriter::generateSection(HelpProject &project,
// attributes.
case Node::Document: {
const DocumentNode *docNode = static_cast<const DocumentNode*>(node);
- if (docNode->subType() != Node::ExternalPage &&
- docNode->subType() != Node::Image &&
+ if (docNode->docSubtype() != Node::ExternalPage &&
+ docNode->docSubtype() != Node::Image &&
!docNode->fullTitle().isEmpty()) {
- if (docNode->subType() != Node::File) {
+ if (docNode->docSubtype() != Node::File) {
if (docNode->doc().hasKeywords()) {
foreach (const Atom *keyword, docNode->doc().keywords()) {
if (!keyword->string().isEmpty()) {
@@ -467,13 +467,13 @@ void HelpProjectWriter::generateSections(HelpProject &project,
/*
Don't include index nodes in the help file. Or DITA map nodes.
*/
- if (node->isIndexNode() || node->subType() == Node::DitaMap)
+ if (node->isIndexNode() || node->docSubtype() == Node::DitaMap)
return;
if (!generateSection(project, writer, node))
return;
- if (node->isInnerNode()) {
- const InnerNode *inner = static_cast<const InnerNode *>(node);
+ if (node->isAggregate()) {
+ const Aggregate *inner = static_cast<const Aggregate *>(node);
// Ensure that we don't visit nodes more than once.
QMap<QString, const Node*> childMap;
@@ -497,7 +497,7 @@ void HelpProjectWriter::generateSections(HelpProject &project,
because The Qml/Js Property Group is
an actual documented thing.
*/
- const InnerNode* inner = static_cast<const InnerNode*>(childNode);
+ const Aggregate* inner = static_cast<const Aggregate*>(childNode);
foreach (const Node* n, inner->childNodes()) {
if (n->access() == Node::Private)
continue;
@@ -626,7 +626,7 @@ void HelpProjectWriter::writeNode(HelpProject &project, QXmlStreamWriter &writer
writer.writeAttribute("ref", href);
writer.writeAttribute("title", docNode->fullTitle());
- if (docNode->subType() == Node::HeaderFile)
+ if (docNode->docSubtype() == Node::HeaderFile)
addMembers(project, writer, node);
writer.writeEndElement(); // section
@@ -713,8 +713,8 @@ void HelpProjectWriter::generateProject(HelpProject &project)
generateSections(project, writer, rootNode);
- foreach (const QString &name, project.subprojects.keys()) {
- SubProject subproject = project.subprojects[name];
+ for (int i = 0; i < project.subprojects.length(); i++) {
+ SubProject subproject = project.subprojects[i];
if (subproject.type == QLatin1String("manual")) {
@@ -769,13 +769,12 @@ void HelpProjectWriter::generateProject(HelpProject &project)
} else {
- if (!name.isEmpty()) {
- writer.writeStartElement("section");
- QString indexPath = gen_->fullDocumentLocation(qdb_->findNodeForTarget(subproject.indexTitle, 0),
+ writer.writeStartElement("section");
+ QString indexPath = gen_->fullDocumentLocation(qdb_->findNodeForTarget(subproject.indexTitle, 0),
false);
- writer.writeAttribute("ref", indexPath);
- writer.writeAttribute("title", subproject.title);
- }
+ writer.writeAttribute("ref", indexPath);
+ writer.writeAttribute("title", subproject.title);
+
if (subproject.sortPages) {
QStringList titles = subproject.nodes.keys();
titles.sort();
@@ -815,8 +814,7 @@ void HelpProjectWriter::generateProject(HelpProject &project)
}
}
- if (!name.isEmpty())
- writer.writeEndElement(); // section
+ writer.writeEndElement(); // section
}
}
diff --git a/src/tools/qdoc/helpprojectwriter.h b/src/tools/qdoc/helpprojectwriter.h
index efc2596296..7b3e8b1e75 100644
--- a/src/tools/qdoc/helpprojectwriter.h
+++ b/src/tools/qdoc/helpprojectwriter.h
@@ -50,7 +50,7 @@ struct SubProject
{
QString title;
QString indexTitle;
- QHash<Node::Type, QSet<DocumentNode::SubType> > selectors;
+ QHash<Node::NodeType, QSet<DocumentNode::DocSubtype> > selectors;
bool sortPages;
QString type;
QHash<QString, const Node *> nodes;
@@ -70,7 +70,7 @@ struct HelpProject
QSet<QString> filterAttributes;
QHash<QString, QSet<QString> > customFilters;
QSet<QString> excluded;
- QMap<QString, SubProject> subprojects;
+ QList<SubProject> subprojects;
QHash<const Node *, QSet<Node::Status> > memberStatus;
bool includeIndexNodes;
};
diff --git a/src/tools/qdoc/htmlgenerator.cpp b/src/tools/qdoc/htmlgenerator.cpp
index 10b7242c18..3dbb5a589f 100644
--- a/src/tools/qdoc/htmlgenerator.cpp
+++ b/src/tools/qdoc/htmlgenerator.cpp
@@ -474,14 +474,6 @@ int HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMark
static bool in_para = false;
switch (atom->type()) {
- case Atom::AbstractLeft:
- if (relative)
- relative->doc().location().warning(tr("\abstract is not implemented."));
- else
- Location::information(tr("\abstract is not implemented."));
- break;
- case Atom::AbstractRight:
- break;
case Atom::AutoLink:
case Atom::NavAutoLink:
if (!inLink_ && !inContents_ && !inSectionHeading_) {
@@ -1336,7 +1328,7 @@ int HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMark
/*!
Generate a reference page for a C++ class or a C++ namespace.
*/
-void HtmlGenerator::generateClassLikeNode(InnerNode* inner, CodeMarker* marker)
+void HtmlGenerator::generateClassLikeNode(Aggregate* inner, CodeMarker* marker)
{
QList<Section> sections;
QList<Section>::ConstIterator s;
@@ -1485,7 +1477,7 @@ void HtmlGenerator::generateClassLikeNode(InnerNode* inner, CodeMarker* marker)
const FunctionNode *func = reinterpret_cast<const FunctionNode *>(*m);
if (func->metaness() == FunctionNode::Ctor ||
func->metaness() == FunctionNode::Dtor ||
- func->overloadNumber() != 1)
+ func->overloadNumber() != 0)
names.clear();
}
else if ((*m)->type() == Node::Property) {
@@ -1644,7 +1636,7 @@ void HtmlGenerator::generateDocumentNode(DocumentNode* dn, CodeMarker* marker)
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) {
+ if (dn->docSubtype() == Node::Page && dn->pageType() == Node::DitaMapPage) {
const DitaMapNode* dmn = static_cast<const DitaMapNode*>(dn);
writeDitaMap(dmn);
return;
@@ -1670,7 +1662,7 @@ void HtmlGenerator::generateDocumentNode(DocumentNode* dn, CodeMarker* marker)
dn,
marker);
- if (dn->subType() == Node::HeaderFile) {
+ if (dn->docSubtype() == Node::HeaderFile) {
// Generate brief text and status for modules.
generateBrief(dn, marker);
generateStatus(dn, marker);
@@ -2087,7 +2079,7 @@ void HtmlGenerator::generateFooter(const Node *node)
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::generateRequisites(InnerNode *inner, CodeMarker *marker)
+void HtmlGenerator::generateRequisites(Aggregate *inner, CodeMarker *marker)
{
QMap<QString, Text> requisites;
Text text;
@@ -2359,7 +2351,7 @@ void HtmlGenerator::generateBrief(const Node *node, CodeMarker *marker,
}
}
-void HtmlGenerator::generateIncludes(const InnerNode *inner, CodeMarker *marker)
+void HtmlGenerator::generateIncludes(const Aggregate *inner, CodeMarker *marker)
{
if (!inner->includes().isEmpty()) {
out() << "<pre class=\"cpp\">"
@@ -2518,7 +2510,7 @@ void HtmlGenerator::generateSidebar() {
out() << "</div>\n";
}
-QString HtmlGenerator::generateListOfAllMemberFile(const InnerNode *inner,
+QString HtmlGenerator::generateListOfAllMemberFile(const Aggregate *inner,
CodeMarker *marker)
{
QList<Section> sections;
@@ -2613,7 +2605,7 @@ QString HtmlGenerator::generateAllQmlMembersFile(QmlTypeNode* qml_cn, CodeMarker
return fileName;
}
-QString HtmlGenerator::generateLowStatusMemberFile(InnerNode *inner,
+QString HtmlGenerator::generateLowStatusMemberFile(Aggregate *inner,
CodeMarker *marker,
CodeMarker::Status status)
{
@@ -3345,7 +3337,7 @@ void HtmlGenerator::generateSectionList(const Section& section,
void HtmlGenerator::generateSectionInheritedList(const Section& section, const Node *relative)
{
- QList<QPair<InnerNode *, int> >::ConstIterator p = section.inherited.constBegin();
+ QList<QPair<Aggregate *, int> >::ConstIterator p = section.inherited.constBegin();
while (p != section.inherited.constEnd()) {
out() << "<li class=\"fn\">";
out() << (*p).second << ' ';
@@ -3560,7 +3552,8 @@ QString HtmlGenerator::highlightedCode(const QString& markedCode,
bool handled = false;
for (int k = 0; k != 18; ++k) {
const QString & tag = spanTags[2 * k];
- if (tag == QStringRef(&src, i, tag.length())) {
+ if (i + tag.length() <= src.length() &&
+ tag == QStringRef(&src, i, tag.length())) {
html += spanTags[2 * k + 1];
i += tag.length();
handled = true;
@@ -3686,7 +3679,7 @@ QString HtmlGenerator::fileBase(const Node *node) const
result = Generator::fileBase(node);
- if (!node->isInnerNode()) {
+ if (!node->isAggregate()) {
switch (node->status()) {
case Node::Compat:
result += "-compat";
@@ -3704,9 +3697,9 @@ QString HtmlGenerator::fileBase(const Node *node) const
QString HtmlGenerator::fileName(const Node *node)
{
if (node->type() == Node::Document) {
- if (static_cast<const DocumentNode *>(node)->subType() == Node::ExternalPage)
+ if (static_cast<const DocumentNode *>(node)->docSubtype() == Node::ExternalPage)
return node->name();
- if (static_cast<const DocumentNode *>(node)->subType() == Node::Image)
+ if (static_cast<const DocumentNode *>(node)->docSubtype() == Node::Image)
return node->name();
}
return Generator::fileName(node);
@@ -3737,12 +3730,12 @@ QString HtmlGenerator::refForNode(const Node *node)
break;
case Node::Function:
func = static_cast<const FunctionNode *>(node);
- if (func->associatedProperty()) {
- return refForNode(func->associatedProperty());
+ if (func->hasOneAssociatedProperty() && func->doc().isEmpty()) {
+ return refForNode(func->firstAssociatedProperty());
}
else {
ref = func->name();
- if (func->overloadNumber() != 1)
+ if (func->overloadNumber() != 0)
ref += QLatin1Char('-') + QString::number(func->overloadNumber());
}
break;
@@ -3767,7 +3760,7 @@ QString HtmlGenerator::refForNode(const Node *node)
case Node::QmlMethod:
func = static_cast<const FunctionNode *>(node);
ref = func->name() + "-method";
- if (func->overloadNumber() != 1)
+ if (func->overloadNumber() != 0)
ref += QLatin1Char('-') + QString::number(func->overloadNumber());
break;
case Node::Variable:
@@ -3831,7 +3824,7 @@ QString HtmlGenerator::getAutoLink(const Atom *atom, const Node *relative, const
QString link = (*node)->url();
if (link.isEmpty()) {
link = linkForNode(*node, relative);
- if ((*node)->subType() == Node::Image)
+ if ((*node)->docSubtype() == Node::Image)
link = "images/used-in-examples/" + link;
if (!ref.isEmpty())
link += QLatin1Char('#') + ref;
@@ -3872,7 +3865,7 @@ QString HtmlGenerator::linkForNode(const Node *node, const Node *relative)
}
QString link = fn;
- if (!node->isInnerNode() || node->isQmlPropertyGroup() || node->isJsPropertyGroup()) {
+ if (!node->isAggregate() || node->isQmlPropertyGroup() || node->isJsPropertyGroup()) {
QString ref = refForNode(node);
if (relative && fn == fileName(relative) && ref == refForNode(relative))
return QString();
@@ -3923,27 +3916,25 @@ void HtmlGenerator::generateFullName(const Node *apparentNode, const Node *relat
}
void HtmlGenerator::generateDetailedMember(const Node *node,
- const InnerNode *relative,
+ const Aggregate *relative,
CodeMarker *marker)
{
- const EnumNode *enume;
-
+ const EnumNode *etn;
#ifdef GENERATE_MAC_REFS
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()) {
+ if (node->isEnumType() && (etn = static_cast<const EnumNode *>(node))->flagsType()) {
#ifdef GENERATE_MAC_REFS
- generateMacRef(enume->flagsType(), marker);
+ generateMacRef(etn->flagsType(), marker);
#endif
out() << "<h3 class=\"flags\" id=\"" << nodeRef << "\">";
out() << "<a name=\"" + nodeRef + "\"></a>";
- generateSynopsis(enume, relative, marker, CodeMarker::Detailed);
+ generateSynopsis(etn, relative, marker, CodeMarker::Detailed);
out() << "<br/>";
- generateSynopsis(enume->flagsType(),
+ generateSynopsis(etn->flagsType(),
relative,
marker,
CodeMarker::Detailed);
@@ -3958,10 +3949,11 @@ void HtmlGenerator::generateDetailedMember(const Node *node,
generateStatus(node, marker);
generateBody(node, marker);
+ generateOverloadedSignal(node, marker);
generateThreadSafeness(node, marker);
generateSince(node, marker);
- if (node->type() == Node::Property) {
+ if (node->isProperty()) {
const PropertyNode *property = static_cast<const PropertyNode *>(node);
Section section;
@@ -3987,16 +3979,17 @@ void HtmlGenerator::generateDetailedMember(const Node *node,
const FunctionNode* fn = static_cast<const FunctionNode*>(node);
if (fn->isPrivateSignal())
generatePrivateSignalNote(node, marker);
+ generateAssociatedPropertyNotes(fn);
}
- else if (node->type() == Node::Enum) {
- const EnumNode *enume = static_cast<const EnumNode *>(node);
- if (enume->flagsType()) {
- out() << "<p>The " << protectEnc(enume->flagsType()->name())
+ else if (node->isEnumType()) {
+ const EnumNode *etn = static_cast<const EnumNode *>(node);
+ if (etn->flagsType()) {
+ out() << "<p>The " << protectEnc(etn->flagsType()->name())
<< " type is a typedef for "
<< "<a href=\"" << qflagsHref_ << "\">QFlags</a>&lt;"
- << protectEnc(enume->name())
+ << protectEnc(etn->name())
<< "&gt;. It stores an OR combination of "
- << protectEnc(enume->name())
+ << protectEnc(etn->name())
<< " values.</p>\n";
}
}
@@ -4053,7 +4046,7 @@ void HtmlGenerator::generateStatus(const Node *node, CodeMarker *marker)
switch (node->status()) {
case Node::Obsolete:
- if (node->isInnerNode())
+ if (node->isAggregate())
Generator::generateStatus(node, marker);
break;
case Node::Compat:
@@ -4166,7 +4159,7 @@ void HtmlGenerator::generateQmlSummary(const Section& section,
on a QML element reference page.
*/
void HtmlGenerator::generateDetailedQmlMember(Node *node,
- const InnerNode *relative,
+ const Aggregate *relative,
CodeMarker *marker)
{
QmlPropertyNode* qpn = 0;
@@ -4371,8 +4364,8 @@ void HtmlGenerator::generateExtractionMark(const Node *node, ExtractionMarkType
if (markType == MemberMark) {
if (node->type() == Node::Function) {
const FunctionNode *func = static_cast<const FunctionNode *>(node);
- if (!func->associatedProperty()) {
- if (func->overloadNumber() == 1)
+ if (!func->hasAssociatedProperties()) {
+ if (func->overloadNumber() == 0)
out() << "[overload1]";
out() << "$$$" + func->name() + func->rawParameters().remove(' ');
}
@@ -4481,7 +4474,7 @@ void HtmlGenerator::generateManifestFile(const QString &manifest, const QString
writer.writeAttribute("docUrl", docUrl);
QStringList proFiles;
foreach (const Node* child, en->childNodes()) {
- if (child->subType() == Node::File) {
+ if (child->docSubtype() == Node::File) {
QString file = child->name();
if (file.endsWith(".pro") || file.endsWith(".qmlproject")) {
proFiles << file;
@@ -4608,7 +4601,7 @@ void HtmlGenerator::generateManifestFile(const QString &manifest, const QString
QString ename = en->name().mid(en->name().lastIndexOf('/')+1);
QMap<int, const Node*> filesToOpen;
foreach (const Node* child, en->childNodes()) {
- if (child->subType() == Node::File) {
+ if (child->docSubtype() == Node::File) {
QFileInfo fileInfo(child->name());
QString fileName = fileInfo.fileName().toLower();
// open .qml, .cpp and .h files with a
@@ -4693,7 +4686,7 @@ void HtmlGenerator::readManifestMetaContent(const Config &config)
subtype: QML class
subtype: QML module
*/
-void HtmlGenerator::reportOrphans(const InnerNode* parent)
+void HtmlGenerator::reportOrphans(const Aggregate* parent)
{
const NodeList& children = parent->childNodes();
if (children.size() == 0)
@@ -4729,7 +4722,7 @@ void HtmlGenerator::reportOrphans(const InnerNode* parent)
case Node::QmlModule:
break;
case Node::Document:
- switch (child->subType()) {
+ switch (child->docSubtype()) {
case Node::Example:
break;
case Node::HeaderFile:
@@ -4819,7 +4812,7 @@ QXmlStreamWriter& HtmlGenerator::xmlWriter()
It also ensures that a GUID map is created for the output file.
*/
-void HtmlGenerator::beginDitamapPage(const InnerNode* node, const QString& fileName)
+void HtmlGenerator::beginDitamapPage(const Aggregate* node, const QString& fileName)
{
Generator::beginSubPage(node,fileName);
QXmlStreamWriter* writer = new QXmlStreamWriter(out().device());
@@ -4891,4 +4884,37 @@ void HtmlGenerator::writeDitaRefs(const DitaRefList& ditarefs)
}
}
+/*!
+ Generates bold Note lines that explain how function \a fn
+ is associated with each of its associated properties.
+ */
+void HtmlGenerator::generateAssociatedPropertyNotes(const FunctionNode* fn)
+{
+ if (fn->hasAssociatedProperties()) {
+ out() << "<p><b>Note:</b> ";
+ foreach (const PropertyNode* pn, fn->associatedProperties()) {
+ QString msg;
+ switch (pn->role(fn)) {
+ case PropertyNode::Getter:
+ msg = QStringLiteral("Getter function ");
+ break;
+ case PropertyNode::Setter:
+ msg = QStringLiteral("Setter function ");
+ break;
+ case PropertyNode::Resetter:
+ msg = QStringLiteral("Resetter function ");
+ break;
+ case PropertyNode::Notifier:
+ msg = QStringLiteral("Notifier signal ");
+ break;
+ default:
+ break;
+ }
+ QString link = linkForNode(pn, 0);
+ out() << msg << "for property <a href=\"" << link << "\">" << pn->name() << "</a>. ";
+ }
+ out() << "</p>";
+ }
+}
+
QT_END_NAMESPACE
diff --git a/src/tools/qdoc/htmlgenerator.h b/src/tools/qdoc/htmlgenerator.h
index 4a2e158252..6a550c2b39 100644
--- a/src/tools/qdoc/htmlgenerator.h
+++ b/src/tools/qdoc/htmlgenerator.h
@@ -94,7 +94,7 @@ protected:
virtual int generateAtom(const Atom *atom,
const Node *relative,
CodeMarker *marker) Q_DECL_OVERRIDE;
- virtual void generateClassLikeNode(InnerNode* inner, CodeMarker* marker) Q_DECL_OVERRIDE;
+ virtual void generateClassLikeNode(Aggregate* 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;
@@ -106,6 +106,7 @@ protected:
void generateManifestFile(const QString &manifest, const QString &element);
void readManifestMetaContent(const Config &config);
void generateKeywordAnchors(const Node* node);
+ void generateAssociatedPropertyNotes(const FunctionNode* fn);
private:
enum SubTitleSize { SmallSubTitle, LargeSubTitle };
@@ -136,22 +137,22 @@ private:
const Node *relative,
CodeMarker *marker);
void generateFooter(const Node *node = 0);
- void generateRequisites(InnerNode *inner,
+ void generateRequisites(Aggregate *inner,
CodeMarker *marker);
void generateQmlRequisites(QmlTypeNode *qcn,
CodeMarker *marker);
void generateBrief(const Node *node,
CodeMarker *marker,
const Node *relative = 0);
- void generateIncludes(const InnerNode *inner, CodeMarker *marker);
+ void generateIncludes(const Aggregate *inner, CodeMarker *marker);
void generateTableOfContents(const Node *node,
CodeMarker *marker,
QList<Section>* sections = 0);
void generateSidebar();
- QString generateListOfAllMemberFile(const InnerNode *inner,
+ QString generateListOfAllMemberFile(const Aggregate *inner,
CodeMarker *marker);
QString generateAllQmlMembersFile(QmlTypeNode* qml_cn, CodeMarker* marker);
- QString generateLowStatusMemberFile(InnerNode *inner,
+ QString generateLowStatusMemberFile(Aggregate *inner,
CodeMarker *marker,
CodeMarker::Status status);
QString generateQmlMemberFile(QmlTypeNode* qcn,
@@ -180,7 +181,7 @@ private:
CodeMarker *marker,
bool summary);
void generateDetailedQmlMember(Node *node,
- const InnerNode *relative,
+ const Aggregate *relative,
CodeMarker *marker);
void generateQmlInherits(QmlTypeNode* qcn, CodeMarker* marker) Q_DECL_OVERRIDE;
void generateQmlInstantiates(QmlTypeNode* qcn, CodeMarker* marker);
@@ -204,7 +205,7 @@ private:
void generateFullName(const Node *apparentNode, const Node *relative, const Node *actualNode = 0);
void generateDetailedMember(const Node *node,
- const InnerNode *relative,
+ const Aggregate *relative,
CodeMarker *marker);
void generateLink(const Atom *atom, CodeMarker *marker);
void generateStatus(const Node *node, CodeMarker *marker);
@@ -223,9 +224,9 @@ private:
void beginLink(const QString &link, const Node *node, const Node *relative);
void endLink();
void generateExtractionMark(const Node *node, ExtractionMarkType markType);
- void reportOrphans(const InnerNode* parent);
+ void reportOrphans(const Aggregate* parent);
- void beginDitamapPage(const InnerNode* node, const QString& fileName);
+ void beginDitamapPage(const Aggregate* node, const QString& fileName);
void endDitamapPage();
void writeDitaMap(const DitaMapNode* node);
void writeDitaRefs(const DitaRefList& ditarefs);
diff --git a/src/tools/qdoc/jscodemarker.cpp b/src/tools/qdoc/jscodemarker.cpp
index 2538b46433..f6a2c99179 100644
--- a/src/tools/qdoc/jscodemarker.cpp
+++ b/src/tools/qdoc/jscodemarker.cpp
@@ -68,7 +68,7 @@ bool JsCodeMarker::recognizeCode(const QString &code)
QQmlJS::Parser parser(&engine);
QString newCode = code;
- QList<QQmlJS::AST::SourceLocation> pragmas = extractPragmas(newCode);
+ QVector<QQmlJS::AST::SourceLocation> pragmas = extractPragmas(newCode);
lexer.setCode(newCode, 1);
return parser.parseProgram();
@@ -95,7 +95,7 @@ bool JsCodeMarker::recognizeLanguage(const QString &language)
/*!
Returns the type of atom used to represent JavaScript code in the documentation.
*/
-Atom::Type JsCodeMarker::atomType() const
+Atom::AtomType JsCodeMarker::atomType() const
{
return Atom::JavaScript;
}
@@ -115,7 +115,7 @@ QString JsCodeMarker::addMarkUp(const QString &code,
QQmlJS::Lexer lexer(&engine);
QString newCode = code;
- QList<QQmlJS::AST::SourceLocation> pragmas = extractPragmas(newCode);
+ QVector<QQmlJS::AST::SourceLocation> pragmas = extractPragmas(newCode);
lexer.setCode(newCode, 1);
QQmlJS::Parser parser(&engine);
diff --git a/src/tools/qdoc/jscodemarker.h b/src/tools/qdoc/jscodemarker.h
index d9f6eb5a10..ccba2ca4c7 100644
--- a/src/tools/qdoc/jscodemarker.h
+++ b/src/tools/qdoc/jscodemarker.h
@@ -53,7 +53,7 @@ public:
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 Atom::AtomType atomType() const Q_DECL_OVERRIDE;
virtual QString markedUpCode(const QString &code,
const Node *relative,
diff --git a/src/tools/qdoc/location.cpp b/src/tools/qdoc/location.cpp
index 5eba2a69ef..98b63fd035 100644
--- a/src/tools/qdoc/location.cpp
+++ b/src/tools/qdoc/location.cpp
@@ -202,25 +202,34 @@ void Location::pop()
*/
/*! \fn const QString& Location::filePath() const
- Returns the current path and file name.
- Must not be called on an empty Location object.
+ Returns the current path and file name. If the Location is
+ empty, the returned string is null.
\sa lineNo(), columnNo()
*/
/*!
- Returns the file name part of the file path, ie the
- current file. Must not be called on an empty Location
- object.
+ Returns the file name part of the file path, ie the current
+ file. Returns an empty string if the file path is empty.
*/
QString Location::fileName() const
{
QString fp = filePath();
- return fp.mid(fp.lastIndexOf('/') + 1);
+ return (fp.isEmpty() ? fp : fp.mid(fp.lastIndexOf('/') + 1));
}
/*!
+ Returns the suffix of the file name. Returns an empty string
+ if the file path is empty.
+ */
+QString Location::fileSuffix() const
+{
+ QString fp = filePath();
+ return (fp.isEmpty() ? fp : fp.mid(fp.lastIndexOf('.') + 1));
+}
+
+/*!
\brief Returns \a path which is canonicalized and relative to the config file.
QDir::relativeFilePath does not canonicalize the paths, so
diff --git a/src/tools/qdoc/location.h b/src/tools/qdoc/location.h
index 5250e27a47..1cb8e3aec1 100644
--- a/src/tools/qdoc/location.h
+++ b/src/tools/qdoc/location.h
@@ -72,6 +72,7 @@ public:
int depth() const { return stkDepth; }
const QString& filePath() const { return stkTop->filePath; }
QString fileName() const;
+ QString fileSuffix() const;
int lineNo() const { return stkTop->lineNo; }
int columnNo() const { return stkTop->columnNo; }
bool etc() const { return etcetera; }
@@ -104,6 +105,7 @@ private:
int lineNo;
int columnNo;
};
+ friend class QTypeInfo<StackEntry>;
void emitMessage(MessageType type,
const QString& message,
@@ -123,6 +125,8 @@ private:
static QRegExp *spuriousRegExp;
static bool logProgress_;
};
+Q_DECLARE_TYPEINFO(Location::StackEntry, Q_MOVABLE_TYPE);
+Q_DECLARE_TYPEINFO(Location, Q_COMPLEX_TYPE); // stkTop = &stkBottom
QT_END_NAMESPACE
diff --git a/src/tools/qdoc/main.cpp b/src/tools/qdoc/main.cpp
index 0b156c6bb9..cb1b890cdd 100644
--- a/src/tools/qdoc/main.cpp
+++ b/src/tools/qdoc/main.cpp
@@ -227,6 +227,8 @@ static void processQdocconfFile(const QString &fileName)
config.setStringList(CONFIG_AUTOLINKERRORS, QStringList(autolinkErrors ? "true" : "false"));
config.setStringList(CONFIG_OBSOLETELINKS, QStringList(obsoleteLinks ? "true" : "false"));
+ prevCurrentDir = QDir::currentPath();
+
/*
With the default configuration values in place, load
the qdoc configuration file. Note that the configuration
@@ -236,7 +238,6 @@ static void processQdocconfFile(const QString &fileName)
in the file being processed, mainly for error reporting
purposes.
*/
- currentDir = QFileInfo(fileName).path();
Location::initialize(config);
config.load(fileName);
QString project = config.getString(CONFIG_PROJECT);
@@ -248,7 +249,6 @@ static void processQdocconfFile(const QString &fileName)
config.setStringList(CONFIG_DEFINES,defs);
Location::terminate();
- prevCurrentDir = QDir::currentPath();
currentDir = QFileInfo(fileName).path();
if (!currentDir.isEmpty())
QDir::setCurrent(currentDir);
@@ -480,6 +480,9 @@ static void processQdocconfFile(const QString &fileName)
}
Generator::debug(QString("Parsing done."));
+ /*
+ Currently these doneParsingSourceFiles() calls do nothing.
+ */
foreach (CodeParser *codeParser, usedParsers)
codeParser->doneParsingSourceFiles();
diff --git a/src/tools/qdoc/node.cpp b/src/tools/qdoc/node.cpp
index 37bc0c5fef..f20020cd15 100644
--- a/src/tools/qdoc/node.cpp
+++ b/src/tools/qdoc/node.cpp
@@ -44,16 +44,16 @@ QT_BEGIN_NAMESPACE
int Node::propertyGroupCount_ = 0;
QStringMap Node::operators_;
-QMap<QString,Node::Type> Node::goals_;
+QMap<QString,Node::NodeType> Node::goals_;
/*!
Initialize the map of search goals. This is called once
by QDocDatabase::initializeDB(). The map key is a string
- representing a value in the enum Node::Type. The map value
+ representing a value in the enum Node::NodeType. The map value
is the enum value.
There should be an entry in the map for each value in the
- Type enum.
+ NodeType enum.
*/
void Node::initialize()
{
@@ -160,8 +160,8 @@ QString Node::fullName(const Node* relative) const
match is found, return false.
\a types is a list of type/subtype pairs, where the first
- value in the pair is a Node::Type, and the second value is
- a Node::SubType. The second value is used in the match if
+ value in the pair is a Node::NodeType, and the second value is
+ a Node::DocSubtype. The second value is used in the match if
this node's type is Node::Document.
*/
bool Node::match(const NodeTypeList& types) const
@@ -169,7 +169,7 @@ bool Node::match(const NodeTypeList& types) const
for (int i=0; i<types.size(); ++i) {
if (type() == types.at(i).first) {
if (type() == Node::Document) {
- if (subType() == types.at(i).second)
+ if (docSubtype() == types.at(i).second)
return true;
}
else
@@ -200,12 +200,12 @@ void Node::setDoc(const Doc& doc, bool replace)
given \a parent and \a name. The new node is added to the
parent's child list.
*/
-Node::Node(Type type, InnerNode *parent, const QString& name)
+Node::Node(NodeType type, Aggregate *parent, const QString& name)
: nodeType_((unsigned char) type),
access_((unsigned char) Public),
safeness_((unsigned char) UnspecifiedSafeness),
pageType_((unsigned char) NoPageType),
- status_((unsigned char) Commendable),
+ status_((unsigned char) Active),
indexNodeFlag_(false),
parent_(parent),
relatesTo_(0),
@@ -320,7 +320,7 @@ QString Node::nodeTypeString() const
*/
QString Node::nodeTypeString(unsigned char t)
{
- switch ((Type)t) {
+ switch ((NodeType)t) {
case Namespace:
return "namespace";
case Class:
@@ -370,7 +370,7 @@ QString Node::nodeTypeString(unsigned char t)
*/
QString Node::nodeSubtypeString() const
{
- return nodeSubtypeString(subType());
+ return nodeSubtypeString(docSubtype());
}
/*!
@@ -380,7 +380,7 @@ QString Node::nodeSubtypeString() const
*/
QString Node::nodeSubtypeString(unsigned char t)
{
- switch ((SubType)t) {
+ switch ((DocSubtype)t) {
case Example:
return "example";
case HeaderFile:
@@ -395,7 +395,7 @@ QString Node::nodeSubtypeString(unsigned char t)
return "external page";
case DitaMap:
return "ditamap";
- case NoSubType:
+ case NoSubtype:
default:
break;
}
@@ -460,7 +460,7 @@ bool Node::fromFlagValue(FlagValue fv, bool defaultValue)
/*!
Sets the pointer to the node that this node relates to.
*/
-void Node::setRelates(InnerNode *pseudoParent)
+void Node::setRelates(Aggregate *pseudoParent)
{
if (relatesTo_) {
relatesTo_->removeRelated(this);
@@ -558,7 +558,7 @@ QString RelatedClass::accessString() const
*/
Node::Status Node::inheritedStatus() const
{
- Status parentStatus = Commendable;
+ Status parentStatus = Active;
if (parent_)
parentStatus = parent_->inheritedStatus();
return (Status)qMin((int)status_, (int)parentStatus);
@@ -606,7 +606,6 @@ QString Node::fileBase() const
base.replace(QLatin1Char(' '), QLatin1Char('-'));
return base.toLower();
}
-#endif
/*!
Returns this node's Universally Unique IDentifier as a
QString. Creates the UUID first, if it has not been created.
@@ -617,6 +616,7 @@ QString Node::guid() const
uuid_ = idForNode();
return uuid_;
}
+#endif
/*!
If this node is a QML or JS type node, return a pointer to
@@ -683,14 +683,32 @@ const Node* Node::root() const
}
/*!
- \class InnerNode
+ Sets the node's declaration location, its definition
+ location, or both, depending on the suffix of the file
+ name from the file path in location \a t.
+ */
+void Node::setLocation(const Location& t)
+{
+ QString suffix = t.fileSuffix();
+ if (suffix == "h")
+ declLocation_ = t;
+ else if (suffix == "cpp")
+ defLocation_ = t;
+ else {
+ declLocation_ = t;
+ defLocation_ = t;
+ }
+}
+
+/*!
+ \class Aggregate
*/
/*!
The inner node destructor deletes the children and removes
this node from its related nodes.
*/
-InnerNode::~InnerNode()
+Aggregate::~Aggregate()
{
deleteChildren();
removeFromRelated();
@@ -706,17 +724,17 @@ InnerNode::~InnerNode()
find all this node's children that have the given \a name,
and return the one that satisfies the \a genus requirement.
*/
-Node *InnerNode::findChildNode(const QString& name, Node::Genus genus) const
+Node *Aggregate::findChildNode(const QString& name, Node::Genus genus) const
{
if (genus == Node::DontCare) {
- Node *node = childMap.value(name);
+ Node *node = childMap_.value(name);
if (node && !node->isQmlPropertyGroup()) // mws asks: Why not property group?
return node;
if (isQmlType() || isJsType()) {
for (int i=0; i<children_.size(); ++i) {
Node* n = children_.at(i);
if (n->isQmlPropertyGroup() || isJsPropertyGroup()) {
- node = static_cast<InnerNode*>(n)->findChildNode(name, genus);
+ node = static_cast<Aggregate*>(n)->findChildNode(name, genus);
if (node)
return node;
}
@@ -724,7 +742,7 @@ Node *InnerNode::findChildNode(const QString& name, Node::Genus genus) const
}
}
else {
- NodeList nodes = childMap.values(name);
+ NodeList nodes = childMap_.values(name);
if (!nodes.isEmpty()) {
for (int i=0; i<nodes.size(); ++i) {
Node* node = nodes.at(i);
@@ -733,20 +751,20 @@ Node *InnerNode::findChildNode(const QString& name, Node::Genus genus) const
}
}
}
- return primaryFunctionMap.value(name);
+ return primaryFunctionMap_.value(name);
}
/*!
Find all the child nodes of this node that are named
\a name and return them in \a nodes.
*/
-void InnerNode::findChildren(const QString& name, NodeList& nodes) const
+void Aggregate::findChildren(const QString& name, NodeList& nodes) const
{
- nodes = childMap.values(name);
- Node* n = primaryFunctionMap.value(name);
+ nodes = childMap_.values(name);
+ Node* n = primaryFunctionMap_.value(name);
if (n) {
nodes.append(n);
- NodeList t = secondaryFunctionMap.value(name);
+ NodeList t = secondaryFunctionMap_.value(name);
if (!t.isEmpty())
nodes.append(t);
}
@@ -756,7 +774,7 @@ void InnerNode::findChildren(const QString& name, NodeList& nodes) const
if (i < 0)
return;
QString qmlPropGroup = name.left(i);
- NodeList t = childMap.values(qmlPropGroup);
+ NodeList t = childMap_.values(qmlPropGroup);
if (t.isEmpty())
return;
foreach (Node* n, t) {
@@ -773,12 +791,12 @@ void InnerNode::findChildren(const QString& name, NodeList& nodes) const
with the specified \a name is found but it is not of the
specified \a type, 0 is returned.
*/
-Node* InnerNode::findChildNode(const QString& name, Type type)
+Node* Aggregate::findChildNode(const QString& name, NodeType type)
{
if (type == Function)
- return primaryFunctionMap.value(name);
+ return primaryFunctionMap_.value(name);
else {
- NodeList nodes = childMap.values(name);
+ NodeList nodes = childMap_.values(name);
for (int i=0; i<nodes.size(); ++i) {
Node* node = nodes.at(i);
if (node->type() == type)
@@ -792,9 +810,9 @@ Node* InnerNode::findChildNode(const QString& name, Type type)
Find a function node that is a child of this nose, such
that the function node has the specified \a name.
*/
-FunctionNode *InnerNode::findFunctionNode(const QString& name) const
+FunctionNode *Aggregate::findFunctionNode(const QString& name) const
{
- return static_cast<FunctionNode *>(primaryFunctionMap.value(name));
+ return static_cast<FunctionNode *>(primaryFunctionMap_.value(name));
}
/*!
@@ -802,15 +820,15 @@ FunctionNode *InnerNode::findFunctionNode(const QString& name) const
that the function has the same name and signature as the
\a clone node.
*/
-FunctionNode *InnerNode::findFunctionNode(const FunctionNode *clone) const
+FunctionNode *Aggregate::findFunctionNode(const FunctionNode *clone) const
{
- QMap<QString,Node*>::ConstIterator c = primaryFunctionMap.constFind(clone->name());
- if (c != primaryFunctionMap.constEnd()) {
+ QMap<QString,Node*>::ConstIterator c = primaryFunctionMap_.constFind(clone->name());
+ if (c != primaryFunctionMap_.constEnd()) {
if (isSameSignature(clone, (FunctionNode *) *c)) {
return (FunctionNode *) *c;
}
- else if (secondaryFunctionMap.contains(clone->name())) {
- const NodeList& secs = secondaryFunctionMap[clone->name()];
+ else if (secondaryFunctionMap_.contains(clone->name())) {
+ const NodeList& secs = secondaryFunctionMap_[clone->name()];
NodeList::ConstIterator s = secs.constBegin();
while (s != secs.constEnd()) {
if (isSameSignature(clone, (FunctionNode *) *s))
@@ -825,11 +843,11 @@ FunctionNode *InnerNode::findFunctionNode(const FunctionNode *clone) const
/*!
Returns the list of keys from the primary function map.
*/
-QStringList InnerNode::primaryKeys()
+QStringList Aggregate::primaryKeys()
{
QStringList t;
- QMap<QString, Node*>::iterator i = primaryFunctionMap.begin();
- while (i != primaryFunctionMap.end()) {
+ QMap<QString, Node*>::iterator i = primaryFunctionMap_.begin();
+ while (i != primaryFunctionMap_.end()) {
t.append(i.key());
++i;
}
@@ -839,11 +857,11 @@ QStringList InnerNode::primaryKeys()
/*!
Returns the list of keys from the secondary function map.
*/
-QStringList InnerNode::secondaryKeys()
+QStringList Aggregate::secondaryKeys()
{
QStringList t;
- QMap<QString, NodeList>::iterator i = secondaryFunctionMap.begin();
- while (i != secondaryFunctionMap.end()) {
+ QMap<QString, NodeList>::iterator i = secondaryFunctionMap_.begin();
+ while (i != secondaryFunctionMap_.end()) {
t.append(i.key());
++i;
}
@@ -851,43 +869,13 @@ QStringList InnerNode::secondaryKeys()
}
/*!
- */
-void InnerNode::setOverload(FunctionNode *func, bool overlode)
-{
- Node *node = (Node *) func;
- Node *&primary = primaryFunctionMap[func->name()];
-
- if (secondaryFunctionMap.contains(func->name())) {
- NodeList& secs = secondaryFunctionMap[func->name()];
- if (overlode) {
- if (primary == node) {
- primary = secs.first();
- secs.erase(secs.begin());
- secs.append(node);
- }
- else {
- secs.removeAll(node);
- secs.append(node);
- }
- }
- else {
- if (primary != node) {
- secs.removeAll(node);
- secs.prepend(primary);
- primary = node;
- }
- }
- }
-}
-
-/*!
Mark all child nodes that have no documentation as having
private access and internal status. qdoc will then ignore
them for documentation purposes. Some nodes have an
Intermediate status, meaning that they should be ignored,
but not their children.
*/
-void InnerNode::makeUndocumentedChildrenInternal()
+void Aggregate::makeUndocumentedChildrenInternal()
{
foreach (Node *child, childNodes()) {
if (child->doc().isEmpty() && child->status() != Node::Intermediate) {
@@ -898,68 +886,109 @@ void InnerNode::makeUndocumentedChildrenInternal()
}
/*!
+ This is where we should set the overload numbers, including
+ the related non-members.
*/
-void InnerNode::normalizeOverloads()
+void Aggregate::normalizeOverloads()
{
- QMap<QString, Node *>::Iterator p1 = primaryFunctionMap.begin();
- while (p1 != primaryFunctionMap.end()) {
+ QMap<QString, Node *>::Iterator p1 = primaryFunctionMap_.begin();
+ while (p1 != primaryFunctionMap_.end()) {
FunctionNode *primaryFunc = (FunctionNode *) *p1;
- if (secondaryFunctionMap.contains(primaryFunc->name()) &&
- (primaryFunc->status() != Commendable ||
- primaryFunc->access() == Private)) {
-
- NodeList& secs = secondaryFunctionMap[primaryFunc->name()];
- NodeList::ConstIterator s = secs.constBegin();
- while (s != secs.constEnd()) {
- FunctionNode *secondaryFunc = (FunctionNode *) *s;
-
- // Any non-obsolete, non-compatibility, non-private functions
- // (i.e, visible functions) are preferable to the primary
- // function.
-
- if (secondaryFunc->status() == Commendable &&
- secondaryFunc->access() != Private) {
-
- *p1 = secondaryFunc;
- int index = secondaryFunctionMap[primaryFunc->name()].indexOf(secondaryFunc);
- secondaryFunctionMap[primaryFunc->name()].replace(index, primaryFunc);
- break;
+ if (primaryFunc->status() != Active || primaryFunc->access() == Private) {
+ if (secondaryFunctionMap_.contains(primaryFunc->name())) {
+ /*
+ Either the primary function is not active or it is private.
+ It therefore can't be the primary function. Search the list
+ of overloads to find one that can be the primary function.
+ */
+ NodeList& overloads = secondaryFunctionMap_[primaryFunc->name()];
+ NodeList::ConstIterator s = overloads.constBegin();
+ while (s != overloads.constEnd()) {
+ FunctionNode *overloadFunc = (FunctionNode *) *s;
+ /*
+ Any non-obsolete, non-private function (i.e., visible function)
+ is preferable to the current primary function. Swap the primary
+ and overload functions.
+ */
+ if (overloadFunc->status() == Active && overloadFunc->access() != Private) {
+ primaryFunc->setOverloadNumber(overloadFunc->overloadNumber());
+ overloads.replace(overloads.indexOf(overloadFunc), primaryFunc);
+ *p1 = overloadFunc;
+ overloadFunc->setOverloadFlag(false);
+ overloadFunc->setOverloadNumber(0);
+ break;
+ }
+ ++s;
}
- ++s;
}
}
++p1;
}
-
- QMap<QString, Node *>::ConstIterator p = primaryFunctionMap.constBegin();
- while (p != primaryFunctionMap.constEnd()) {
+ /*
+ Ensure that none of the primary functions is marked with \overload.
+ */
+ QMap<QString, Node *>::Iterator p = primaryFunctionMap_.begin();
+ while (p != primaryFunctionMap_.end()) {
FunctionNode *primaryFunc = (FunctionNode *) *p;
- if (primaryFunc->isOverload())
- primaryFunc->ove = false;
- if (secondaryFunctionMap.contains(primaryFunc->name())) {
- NodeList& secs = secondaryFunctionMap[primaryFunc->name()];
- NodeList::ConstIterator s = secs.constBegin();
- while (s != secs.constEnd()) {
- FunctionNode *secondaryFunc = (FunctionNode *) *s;
- if (!secondaryFunc->isOverload())
- secondaryFunc->ove = true;
- ++s;
+ if (primaryFunc->isOverload()) {
+ if (secondaryFunctionMap_.contains(primaryFunc->name())) {
+ /*
+ The primary function is marked with \overload. Find an
+ overload in the secondary function map that is not marked
+ with \overload but that is active and not private. Then
+ swap it with the primary function.
+ */
+ NodeList& overloads = secondaryFunctionMap_[primaryFunc->name()];
+ NodeList::ConstIterator s = overloads.constBegin();
+ while (s != overloads.constEnd()) {
+ FunctionNode *overloadFunc = (FunctionNode *) *s;
+ if (!overloadFunc->isOverload()) {
+ if (overloadFunc->status() == Active && overloadFunc->access() != Private) {
+ primaryFunc->setOverloadNumber(overloadFunc->overloadNumber());
+ overloads.replace(overloads.indexOf(overloadFunc), primaryFunc);
+ *p = overloadFunc;
+ overloadFunc->setOverloadFlag(false);
+ overloadFunc->setOverloadNumber(0);
+ break;
+ }
+ }
+ ++s;
+ }
}
}
++p;
}
-
+ /*
+ Add the related non-members here.
+ */
+ if (!related_.isEmpty()) {
+ foreach (Node* n, related_) {
+ if (n->isFunction()) {
+ FunctionNode* fn = static_cast<FunctionNode*>(n);
+ QMap<QString, Node *>::Iterator p = primaryFunctionMap_.find(fn->name());
+ if (p != primaryFunctionMap_.end()) {
+ secondaryFunctionMap_[fn->name()].append(fn);
+ fn->setOverloadNumber(secondaryFunctionMap_[fn->name()].size());
+ }
+ else
+ fn->setOverloadNumber(0);
+ }
+ }
+ }
+ /*
+ Recursive part.
+ */
NodeList::ConstIterator c = childNodes().constBegin();
while (c != childNodes().constEnd()) {
- if ((*c)->isInnerNode())
- ((InnerNode *) *c)->normalizeOverloads();
+ if ((*c)->isAggregate())
+ ((Aggregate *) *c)->normalizeOverloads();
++c;
}
}
/*!
*/
-void InnerNode::removeFromRelated()
+void Aggregate::removeFromRelated()
{
while (!related_.isEmpty()) {
Node *p = static_cast<Node *>(related_.takeFirst());
@@ -971,13 +1000,13 @@ void InnerNode::removeFromRelated()
/*!
Deletes all this node's children.
*/
-void InnerNode::deleteChildren()
+void Aggregate::deleteChildren()
{
NodeList childrenCopy = children_; // `children_` will be changed in ~Node()
qDeleteAll(childrenCopy);
}
-/*! \fn bool InnerNode::isInnerNode() const
+/*! \fn bool Aggregate::isAggregate() const
Returns \c true because this is an inner node.
*/
@@ -997,7 +1026,7 @@ bool Node::isWrapper() const
no enum type node is found that has \a enumValue as one
of its values.
*/
-const EnumNode *InnerNode::findEnumNodeForValue(const QString &enumValue) const
+const EnumNode *Aggregate::findEnumNodeForValue(const QString &enumValue) const
{
foreach (const Node *node, enumChildren_) {
const EnumNode *en = static_cast<const EnumNode *>(node);
@@ -1008,32 +1037,16 @@ const EnumNode *InnerNode::findEnumNodeForValue(const QString &enumValue) const
}
/*!
- Returnds the sequence number of the function node \a func
- in the list of overloaded functions for a class, such that
- all the functions have the same name as the \a func.
- */
-int InnerNode::overloadNumber(const FunctionNode *func) const
-{
- Node *node = const_cast<FunctionNode *>(func);
- if (primaryFunctionMap[func->name()] == node) {
- return 1;
- }
- else {
- return secondaryFunctionMap[func->name()].indexOf(node) + 2;
- }
-}
-
-/*!
Returns a node list containing all the member functions of
some class such that the functions overload the name \a funcName.
*/
-NodeList InnerNode::overloads(const QString &funcName) const
+NodeList Aggregate::overloads(const QString &funcName) const
{
NodeList result;
- Node *primary = primaryFunctionMap.value(funcName);
+ Node *primary = primaryFunctionMap_.value(funcName);
if (primary) {
result << primary;
- result += secondaryFunctionMap[funcName];
+ result += secondaryFunctionMap_[funcName];
}
return result;
}
@@ -1042,7 +1055,7 @@ NodeList InnerNode::overloads(const QString &funcName) const
Construct an inner node (i.e., not a leaf node) of the
given \a type and having the given \a parent and \a name.
*/
-InnerNode::InnerNode(Type type, InnerNode *parent, const QString& name)
+Aggregate::Aggregate(NodeType type, Aggregate *parent, const QString& name)
: Node(type, parent, name)
{
switch (type) {
@@ -1059,7 +1072,7 @@ InnerNode::InnerNode(Type type, InnerNode *parent, const QString& name)
/*!
Appends an \a include file to the list of include files.
*/
-void InnerNode::addInclude(const QString& include)
+void Aggregate::addInclude(const QString& include)
{
includes_.append(include);
}
@@ -1067,7 +1080,7 @@ void InnerNode::addInclude(const QString& include)
/*!
Sets the list of include files to \a includes.
*/
-void InnerNode::setIncludes(const QStringList& includes)
+void Aggregate::setIncludes(const QStringList& includes)
{
includes_ = includes;
}
@@ -1075,7 +1088,7 @@ void InnerNode::setIncludes(const QStringList& includes)
/*!
f1 is always the clone
*/
-bool InnerNode::isSameSignature(const FunctionNode *f1, const FunctionNode *f2)
+bool Aggregate::isSameSignature(const FunctionNode *f1, const FunctionNode *f2)
{
if (f1->parameters().count() != f2->parameters().count())
return false;
@@ -1113,23 +1126,26 @@ bool InnerNode::isSameSignature(const FunctionNode *f1, const FunctionNode *f2)
be necessary to update this node's internal collections and
the child's parent pointer and output subdirectory.
*/
-void InnerNode::addChild(Node *child)
+void Aggregate::addChild(Node *child)
{
children_.append(child);
if ((child->type() == Function) || (child->type() == QmlMethod)) {
- FunctionNode *func = (FunctionNode *) child;
- if (!primaryFunctionMap.contains(func->name())) {
- primaryFunctionMap.insert(func->name(), func);
+ FunctionNode *func = static_cast<FunctionNode*>(child);
+ QString name = func->name();
+ if (!primaryFunctionMap_.contains(name)) {
+ primaryFunctionMap_.insert(name, func);
+ func->setOverloadNumber(0);
}
else {
- NodeList &secs = secondaryFunctionMap[func->name()];
- secs.append(func);
+ NodeList &overloads = secondaryFunctionMap_[name];
+ overloads.append(func);
+ func->setOverloadNumber(overloads.size());
}
}
else {
if (child->type() == Enum)
enumChildren_.append(child);
- childMap.insertMulti(child->name(), child);
+ childMap_.insertMulti(child->name(), child);
}
if (child->parent() == 0) {
child->setParent(this);
@@ -1143,9 +1159,9 @@ void InnerNode::addChild(Node *child)
again, because it is presumed to already be there. We just
want to be able to find the child by its \a title.
*/
-void InnerNode::addChild(Node* child, const QString& title)
+void Aggregate::addChild(Node* child, const QString& title)
{
- childMap.insertMulti(title, child);
+ childMap_.insertMulti(title, child);
}
/*!
@@ -1154,40 +1170,38 @@ void InnerNode::addChild(Node* child, const QString& title)
pointer is set to 0, but its output subdirectory is not
changed.
*/
-void InnerNode::removeChild(Node *child)
+void Aggregate::removeChild(Node *child)
{
children_.removeAll(child);
enumChildren_.removeAll(child);
if (child->type() == Function) {
- QMap<QString, Node *>::Iterator prim =
- primaryFunctionMap.find(child->name());
- NodeList& secs = secondaryFunctionMap[child->name()];
- if (prim != primaryFunctionMap.end() && *prim == child) {
- if (secs.isEmpty()) {
- primaryFunctionMap.remove(child->name());
- }
- else {
- primaryFunctionMap.insert(child->name(), secs.takeFirst());
+ QMap<QString, Node *>::Iterator primary = primaryFunctionMap_.find(child->name());
+ NodeList& overloads = secondaryFunctionMap_[child->name()];
+ if (primary != primaryFunctionMap_.end() && *primary == child) {
+ primaryFunctionMap_.erase(primary);
+ if (!overloads.isEmpty()) {
+ FunctionNode* fn = static_cast<FunctionNode*>(overloads.takeFirst());
+ fn->setOverloadNumber(0);
+ primaryFunctionMap_.insert(child->name(), fn);
}
}
- else {
- secs.removeAll(child);
- }
+ else
+ overloads.removeAll(child);
}
- QMap<QString, Node *>::Iterator ent = childMap.find(child->name());
- while (ent != childMap.end() && ent.key() == child->name()) {
+ QMap<QString, Node *>::Iterator ent = childMap_.find(child->name());
+ while (ent != childMap_.end() && ent.key() == child->name()) {
if (*ent == child) {
- childMap.erase(ent);
+ childMap_.erase(ent);
break;
}
++ent;
}
if (child->title().isEmpty())
return;
- ent = childMap.find(child->title());
- while (ent != childMap.end() && ent.key() == child->title()) {
+ ent = childMap_.find(child->title());
+ while (ent != childMap_.end() && ent.key() == child->title()) {
if (*ent == child) {
- childMap.erase(ent);
+ childMap_.erase(ent);
break;
}
++ent;
@@ -1198,7 +1212,7 @@ void InnerNode::removeChild(Node *child)
/*!
Recursively sets the output subdirectory for children
*/
-void InnerNode::setOutputSubdirectory(const QString &t)
+void Aggregate::setOutputSubdirectory(const QString &t)
{
Node::setOutputSubdirectory(t);
for (int i = 0; i < childNodes().size(); ++i)
@@ -1261,7 +1275,7 @@ QString Node::physicalModuleName() const
/*!
*/
-void InnerNode::removeRelated(Node *pseudoChild)
+void Aggregate::removeRelated(Node *pseudoChild)
{
related_.removeAll(pseudoChild);
}
@@ -1270,7 +1284,7 @@ void InnerNode::removeRelated(Node *pseudoChild)
If this node has a child that is a QML property named \a n,
return the pointer to that child.
*/
-QmlPropertyNode* InnerNode::hasQmlProperty(const QString& n) const
+QmlPropertyNode* Aggregate::hasQmlProperty(const QString& n) const
{
foreach (Node* child, childNodes()) {
if (child->type() == Node::QmlProperty) {
@@ -1291,7 +1305,7 @@ QmlPropertyNode* InnerNode::hasQmlProperty(const QString& n) const
whose type (attached or normal property) matches \a attached,
return the pointer to that child.
*/
-QmlPropertyNode* InnerNode::hasQmlProperty(const QString& n, bool attached) const
+QmlPropertyNode* Aggregate::hasQmlProperty(const QString& n, bool attached) const
{
foreach (Node* child, childNodes()) {
if (child->type() == Node::QmlProperty) {
@@ -1311,7 +1325,7 @@ QmlPropertyNode* InnerNode::hasQmlProperty(const QString& n, bool attached) cons
\class LeafNode
*/
-/*! \fn bool LeafNode::isInnerNode() const
+/*! \fn bool LeafNode::isAggregate() const
Returns \c false because this is a LeafNode.
*/
@@ -1319,7 +1333,7 @@ QmlPropertyNode* InnerNode::hasQmlProperty(const QString& n, bool attached) cons
Constructs a leaf node named \a name of the specified
\a type. The new leaf node becomes a child of \a parent.
*/
-LeafNode::LeafNode(Type type, InnerNode *parent, const QString& name)
+LeafNode::LeafNode(NodeType type, Aggregate *parent, const QString& name)
: Node(type, parent, name)
{
switch (type) {
@@ -1346,7 +1360,7 @@ LeafNode::LeafNode(Type type, InnerNode *parent, const QString& name)
documentation case where a \e{qmlproperty} command is used
to override the QML definition of a QML property.
*/
-LeafNode::LeafNode(InnerNode* parent, Type type, const QString& name)
+LeafNode::LeafNode(Aggregate* parent, NodeType type, const QString& name)
: Node(type, 0, name)
{
setParent(parent);
@@ -1374,8 +1388,8 @@ LeafNode::LeafNode(InnerNode* parent, Type type, const QString& name)
/*!
Constructs a namespace node.
*/
-NamespaceNode::NamespaceNode(InnerNode *parent, const QString& name)
- : InnerNode(Namespace, parent, name), seen_(false), tree_(0)
+NamespaceNode::NamespaceNode(Aggregate *parent, const QString& name)
+ : Aggregate(Namespace, parent, name), seen_(false), tree_(0)
{
setGenus(Node::CPP);
setPageType(ApiPage);
@@ -1389,8 +1403,8 @@ NamespaceNode::NamespaceNode(InnerNode *parent, const QString& name)
/*!
Constructs a class node. A class node will generate an API page.
*/
-ClassNode::ClassNode(InnerNode *parent, const QString& name)
- : InnerNode(Class, parent, name)
+ClassNode::ClassNode(Aggregate *parent, const QString& name)
+ : Aggregate(Class, parent, name)
{
abstract_ = false;
wrapper_ = false;
@@ -1584,8 +1598,8 @@ QmlTypeNode* ClassNode::findQmlBaseNode()
which specifies the type of DocumentNode. The page type for
the page index is set here.
*/
-DocumentNode::DocumentNode(InnerNode* parent, const QString& name, SubType subtype, Node::PageType ptype)
- : InnerNode(Document, parent, name), nodeSubtype_(subtype)
+DocumentNode::DocumentNode(Aggregate* parent, const QString& name, DocSubtype subtype, Node::PageType ptype)
+ : Aggregate(Document, parent, name), nodeSubtype_(subtype)
{
setGenus(Node::DOC);
switch (subtype) {
@@ -1618,7 +1632,7 @@ void DocumentNode::setTitle(const QString &title)
/*!
Returns the document node's full title, which is usually
- just title(), but for some SubType values is different
+ just title(), but for some DocSubtype values is different
from title()
*/
QString DocumentNode::fullTitle() const
@@ -1669,8 +1683,8 @@ QString DocumentNode::subTitle() const
The constructor for the node representing an enum type
has a \a parent class and an enum type \a name.
*/
-EnumNode::EnumNode(InnerNode *parent, const QString& name)
- : LeafNode(Enum, parent, name), ft(0)
+EnumNode::EnumNode(Aggregate *parent, const QString& name)
+ : LeafNode(Enum, parent, name), flagsType_(0)
{
setGenus(Node::CPP);
}
@@ -1680,8 +1694,8 @@ EnumNode::EnumNode(InnerNode *parent, const QString& name)
*/
void EnumNode::addItem(const EnumItem& item)
{
- itms.append(item);
- names.insert(item.name());
+ items_.append(item);
+ names_.insert(item.name());
}
/*!
@@ -1701,7 +1715,7 @@ Node::Access EnumNode::itemAccess(const QString &name) const
*/
QString EnumNode::itemValue(const QString &name) const
{
- foreach (const EnumItem &item, itms) {
+ foreach (const EnumItem &item, items_) {
if (item.name() == name)
return item.value();
}
@@ -1714,8 +1728,8 @@ QString EnumNode::itemValue(const QString &name) const
/*!
*/
-TypedefNode::TypedefNode(InnerNode *parent, const QString& name)
- : LeafNode(Typedef, parent, name), ae(0)
+TypedefNode::TypedefNode(Aggregate *parent, const QString& name)
+ : LeafNode(Typedef, parent, name), associatedEnum_(0)
{
setGenus(Node::CPP);
}
@@ -1724,7 +1738,7 @@ TypedefNode::TypedefNode(InnerNode *parent, const QString& name)
*/
void TypedefNode::setAssociatedEnum(const EnumNode *enume)
{
- ae = enume;
+ associatedEnum_ = enume;
}
/*!
@@ -1745,7 +1759,7 @@ Parameter::Parameter(const QString& leftType,
const QString& rightType,
const QString& name,
const QString& defaultValue)
- : lef(leftType), rig(rightType), nam(name), def(defaultValue)
+ : leftType_(leftType), rightType_(rightType), name_(name), defaultValue_(defaultValue)
{
}
@@ -1753,7 +1767,7 @@ Parameter::Parameter(const QString& leftType,
The standard copy constructor copies the strings from \a p.
*/
Parameter::Parameter(const Parameter& p)
- : lef(p.lef), rig(p.rig), nam(p.nam), def(p.def)
+ : leftType_(p.leftType_), rightType_(p.rightType_), name_(p.name_), defaultValue_(p.defaultValue_)
{
}
@@ -1763,10 +1777,10 @@ Parameter::Parameter(const Parameter& p)
*/
Parameter& Parameter::operator=(const Parameter& p)
{
- lef = p.lef;
- rig = p.rig;
- nam = p.nam;
- def = p.def;
+ leftType_ = p.leftType_;
+ rightType_ = p.rightType_;
+ name_ = p.name_;
+ defaultValue_ = p.defaultValue_;
return *this;
}
@@ -1777,12 +1791,12 @@ Parameter& Parameter::operator=(const Parameter& p)
*/
QString Parameter::reconstruct(bool value) const
{
- QString p = lef + rig;
+ QString p = leftType_ + rightType_;
if (!p.endsWith(QChar('*')) && !p.endsWith(QChar('&')) && !p.endsWith(QChar(' ')))
p += QLatin1Char(' ');
- p += nam;
- if (value && !def.isEmpty())
- p += " = " + def;
+ p += name_;
+ if (value && !defaultValue_.isEmpty())
+ p += " = " + defaultValue_;
return p;
}
@@ -1794,19 +1808,21 @@ QString Parameter::reconstruct(bool value) const
/*!
Construct a function node for a C++ function. It's parent
is \a parent, and it's name is \a name.
+
+ Do not set overloadNumber_ in the initializer list because it
+ is set by addChild() in the Node base class.
*/
-FunctionNode::FunctionNode(InnerNode *parent, const QString& name)
+FunctionNode::FunctionNode(Aggregate *parent, const QString& name)
: LeafNode(Function, parent, name),
- met(Plain),
- vir(NonVirtual),
- con(false),
- sta(false),
- ove(false),
- reimp(false),
+ metaness_(Plain),
+ virtualness_(NonVirtual),
+ const_(false),
+ static_(false),
+ reimplemented_(false),
attached_(false),
privateSignal_(false),
- rf(0),
- ap(0)
+ overload_(false),
+ reimplementedFrom_(0)
{
setGenus(Node::CPP);
}
@@ -1815,19 +1831,21 @@ FunctionNode::FunctionNode(InnerNode *parent, const QString& name)
Construct a function node for a QML method or signal, specified
by \a type. It's parent is \a parent, and it's name is \a name.
If \a attached is true, it is an attached method or signal.
+
+ Do not set overloadNumber_ in the initializer list because it
+ is set by addChild() in the Node base class.
*/
-FunctionNode::FunctionNode(Type type, InnerNode *parent, const QString& name, bool attached)
+FunctionNode::FunctionNode(NodeType type, Aggregate *parent, const QString& name, bool attached)
: LeafNode(type, parent, name),
- met(Plain),
- vir(NonVirtual),
- con(false),
- sta(false),
- ove(false),
- reimp(false),
+ metaness_(Plain),
+ virtualness_(NonVirtual),
+ const_(false),
+ static_(false),
+ reimplemented_(false),
attached_(attached),
privateSignal_(false),
- rf(0),
- ap(0)
+ overload_(false),
+ reimplementedFrom_(0)
{
setGenus(Node::QML);
if (type == QmlMethod || type == QmlSignal) {
@@ -1843,32 +1861,33 @@ FunctionNode::FunctionNode(Type type, InnerNode *parent, const QString& name, bo
is PureVirtual, and if the parent() is a ClassNode, set the parent's
\e abstract flag to true.
*/
-void FunctionNode::setVirtualness(Virtualness virtualness)
+void FunctionNode::setVirtualness(Virtualness v)
{
- vir = virtualness;
- if ((virtualness == PureVirtual) && parent() &&
- (parent()->type() == Node::Class))
+ virtualness_ = v;
+ if ((v == PureVirtual) && parent() && (parent()->type() == Node::Class))
parent()->setAbstract(true);
}
-/*!
+/*! \fn void FunctionNode::setOverloadFlag(bool b)
+ Sets this function node's overload flag to \a b.
+ It does not set the overload number.
+ */
+
+/*! \fn void FunctionNode::setOverloadNumber(unsigned char n)
+ Sets this function node's overload number to \a n.
+ It does not set the overload flag.
*/
-void FunctionNode::setOverload(bool overlode)
-{
- parent()->setOverload(this, overlode);
- ove = overlode;
-}
/*!
- Sets the function node's reimplementation flag to \a r.
- When \a r is true, it is supposed to mean that this function
+ Sets the function node's reimplementation flag to \a b.
+ When \a b is true, it is supposed to mean that this function
is a reimplementation of a virtual function in a base class,
- but it really just means the \e reimp command was seen in the
- qdoc comment.
+ but it really just means the \e {\\reimp} command was seen in
+ the qdoc comment.
*/
-void FunctionNode::setReimp(bool r)
+void FunctionNode::setReimplemented(bool b)
{
- reimp = r;
+ reimplemented_ = b;
}
/*!
@@ -1876,16 +1895,16 @@ void FunctionNode::setReimp(bool r)
*/
void FunctionNode::addParameter(const Parameter& parameter)
{
- params.append(parameter);
+ parameters_.append(parameter);
}
/*!
*/
void FunctionNode::borrowParameterNames(const FunctionNode *source)
{
- QList<Parameter>::Iterator t = params.begin();
- QList<Parameter>::ConstIterator s = source->params.constBegin();
- while (s != source->params.constEnd() && t != params.end()) {
+ QList<Parameter>::Iterator t = parameters_.begin();
+ QList<Parameter>::ConstIterator s = source->parameters_.constBegin();
+ while (s != source->parameters_.constEnd() && t != parameters_.end()) {
if (!(*s).name().isEmpty())
(*t).setName((*s).name());
++s;
@@ -1897,30 +1916,42 @@ void FunctionNode::borrowParameterNames(const FunctionNode *source)
If this function is a reimplementation, \a from points
to the FunctionNode of the function being reimplemented.
*/
-void FunctionNode::setReimplementedFrom(FunctionNode *from)
+void FunctionNode::setReimplementedFrom(FunctionNode *f)
{
- rf = from;
- from->rb.append(this);
+ reimplementedFrom_ = f;
+ f->reimplementedBy_.append(this);
}
/*!
- Sets the "associated" property to \a property. The function
- might be the setter or getter for a property, for example.
+ Adds the "associated" property \a p to this function node.
+ The function might be the setter or getter for a property,
+ for example.
*/
-void FunctionNode::setAssociatedProperty(PropertyNode *property)
+void FunctionNode::addAssociatedProperty(PropertyNode *p)
{
- ap = property;
+ associatedProperties_.append(p);
}
/*!
- Returns the overload number for this function obtained
- from the parent.
+ Returns true if this function has at least one property
+ that is active, i.e. at least one property that is not
+ obsolete.
*/
-int FunctionNode::overloadNumber() const
+bool FunctionNode::hasActiveAssociatedProperty() const
{
- return parent()->overloadNumber(this);
+ if (associatedProperties_.isEmpty())
+ return false;
+ foreach (const PropertyNode* p, associatedProperties_) {
+ if (!p->isObsolete())
+ return true;
+ }
+ return false;
}
+/*! \fn unsigned char FunctionNode::overloadNumber() const
+ Returns the overload number for this function.
+ */
+
/*!
Returns the list of parameter names.
*/
@@ -1957,15 +1988,15 @@ QString FunctionNode::rawParameters(bool names, bool values) const
Returns the list of reconstructed parameters. If \a values
is true, the default values are included, if any are present.
*/
-QStringList FunctionNode::reconstructParams(bool values) const
+QStringList FunctionNode::reconstructParameters(bool values) const
{
- QStringList params;
+ QStringList reconstructedParameters;
QList<Parameter>::ConstIterator p = parameters().constBegin();
while (p != parameters().constEnd()) {
- params << (*p).reconstruct(values);
+ reconstructedParameters << (*p).reconstruct(values);
++p;
}
- return params;
+ return reconstructedParameters;
}
/*!
@@ -1979,11 +2010,11 @@ QString FunctionNode::signature(bool values) const
if (!returnType().isEmpty())
s = returnType() + QLatin1Char(' ');
s += name() + QLatin1Char('(');
- QStringList params = reconstructParams(values);
- int p = params.size();
+ QStringList reconstructedParameters = reconstructParameters(values);
+ int p = reconstructedParameters.size();
if (p > 0) {
for (int i=0; i<p; i++) {
- s += params[i];
+ s += reconstructedParameters[i];
if (i < (p-1))
s += ", ";
}
@@ -1993,12 +2024,25 @@ QString FunctionNode::signature(bool values) const
}
/*!
+ Returns true if function \a fn has role \a r for this
+ property.
+ */
+PropertyNode::FunctionRole PropertyNode::role(const FunctionNode* fn) const
+{
+ for (int i=0; i<4; i++) {
+ if (functions_[i].contains((Node*)fn))
+ return (FunctionRole) i;
+ }
+ return Notifier;
+}
+
+/*!
Print some debugging stuff.
*/
void FunctionNode::debug() const
{
- qDebug("QML METHOD %s rt %s pp %s",
- qPrintable(name()), qPrintable(rt), qPrintable(pp.join(' ')));
+ qDebug("QML METHOD %s returnType_ %s parentPath_ %s",
+ qPrintable(name()), qPrintable(returnType_), qPrintable(parentPath_.join(' ')));
}
/*!
@@ -2011,17 +2055,17 @@ void FunctionNode::debug() const
The constructor sets the \a parent and the \a name, but
everything else is set to default values.
*/
-PropertyNode::PropertyNode(InnerNode *parent, const QString& name)
+PropertyNode::PropertyNode(Aggregate *parent, const QString& name)
: LeafNode(Property, parent, name),
stored_(FlagValueDefault),
designable_(FlagValueDefault),
scriptable_(FlagValueDefault),
writable_(FlagValueDefault),
user_(FlagValueDefault),
- cst(false),
- fnl(false),
- rev(-1),
- overrides(0)
+ const_(false),
+ final_(false),
+ revision_(-1),
+ overrides_(0)
{
setGenus(Node::CPP);
}
@@ -2039,8 +2083,8 @@ PropertyNode::PropertyNode(InnerNode *parent, const QString& name)
void PropertyNode::setOverriddenFrom(const PropertyNode* baseProperty)
{
for (int i = 0; i < NumFunctionRoles; ++i) {
- if (funcs[i].isEmpty())
- funcs[i] = baseProperty->funcs[i];
+ if (functions_[i].isEmpty())
+ functions_[i] = baseProperty->functions_[i];
}
if (stored_ == FlagValueDefault)
stored_ = baseProperty->stored_;
@@ -2052,7 +2096,7 @@ void PropertyNode::setOverriddenFrom(const PropertyNode* baseProperty)
writable_ = baseProperty->writable_;
if (user_ == FlagValueDefault)
user_ = baseProperty->user_;
- overrides = baseProperty;
+ overrides_ = baseProperty;
}
/*!
@@ -2084,8 +2128,8 @@ QMultiMap<QString,Node*> QmlTypeNode::inheritedBy;
Constructs a Qml class node. The new node has the given
\a parent and \a name.
*/
-QmlTypeNode::QmlTypeNode(InnerNode *parent, const QString& name)
- : InnerNode(QmlType, parent, name),
+QmlTypeNode::QmlTypeNode(Aggregate *parent, const QString& name)
+ : Aggregate(QmlType, parent, name),
abstract_(false),
cnodeRequired_(false),
wrapper_(false),
@@ -2199,9 +2243,9 @@ QString QmlTypeNode::logicalModuleIdentifier() const
Constructs a Qml basic type node. The new node has the given
\a parent and \a name.
*/
-QmlBasicTypeNode::QmlBasicTypeNode(InnerNode *parent,
+QmlBasicTypeNode::QmlBasicTypeNode(Aggregate *parent,
const QString& name)
- : InnerNode(QmlBasicType, parent, name)
+ : Aggregate(QmlBasicType, parent, name)
{
setTitle(name);
setGenus(Node::QML);
@@ -2212,7 +2256,7 @@ QmlBasicTypeNode::QmlBasicTypeNode(InnerNode *parent,
always a QmlTypeNode.
*/
QmlPropertyGroupNode::QmlPropertyGroupNode(QmlTypeNode* parent, const QString& name)
- : InnerNode(QmlPropertyGroup, parent, name)
+ : Aggregate(QmlPropertyGroup, parent, name)
{
idNumber_ = -1;
setGenus(Node::QML);
@@ -2235,7 +2279,7 @@ QString QmlPropertyGroupNode::idNumber()
/*!
Constructor for the QML property node.
*/
-QmlPropertyNode::QmlPropertyNode(InnerNode* parent,
+QmlPropertyNode::QmlPropertyNode(Aggregate* parent,
const QString& name,
const QString& type,
bool attached)
@@ -2281,16 +2325,16 @@ bool QmlPropertyNode::isWritable()
if (pn)
return pn->isWritable();
else
- 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(logicalModuleName()).arg(qmlTypeName()).arg(name()));
+ defLocation().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(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(logicalModuleName()).arg(qmlTypeName()).arg(name()));
+ defLocation().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(logicalModuleName()).arg(qmlTypeName()).arg(name()));
}
}
return true;
@@ -2477,6 +2521,7 @@ QString Node::cleanId(const QString &str)
return clean;
}
+#if 0
/*!
Creates a string that can be used as a UUID for the node,
depending on the type and subtype of the node. Uniquenss
@@ -2574,14 +2619,14 @@ QString Node::idForNode() const
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();
+ << parent_->docSubtype() << func->name();
}
else
qDebug() << "qdoc internal error: Node type not handled:"
<< parent_->type() << func->name();
}
- if (func->overloadNumber() != 1)
+ if (func->overloadNumber() != 0)
str += QLatin1Char('-') + QString::number(func->overloadNumber());
}
break;
@@ -2599,7 +2644,7 @@ QString Node::idForNode() const
break;
case Node::Document:
{
- switch (subType()) {
+ switch (docSubtype()) {
case Node::Page:
case Node::HeaderFile:
str = title();
@@ -2620,7 +2665,7 @@ QString Node::idForNode() const
break;
default:
qDebug() << "ERROR: A case was not handled in Node::idForNode():"
- << "subType():" << subType() << "type():" << type();
+ << "docSubtype():" << docSubtype() << "type():" << type();
break;
}
}
@@ -2682,7 +2727,7 @@ QString Node::idForNode() const
else
str = "js-method-";
str += parent_->name().toLower() + "-" + func->name();
- if (func->overloadNumber() != 1)
+ if (func->overloadNumber() != 0)
str += QLatin1Char('-') + QString::number(func->overloadNumber());
break;
case Node::Variable:
@@ -2690,12 +2735,12 @@ QString Node::idForNode() const
break;
default:
qDebug() << "ERROR: A case was not handled in Node::idForNode():"
- << "type():" << type() << "subType():" << subType();
+ << "type():" << type() << "docSubtype():" << docSubtype();
break;
}
if (str.isEmpty()) {
qDebug() << "ERROR: A link text was empty in Node::idForNode():"
- << "type():" << type() << "subType():" << subType()
+ << "type():" << type() << "docSubtype():" << docSubtype()
<< "name():" << name()
<< "title():" << title();
}
@@ -2704,12 +2749,13 @@ QString Node::idForNode() const
}
return str;
}
+#endif
/*!
Prints the inner node's list of children.
For debugging only.
*/
-void InnerNode::printChildren(const QString& title)
+void Aggregate::printChildren(const QString& title)
{
qDebug() << title << name() << children_.size();
if (children_.size() > 0) {
diff --git a/src/tools/qdoc/node.h b/src/tools/qdoc/node.h
index 2ccd97dbd1..f852e480a6 100644
--- a/src/tools/qdoc/node.h
+++ b/src/tools/qdoc/node.h
@@ -48,7 +48,7 @@ class Node;
class Tree;
class EnumNode;
class ClassNode;
-class InnerNode;
+class Aggregate;
class ExampleNode;
class TypedefNode;
class QmlTypeNode;
@@ -59,6 +59,7 @@ class CollectionNode;
class QmlPropertyNode;
typedef QList<Node*> NodeList;
+typedef QList<PropertyNode*> PropNodeList;
typedef QMap<QString, Node*> NodeMap;
typedef QMultiMap<QString, Node*> NodeMultiMap;
typedef QPair<int, int> NodeTypePair;
@@ -71,7 +72,7 @@ class Node
Q_DECLARE_TR_FUNCTIONS(QDoc::Node)
public:
- enum Type {
+ enum NodeType {
NoType,
Namespace,
Class,
@@ -94,8 +95,8 @@ public:
LastType
};
- enum SubType {
- NoSubType,
+ enum DocSubtype {
+ NoSubtype,
Example,
HeaderFile,
File,
@@ -115,7 +116,7 @@ public:
Obsolete,
Deprecated,
Preliminary,
- Commendable,
+ Active,
Internal,
Intermediate
}; // don't reorder this enum
@@ -132,13 +133,7 @@ public:
NextLink,
PreviousLink,
ContentsLink,
- IndexLink /*,
- GlossaryLink,
- CopyrightLink,
- ChapterLink,
- SectionLink,
- SubsectionLink,
- AppendixLink */
+ IndexLink
};
enum PageType {
@@ -172,24 +167,24 @@ public:
Node::Genus genus() const { return (Genus) genus_; }
void setGenus(Genus t) { genus_ = (unsigned char) t; }
- void setAccess(Access access) { access_ = (unsigned char) access; }
- void setLocation(const Location& location) { loc_ = location; }
+ void setAccess(Access t) { access_ = (unsigned char) t; }
+ void setLocation(const Location& t);
void setDoc(const Doc& doc, bool replace = false);
- void setStatus(Status status) {
- if (status_ == (unsigned char) Obsolete && status == Deprecated)
+ void setStatus(Status t) {
+ if (status_ == (unsigned char) Obsolete && t == Deprecated)
return;
- status_ = (unsigned char) status;
+ status_ = (unsigned char) t;
}
- void setThreadSafeness(ThreadSafeness safeness) { safeness_ = (unsigned char) safeness; }
+ void setThreadSafeness(ThreadSafeness t) { safeness_ = (unsigned char) t; }
void setSince(const QString &since);
- void setRelates(InnerNode* pseudoParent);
+ void setRelates(Aggregate* pseudoParent);
void setPhysicalModuleName(const QString &name) { physicalModuleName_ = name; }
void setUrl(const QString& url) { url_ = url; }
- void setTemplateStuff(const QString &templateStuff) { templateStuff_ = templateStuff; }
+ void setTemplateStuff(const QString &t) { templateStuff_ = t; }
void setReconstitutedBrief(const QString &t) { reconstitutedBrief_ = t; }
void setPageType(PageType t) { pageType_ = (unsigned char) t; }
void setPageType(const QString& t);
- void setParent(InnerNode* n) { parent_ = n; }
+ void setParent(Aggregate* n) { parent_ = n; }
void setIndexNodeFlag() { indexNodeFlag_ = true; }
virtual void setOutputFileName(const QString& ) { }
@@ -197,7 +192,7 @@ public:
bool isJsNode() const { return genus() == JS; }
bool isCppNode() const { return genus() == CPP; }
- virtual bool isInnerNode() const = 0;
+ virtual bool isAggregate() const = 0;
virtual bool isCollectionNode() const { return false; }
virtual bool isDocumentNode() const { return false; }
virtual bool isGroup() const { return false; }
@@ -208,11 +203,12 @@ public:
virtual bool isJsType() const { return false; }
virtual bool isQmlBasicType() const { return false; }
virtual bool isJsBasicType() const { return false; }
+ virtual bool isEnumType() const { return false; }
virtual bool isExample() const { return false; }
virtual bool isExampleFile() const { return false; }
virtual bool isHeaderFile() const { return false; }
virtual bool isLeaf() const { return false; }
- virtual bool isReimp() const { return false; }
+ virtual bool isReimplemented() const { return false; }
virtual bool isFunction() const { return false; }
virtual bool isNamespace() const { return false; }
virtual bool isClass() const { return false; }
@@ -253,19 +249,19 @@ public:
virtual bool isInternal() const;
virtual void setDataType(const QString& ) { }
virtual void setReadOnly(bool ) { }
- virtual Node* disambiguate(Type , SubType ) { return this; }
+ virtual Node* disambiguate(NodeType , DocSubtype ) { return this; }
virtual bool wasSeen() const { return false; }
virtual void appendGroupName(const QString& ) { }
virtual QString element() const { return QString(); }
virtual Tree* tree() const;
virtual void findChildren(const QString& , NodeList& nodes) const { nodes.clear(); }
bool isIndexNode() const { return indexNodeFlag_; }
- Type type() const { return (Type) nodeType_; }
- virtual SubType subType() const { return NoSubType; }
+ NodeType type() const { return (NodeType) nodeType_; }
+ virtual DocSubtype docSubtype() const { return NoSubtype; }
bool match(const NodeTypeList& types) const;
- InnerNode* parent() const { return parent_; }
+ Aggregate* parent() const { return parent_; }
const Node* root() const;
- InnerNode* relates() const { return relatesTo_; }
+ Aggregate* relates() const { return relatesTo_; }
const QString& name() const { return name_; }
QString physicalModuleName() const;
QString url() const { return url_; }
@@ -282,7 +278,9 @@ public:
Access access() const { return (Access) access_; }
bool isPrivate() const { return (Access) access_ == Private; }
QString accessString() const;
- const Location& location() const { return loc_; }
+ const Location& declLocation() const { return declLocation_; }
+ const Location& defLocation() const { return defLocation_; }
+ const Location& location() const { return (defLocation_.isEmpty() ? declLocation_ : defLocation_); }
const Doc& doc() const { return doc_; }
bool hasDoc() const { return !doc_.isEmpty(); }
Status status() const { return (Status) status_; }
@@ -301,7 +299,7 @@ public:
void clearRelated() { relatesTo_ = 0; }
- QString guid() const;
+ //QString guid() const;
QString extractClassName(const QString &string) const;
virtual QString qmlTypeName() const { return name_; }
virtual QString qmlFullBaseName() const { return QString(); }
@@ -322,7 +320,7 @@ public:
virtual void setOutputSubdirectory(const QString& t) { outSubDir_ = t; }
QString fullDocumentName() const;
static QString cleanId(const QString &str);
- QString idForNode() const;
+ //QString idForNode() const;
static FlagValue toFlagValue(bool b);
static bool fromFlagValue(FlagValue fv, bool defaultValue);
@@ -333,10 +331,10 @@ public:
static int incPropertyGroupCount();
static void clearPropertyGroupCount();
static void initialize();
- static Type goal(const QString& t) { return goals_.value(t); }
+ static NodeType goal(const QString& t) { return goals_.value(t); }
protected:
- Node(Type type, InnerNode* parent, const QString& name);
+ Node(NodeType type, Aggregate* parent, const QString& name);
private:
@@ -348,10 +346,11 @@ private:
unsigned char status_;
bool indexNodeFlag_;
- InnerNode* parent_;
- InnerNode* relatesTo_;
+ Aggregate* parent_;
+ Aggregate* relatesTo_;
QString name_;
- Location loc_;
+ Location declLocation_;
+ Location defLocation_;
Doc doc_;
QMap<LinkType, QPair<QString, QString> > linkMap_;
QString fileNameBase_;
@@ -360,39 +359,37 @@ private:
QString since_;
QString templateStuff_;
QString reconstitutedBrief_;
- mutable QString uuid_;
+ //mutable QString uuid_;
QString outSubDir_;
static QStringMap operators_;
static int propertyGroupCount_;
- static QMap<QString,Node::Type> goals_;
+ static QMap<QString,Node::NodeType> goals_;
};
-class InnerNode : public Node
+class Aggregate : public Node
{
public:
- virtual ~InnerNode();
+ virtual ~Aggregate();
Node* findChildNode(const QString& name, Node::Genus genus) const;
- Node* findChildNode(const QString& name, Type type);
+ Node* findChildNode(const QString& name, NodeType type);
virtual void findChildren(const QString& name, NodeList& nodes) const Q_DECL_OVERRIDE;
FunctionNode* findFunctionNode(const QString& name) const;
FunctionNode* findFunctionNode(const FunctionNode* clone) const;
void addInclude(const QString &include);
void setIncludes(const QStringList &includes);
- void setOverload(FunctionNode* func, bool overlode);
void normalizeOverloads();
void makeUndocumentedChildrenInternal();
void deleteChildren();
void removeFromRelated();
- virtual bool isInnerNode() const Q_DECL_OVERRIDE { return true; }
+ virtual bool isAggregate() 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_; }
int count() const { return children_.size(); }
- int overloadNumber(const FunctionNode* func) const;
NodeList overloads(const QString &funcName) const;
const QStringList& includes() const { return includes_; }
@@ -411,9 +408,11 @@ public:
void addChild(Node* child);
void removeChild(Node* child);
void setOutputSubdirectory(const QString& t) Q_DECL_OVERRIDE;
+ const NodeMap& primaryFunctionMap() { return primaryFunctionMap_; }
+ const QMap<QString, NodeList>& secondaryFunctionMap() { return secondaryFunctionMap_; }
protected:
- InnerNode(Type type, InnerNode* parent, const QString& name);
+ Aggregate(NodeType type, Aggregate* parent, const QString& name);
private:
friend class Node;
@@ -428,9 +427,9 @@ private:
NodeList children_;
NodeList enumChildren_;
NodeList related_;
- QMap<QString, Node*> childMap;
- QMap<QString, Node*> primaryFunctionMap;
- QMap<QString, NodeList> secondaryFunctionMap;
+ NodeMap childMap_;
+ NodeMap primaryFunctionMap_;
+ QMap<QString, NodeList> secondaryFunctionMap_;
};
class LeafNode : public Node
@@ -439,18 +438,18 @@ public:
LeafNode();
virtual ~LeafNode() { }
- virtual bool isInnerNode() const Q_DECL_OVERRIDE { return false; }
+ virtual bool isAggregate() const Q_DECL_OVERRIDE { return false; }
virtual bool isLeaf() const Q_DECL_OVERRIDE { return true; }
protected:
- LeafNode(Type type, InnerNode* parent, const QString& name);
- LeafNode(InnerNode* parent, Type type, const QString& name);
+ LeafNode(NodeType type, Aggregate* parent, const QString& name);
+ LeafNode(Aggregate* parent, NodeType type, const QString& name);
};
-class NamespaceNode : public InnerNode
+class NamespaceNode : public Aggregate
{
public:
- NamespaceNode(InnerNode* parent, const QString& name);
+ NamespaceNode(Aggregate* parent, const QString& name);
virtual ~NamespaceNode() { }
virtual bool isNamespace() const Q_DECL_OVERRIDE { return true; }
virtual Tree* tree() const Q_DECL_OVERRIDE { return (parent() ? parent()->tree() : tree_); }
@@ -498,10 +497,10 @@ struct UsingClause
QString signature_;
};
-class ClassNode : public InnerNode
+class ClassNode : public Aggregate
{
public:
- ClassNode(InnerNode* parent, const QString& name);
+ ClassNode(Aggregate* parent, const QString& name);
virtual ~ClassNode() { }
virtual bool isClass() const Q_DECL_OVERRIDE { return true; }
virtual bool isWrapper() const Q_DECL_OVERRIDE { return wrapper_; }
@@ -544,13 +543,13 @@ private:
QmlTypeNode* qmlelement;
};
-class DocumentNode : public InnerNode
+class DocumentNode : public Aggregate
{
public:
- DocumentNode(InnerNode* parent,
+ DocumentNode(Aggregate* parent,
const QString& name,
- SubType subType,
+ DocSubtype docSubtype,
PageType ptype);
virtual ~DocumentNode() { }
@@ -558,7 +557,7 @@ public:
virtual void setTitle(const QString &title) Q_DECL_OVERRIDE;
virtual void setSubTitle(const QString &subTitle) Q_DECL_OVERRIDE { subtitle_ = subTitle; }
- SubType subType() const Q_DECL_OVERRIDE { return nodeSubtype_; }
+ DocSubtype docSubtype() 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;
@@ -566,13 +565,13 @@ public:
virtual QString nameForLists() const Q_DECL_OVERRIDE { return title(); }
virtual void setImageFileName(const QString& ) { }
- virtual bool isHeaderFile() const Q_DECL_OVERRIDE { return (subType() == Node::HeaderFile); }
- virtual bool isExample() const Q_DECL_OVERRIDE { return (subType() == Node::Example); }
+ virtual bool isHeaderFile() const Q_DECL_OVERRIDE { return (docSubtype() == Node::HeaderFile); }
+ virtual bool isExample() const Q_DECL_OVERRIDE { return (docSubtype() == 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_;
+ DocSubtype nodeSubtype_;
QString title_;
QString subtitle_;
};
@@ -580,7 +579,7 @@ protected:
class ExampleNode : public DocumentNode
{
public:
- ExampleNode(InnerNode* parent, const QString& name)
+ ExampleNode(Aggregate* parent, const QString& name)
: DocumentNode(parent, name, Node::Example, Node::ExamplePage) { }
virtual ~ExampleNode() { }
virtual QString imageFileName() const Q_DECL_OVERRIDE { return imageFileName_; }
@@ -610,10 +609,10 @@ struct ImportRec {
typedef QList<ImportRec> ImportList;
-class QmlTypeNode : public InnerNode
+class QmlTypeNode : public Aggregate
{
public:
- QmlTypeNode(InnerNode* parent, const QString& name);
+ QmlTypeNode(Aggregate* 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; }
@@ -665,17 +664,17 @@ private:
ImportList importList_;
};
-class QmlBasicTypeNode : public InnerNode
+class QmlBasicTypeNode : public Aggregate
{
public:
- QmlBasicTypeNode(InnerNode* parent,
+ QmlBasicTypeNode(Aggregate* parent,
const QString& name);
virtual ~QmlBasicTypeNode() { }
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
+class QmlPropertyGroupNode : public Aggregate
{
public:
QmlPropertyGroupNode(QmlTypeNode* parent, const QString& name);
@@ -705,7 +704,7 @@ class QmlPropertyNode : public LeafNode
Q_DECLARE_TR_FUNCTIONS(QDoc::QmlPropertyNode)
public:
- QmlPropertyNode(InnerNode *parent,
+ QmlPropertyNode(Aggregate *parent,
const QString& name,
const QString& type,
bool attached);
@@ -760,57 +759,58 @@ class EnumItem
public:
EnumItem() { }
EnumItem(const QString& name, const QString& value)
- : nam(name), val(value) { }
+ : name_(name), value_(value) { }
- const QString& name() const { return nam; }
- const QString& value() const { return val; }
+ const QString& name() const { return name_; }
+ const QString& value() const { return value_; }
private:
- QString nam;
- QString val;
+ QString name_;
+ QString value_;
};
class EnumNode : public LeafNode
{
public:
- EnumNode(InnerNode* parent, const QString& name);
+ EnumNode(Aggregate* parent, const QString& name);
virtual ~EnumNode() { }
void addItem(const EnumItem& item);
void setFlagsType(TypedefNode* typedeff);
- bool hasItem(const QString &name) const { return names.contains(name); }
+ bool hasItem(const QString &name) const { return names_.contains(name); }
+ virtual bool isEnumType() const Q_DECL_OVERRIDE { return true; }
- const QList<EnumItem>& items() const { return itms; }
+ const QList<EnumItem>& items() const { return items_; }
Access itemAccess(const QString& name) const;
- const TypedefNode* flagsType() const { return ft; }
+ const TypedefNode* flagsType() const { return flagsType_; }
QString itemValue(const QString &name) const;
private:
- QList<EnumItem> itms;
- QSet<QString> names;
- const TypedefNode* ft;
+ QList<EnumItem> items_;
+ QSet<QString> names_;
+ const TypedefNode* flagsType_;
};
class TypedefNode : public LeafNode
{
public:
- TypedefNode(InnerNode* parent, const QString& name);
+ TypedefNode(Aggregate* parent, const QString& name);
virtual ~TypedefNode() { }
- const EnumNode* associatedEnum() const { return ae; }
+ const EnumNode* associatedEnum() const { return associatedEnum_; }
private:
- void setAssociatedEnum(const EnumNode* enume);
+ void setAssociatedEnum(const EnumNode* t);
friend class EnumNode;
- const EnumNode* ae;
+ const EnumNode* associatedEnum_;
};
-inline void EnumNode::setFlagsType(TypedefNode* typedeff)
+inline void EnumNode::setFlagsType(TypedefNode* t)
{
- ft = typedeff;
- typedeff->setAssociatedEnum(this);
+ flagsType_ = t;
+ t->setAssociatedEnum(this);
}
@@ -826,21 +826,21 @@ public:
Parameter& operator=(const Parameter& p);
- void setName(const QString& name) { nam = name; }
+ void setName(const QString& name) { name_ = name; }
- bool hasType() const { return lef.length() + rig.length() > 0; }
- const QString& leftType() const { return lef; }
- const QString& rightType() const { return rig; }
- const QString& name() const { return nam; }
- const QString& defaultValue() const { return def; }
+ bool hasType() const { return leftType_.length() + rightType_.length() > 0; }
+ const QString& leftType() const { return leftType_; }
+ const QString& rightType() const { return rightType_; }
+ const QString& name() const { return name_; }
+ const QString& defaultValue() const { return defaultValue_; }
QString reconstruct(bool value = false) const;
private:
- QString lef;
- QString rig;
- QString nam;
- QString def;
+ QString leftType_;
+ QString rightType_;
+ QString name_;
+ QString defaultValue_;
};
class FunctionNode : public LeafNode
@@ -855,35 +855,37 @@ public:
MacroWithParams,
MacroWithoutParams,
Native };
- enum Virtualness { NonVirtual, ImpureVirtual, PureVirtual };
+ enum Virtualness { NonVirtual, NormalVirtual, PureVirtual };
- FunctionNode(InnerNode* parent, const QString &name);
- FunctionNode(Type type, InnerNode* parent, const QString &name, bool attached);
+ FunctionNode(Aggregate* parent, const QString &name);
+ FunctionNode(NodeType type, Aggregate* parent, const QString &name, bool attached);
virtual ~FunctionNode() { }
- void setReturnType(const QString& returnType) { rt = returnType; }
- void setParentPath(const QStringList& parentPath) { pp = parentPath; }
- void setMetaness(Metaness metaness) { met = metaness; }
- void setVirtualness(Virtualness virtualness);
- void setConst(bool conste) { con = conste; }
- void setStatic(bool statique) { sta = statique; }
- void setOverload(bool overlode);
- void setReimp(bool r);
+ void setReturnType(const QString& t) { returnType_ = t; }
+ void setParentPath(const QStringList& p) { parentPath_ = p; }
+ void setMetaness(Metaness t) { metaness_ = t; }
+ void setVirtualness(Virtualness v);
+ void setConst(bool b) { const_ = b; }
+ void setStatic(bool b) { static_ = b; }
+ unsigned char overloadNumber() const { return overloadNumber_; }
+ void setOverloadFlag(bool b) { overload_ = b; }
+ void setOverloadNumber(unsigned char n) { overloadNumber_ = n; }
+ void setReimplemented(bool b);
void addParameter(const Parameter& parameter);
inline void setParameters(const QList<Parameter>& parameters);
void borrowParameterNames(const FunctionNode* source);
void setReimplementedFrom(FunctionNode* from);
- const QString& returnType() const { return rt; }
- Metaness metaness() const { return met; }
+ const QString& returnType() const { return returnType_; }
+ Metaness metaness() const { return metaness_; }
bool isMacro() const {
- return met == MacroWithParams || met == MacroWithoutParams;
+ return metaness_ == MacroWithParams || metaness_ == MacroWithoutParams;
}
- Virtualness virtualness() const { return vir; }
- bool isConst() const { return con; }
- bool isStatic() const { return sta; }
- bool isOverload() const { return ove; }
- bool isReimp() const Q_DECL_OVERRIDE { return reimp; }
+ Virtualness virtualness() const { return virtualness_; }
+ bool isConst() const { return const_; }
+ bool isStatic() const { return static_; }
+ bool isOverload() const { return overload_; }
+ bool isReimplemented() const Q_DECL_OVERRIDE { return reimplemented_; }
bool isFunction() const Q_DECL_OVERRIDE { return true; }
virtual bool isQmlSignal() const Q_DECL_OVERRIDE {
return (type() == Node::QmlSignal) && (genus() == Node::QML);
@@ -903,17 +905,20 @@ public:
virtual bool isJsMethod() const Q_DECL_OVERRIDE {
return (type() == Node::QmlMethod) && (genus() == Node::JS);
}
- int overloadNumber() const;
- const QList<Parameter>& parameters() const { return params; }
- void clearParams() { params.clear(); }
+ const QList<Parameter>& parameters() const { return parameters_; }
+ void clearParams() { parameters_.clear(); }
QStringList parameterNames() const;
QString rawParameters(bool names = false, bool values = false) const;
- const FunctionNode* reimplementedFrom() const { return rf; }
- const QList<FunctionNode*> &reimplementedBy() const { return rb; }
- const PropertyNode* associatedProperty() const { return ap; }
- const QStringList& parentPath() const { return pp; }
-
- QStringList reconstructParams(bool values = false) const;
+ const FunctionNode* reimplementedFrom() const { return reimplementedFrom_; }
+ const QList<FunctionNode*> &reimplementedBy() const { return reimplementedBy_; }
+ const PropNodeList& associatedProperties() const { return associatedProperties_; }
+ const QStringList& parentPath() const { return parentPath_; }
+ bool hasAssociatedProperties() const { return !associatedProperties_.isEmpty(); }
+ bool hasOneAssociatedProperty() const { return (associatedProperties_.size() == 1); }
+ PropertyNode* firstAssociatedProperty() const { return associatedProperties_[0]; }
+ bool hasActiveAssociatedProperty() const;
+
+ QStringList reconstructParameters(bool values = false) const;
QString signature(bool values = false) const;
virtual QString element() const Q_DECL_OVERRIDE { return parent()->name(); }
virtual bool isAttached() const Q_DECL_OVERRIDE { return attached_; }
@@ -934,25 +939,26 @@ public:
void debug() const;
private:
- void setAssociatedProperty(PropertyNode* property);
+ void addAssociatedProperty(PropertyNode* property);
- friend class InnerNode;
+ friend class Aggregate;
friend class PropertyNode;
- QString rt;
- QStringList pp;
- Metaness met;
- Virtualness vir;
- bool con : 1;
- bool sta : 1;
- bool ove : 1;
- bool reimp: 1;
+ QString returnType_;
+ QStringList parentPath_;
+ Metaness metaness_;
+ Virtualness virtualness_;
+ bool const_ : 1;
+ bool static_ : 1;
+ bool reimplemented_: 1;
bool attached_: 1;
bool privateSignal_: 1;
- QList<Parameter> params;
- const FunctionNode* rf;
- const PropertyNode* ap;
- QList<FunctionNode*> rb;
+ bool overload_ : 1;
+ unsigned char overloadNumber_;
+ QList<Parameter> parameters_;
+ const FunctionNode* reimplementedFrom_;
+ PropNodeList associatedProperties_;
+ QList<FunctionNode*> reimplementedBy_;
};
class PropertyNode : public LeafNode
@@ -961,7 +967,7 @@ public:
enum FunctionRole { Getter, Setter, Resetter, Notifier };
enum { NumFunctionRoles = Notifier + 1 };
- PropertyNode(InnerNode* parent, const QString& name);
+ PropertyNode(Aggregate* parent, const QString& name);
virtual ~PropertyNode() { }
virtual void setDataType(const QString& dataType) Q_DECL_OVERRIDE { type_ = dataType; }
@@ -974,30 +980,31 @@ public:
void setWritable(bool writable) { writable_ = toFlagValue(writable); }
void setUser(bool user) { user_ = toFlagValue(user); }
void setOverriddenFrom(const PropertyNode* baseProperty);
- void setRuntimeDesFunc(const QString& rdf) { runtimeDesFunc = rdf; }
- void setRuntimeScrFunc(const QString& scrf) { runtimeScrFunc = scrf; }
- void setConstant() { cst = true; }
- void setFinal() { fnl = true; }
- void setRevision(int revision) { rev = revision; }
+ void setRuntimeDesFunc(const QString& rdf) { runtimeDesFunc_ = rdf; }
+ void setRuntimeScrFunc(const QString& scrf) { runtimeScrFunc_ = scrf; }
+ void setConstant() { const_ = true; }
+ void setFinal() { final_ = true; }
+ void setRevision(int revision) { revision_ = revision; }
const QString &dataType() const { return type_; }
QString qualifiedDataType() const;
NodeList functions() const;
- NodeList functions(FunctionRole role) const { return funcs[(int)role]; }
+ NodeList functions(FunctionRole role) const { return functions_[(int)role]; }
NodeList getters() const { return functions(Getter); }
NodeList setters() const { return functions(Setter); }
NodeList resetters() const { return functions(Resetter); }
NodeList notifiers() const { return functions(Notifier); }
+ FunctionRole role(const FunctionNode* fn) const;
bool isStored() const { return fromFlagValue(stored_, storedDefault()); }
bool isDesignable() const { return fromFlagValue(designable_, designableDefault()); }
bool isScriptable() const { return fromFlagValue(scriptable_, scriptableDefault()); }
- const QString& runtimeDesignabilityFunction() const { return runtimeDesFunc; }
- const QString& runtimeScriptabilityFunction() const { return runtimeScrFunc; }
+ const QString& runtimeDesignabilityFunction() const { return runtimeDesFunc_; }
+ const QString& runtimeScriptabilityFunction() const { return runtimeScrFunc_; }
bool isWritable() const { return fromFlagValue(writable_, writableDefault()); }
bool isUser() const { return fromFlagValue(user_, userDefault()); }
- bool isConstant() const { return cst; }
- bool isFinal() const { return fnl; }
- const PropertyNode* overriddenFrom() const { return overrides; }
+ bool isConstant() const { return const_; }
+ bool isFinal() const { return final_; }
+ const PropertyNode* overriddenFrom() const { return overrides_; }
bool storedDefault() const { return true; }
bool userDefault() const { return false; }
@@ -1007,68 +1014,68 @@ public:
private:
QString type_;
- QString runtimeDesFunc;
- QString runtimeScrFunc;
- NodeList funcs[NumFunctionRoles];
+ QString runtimeDesFunc_;
+ QString runtimeScrFunc_;
+ NodeList functions_[NumFunctionRoles];
FlagValue stored_;
FlagValue designable_;
FlagValue scriptable_;
FlagValue writable_;
FlagValue user_;
- bool cst;
- bool fnl;
- int rev;
- const PropertyNode* overrides;
+ bool const_;
+ bool final_;
+ int revision_;
+ const PropertyNode* overrides_;
};
-inline void FunctionNode::setParameters(const QList<Parameter> &parameters)
+inline void FunctionNode::setParameters(const QList<Parameter> &p)
{
- params = parameters;
+ parameters_ = p;
}
inline void PropertyNode::addFunction(FunctionNode* function, FunctionRole role)
{
- funcs[(int)role].append(function);
- function->setAssociatedProperty(this);
+ functions_[(int)role].append(function);
+ function->addAssociatedProperty(this);
}
inline void PropertyNode::addSignal(FunctionNode* function, FunctionRole role)
{
- funcs[(int)role].append(function);
- function->setAssociatedProperty(this);
+ functions_[(int)role].append(function);
+ function->addAssociatedProperty(this);
}
inline NodeList PropertyNode::functions() const
{
NodeList list;
for (int i = 0; i < NumFunctionRoles; ++i)
- list += funcs[i];
+ list += functions_[i];
return list;
}
class VariableNode : public LeafNode
{
public:
- VariableNode(InnerNode* parent, const QString &name);
+ VariableNode(Aggregate* parent, const QString &name);
virtual ~VariableNode() { }
- void setLeftType(const QString &leftType) { lt = leftType; }
- void setRightType(const QString &rightType) { rt = rightType; }
- void setStatic(bool statique) { sta = statique; }
+ void setLeftType(const QString &leftType) { lrftType_ = leftType; }
+ void setRightType(const QString &rightType) { rightType_ = rightType; }
+ void setStatic(bool b) { static_ = b; }
- const QString &leftType() const { return lt; }
- const QString &rightType() const { return rt; }
- QString dataType() const { return lt + rt; }
- bool isStatic() const { return sta; }
+ const QString &leftType() const { return lrftType_; }
+ const QString &rightType() const { return rightType_; }
+ QString dataType() const { return lrftType_ + rightType_; }
+ bool isStatic() const { return static_; }
private:
- QString lt;
- QString rt;
- bool sta;
+ QString lrftType_;
+ QString rightType_;
+ bool static_;
};
-inline VariableNode::VariableNode(InnerNode* parent, const QString &name)
- : LeafNode(Variable, parent, name), sta(false)
+inline VariableNode::VariableNode(Aggregate* parent, const QString &name)
+ : LeafNode(Variable, parent, name), static_(false)
{
setGenus(Node::CPP);
}
@@ -1076,20 +1083,20 @@ inline VariableNode::VariableNode(InnerNode* parent, const QString &name)
class DitaMapNode : public DocumentNode
{
public:
- DitaMapNode(InnerNode* parent, const QString& name)
+ DitaMapNode(Aggregate* parent, const QString& name)
: DocumentNode(parent, name, Node::Page, Node::DitaMapPage) { }
virtual ~DitaMapNode() { }
const DitaRefList& map() const { return doc().ditamap(); }
};
-class CollectionNode : public InnerNode
+class CollectionNode : public Aggregate
{
public:
- CollectionNode(Type type,
- InnerNode* parent,
+ CollectionNode(NodeType type,
+ Aggregate* parent,
const QString& name,
- Genus genus) : InnerNode(type, parent, name), seen_(false)
+ Genus genus) : Aggregate(type, parent, name), seen_(false)
{
setPageType(Node::OverviewPage);
setGenus(genus);
diff --git a/src/tools/qdoc/plaincodemarker.cpp b/src/tools/qdoc/plaincodemarker.cpp
index 94561c3f48..bf2a55b2d5 100644
--- a/src/tools/qdoc/plaincodemarker.cpp
+++ b/src/tools/qdoc/plaincodemarker.cpp
@@ -58,7 +58,7 @@ bool PlainCodeMarker::recognizeLanguage( const QString& /* lang */ )
return false;
}
-Atom::Type PlainCodeMarker::atomType() const
+Atom::AtomType PlainCodeMarker::atomType() const
{
return Atom::Code;
}
@@ -109,7 +109,7 @@ QString PlainCodeMarker::functionEndRegExp( const QString& /* funcName */ )
return QString();
}
-QList<Section> PlainCodeMarker::sections(const InnerNode * /* innerNode */,
+QList<Section> PlainCodeMarker::sections(const Aggregate * /* innerNode */,
SynopsisStyle /* style */,
Status /* status */)
{
diff --git a/src/tools/qdoc/plaincodemarker.h b/src/tools/qdoc/plaincodemarker.h
index 6d41b3dd81..b83a3e4697 100644
--- a/src/tools/qdoc/plaincodemarker.h
+++ b/src/tools/qdoc/plaincodemarker.h
@@ -51,7 +51,7 @@ public:
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;
+ Atom::AtomType 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 ) Q_DECL_OVERRIDE;
@@ -61,7 +61,7 @@ public:
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;
+ QList<Section> sections(const Aggregate *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 e47460efb2..bfd3925353 100644
--- a/src/tools/qdoc/puredocparser.cpp
+++ b/src/tools/qdoc/puredocparser.cpp
@@ -207,14 +207,14 @@ bool PureDocParser::processQdocComments()
processOtherMetaCommands(*d, *n);
(*n)->setDoc(*d);
checkModuleInclusion(*n);
- if ((*n)->isInnerNode() && ((InnerNode *)*n)->includes().isEmpty()) {
- InnerNode *m = static_cast<InnerNode *>(*n);
+ if ((*n)->isAggregate() && ((Aggregate *)*n)->includes().isEmpty()) {
+ Aggregate *m = static_cast<Aggregate *>(*n);
while (m->parent() && m->parent() != treeRoot)
m = m->parent();
if (m == *n)
- ((InnerNode *)*n)->addInclude((*n)->name());
+ ((Aggregate *)*n)->addInclude((*n)->name());
else
- ((InnerNode *)*n)->setIncludes(m->includes());
+ ((Aggregate *)*n)->setIncludes(m->includes());
}
++d;
++n;
diff --git a/src/tools/qdoc/qdocdatabase.cpp b/src/tools/qdoc/qdocdatabase.cpp
index bf84fa8335..5d815d344f 100644
--- a/src/tools/qdoc/qdocdatabase.cpp
+++ b/src/tools/qdoc/qdocdatabase.cpp
@@ -815,7 +815,7 @@ void QDocDatabase::processForest()
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*))
+void QDocDatabase::processForest(void (QDocDatabase::*func) (Aggregate*))
{
Tree* t = forest_.firstTree();
while (t) {
@@ -930,7 +930,7 @@ NodeMultiMap& QDocDatabase::getCppClasses()
Finds all the C++ class nodes and QML type nodes and
sorts them into maps.
*/
-void QDocDatabase::findAllClasses(InnerNode* node)
+void QDocDatabase::findAllClasses(Aggregate* node)
{
NodeList::const_iterator c = node->childNodes().constBegin();
while (c != node->childNodes().constEnd()) {
@@ -957,8 +957,8 @@ void QDocDatabase::findAllClasses(InnerNode* node)
if ((*c)->isQmlBasicType() || (*c)->isJsType())
qmlBasicTypes_.insert(qmlTypeName,*c);
}
- else if ((*c)->isInnerNode()) {
- findAllClasses(static_cast<InnerNode*>(*c));
+ else if ((*c)->isAggregate()) {
+ findAllClasses(static_cast<Aggregate*>(*c));
}
}
++c;
@@ -978,13 +978,13 @@ NodeMapMap& QDocDatabase::getFunctionIndex()
/*!
Finds all the function nodes
*/
-void QDocDatabase::findAllFunctions(InnerNode* node)
+void QDocDatabase::findAllFunctions(Aggregate* node)
{
NodeList::ConstIterator c = node->childNodes().constBegin();
while (c != node->childNodes().constEnd()) {
if ((*c)->access() != Node::Private) {
- if ((*c)->isInnerNode()) {
- findAllFunctions(static_cast<InnerNode*>(*c));
+ if ((*c)->isAggregate()) {
+ findAllFunctions(static_cast<Aggregate*>(*c));
}
else if ((*c)->type() == Node::Function) {
const FunctionNode* func = static_cast<const FunctionNode*>(*c);
@@ -1004,15 +1004,15 @@ void QDocDatabase::findAllFunctions(InnerNode* node)
Finds all the nodes containing legalese text and puts them
in a map.
*/
-void QDocDatabase::findAllLegaleseTexts(InnerNode* node)
+void QDocDatabase::findAllLegaleseTexts(Aggregate* node)
{
NodeList::ConstIterator c = node->childNodes().constBegin();
while (c != node->childNodes().constEnd()) {
if ((*c)->access() != Node::Private) {
if (!(*c)->doc().legaleseText().isEmpty())
legaleseTexts_.insertMulti((*c)->doc().legaleseText(), *c);
- if ((*c)->isInnerNode())
- findAllLegaleseTexts(static_cast<InnerNode *>(*c));
+ if ((*c)->isAggregate())
+ findAllLegaleseTexts(static_cast<Aggregate *>(*c));
}
++c;
}
@@ -1021,13 +1021,13 @@ void QDocDatabase::findAllLegaleseTexts(InnerNode* node)
/*!
Finds all the namespace nodes and puts them in an index.
*/
-void QDocDatabase::findAllNamespaces(InnerNode* node)
+void QDocDatabase::findAllNamespaces(Aggregate* node)
{
NodeList::ConstIterator c = node->childNodes().constBegin();
while (c != node->childNodes().constEnd()) {
if ((*c)->access() != Node::Private || (*c)->isNamespace()) {
- if ((*c)->isInnerNode()) {
- findAllNamespaces(static_cast<InnerNode *>(*c));
+ if ((*c)->isAggregate()) {
+ findAllNamespaces(static_cast<Aggregate *>(*c));
if ((*c)->isNamespace()) {
// Ensure that the namespace's name is not empty (the root
// namespace has no name).
@@ -1046,7 +1046,7 @@ void QDocDatabase::findAllNamespaces(InnerNode* node)
maps. They can be C++ classes, QML types, or they can be
functions, enum types, typedefs, methods, etc.
*/
-void QDocDatabase::findAllObsoleteThings(InnerNode* node)
+void QDocDatabase::findAllObsoleteThings(Aggregate* node)
{
NodeList::const_iterator c = node->childNodes().constBegin();
while (c != node->childNodes().constEnd()) {
@@ -1067,7 +1067,7 @@ void QDocDatabase::findAllObsoleteThings(InnerNode* node)
}
}
else if ((*c)->type() == Node::Class) {
- InnerNode* n = static_cast<InnerNode*>(*c);
+ Aggregate* n = static_cast<Aggregate*>(*c);
bool inserted = false;
NodeList::const_iterator p = n->childNodes().constBegin();
while (p != n->childNodes().constEnd()) {
@@ -1096,7 +1096,7 @@ void QDocDatabase::findAllObsoleteThings(InnerNode* node)
}
}
else if ((*c)->isQmlType() || (*c)->isJsType()) {
- InnerNode* n = static_cast<InnerNode*>(*c);
+ Aggregate* n = static_cast<Aggregate*>(*c);
bool inserted = false;
NodeList::const_iterator p = n->childNodes().constBegin();
while (p != n->childNodes().constEnd()) {
@@ -1127,8 +1127,8 @@ void QDocDatabase::findAllObsoleteThings(InnerNode* node)
++p;
}
}
- else if ((*c)->isInnerNode()) {
- findAllObsoleteThings(static_cast<InnerNode*>(*c));
+ else if ((*c)->isAggregate()) {
+ findAllObsoleteThings(static_cast<Aggregate*>(*c));
}
}
++c;
@@ -1143,7 +1143,7 @@ void QDocDatabase::findAllObsoleteThings(InnerNode* node)
This function is used for generating the "New Classes... in x.y"
section on the \e{What's New in Qt x.y} page.
*/
-void QDocDatabase::findAllSince(InnerNode* node)
+void QDocDatabase::findAllSince(Aggregate* node)
{
NodeList::const_iterator child = node->childNodes().constBegin();
while (child != node->childNodes().constEnd()) {
@@ -1206,8 +1206,8 @@ void QDocDatabase::findAllSince(InnerNode* node)
}
}
// Recursively find child nodes with since commands.
- if ((*child)->isInnerNode())
- findAllSince(static_cast<InnerNode *>(*child));
+ if ((*child)->isAggregate())
+ findAllSince(static_cast<Aggregate *>(*child));
++child;
}
@@ -1264,6 +1264,10 @@ const NodeMap& QDocDatabase::getSinceMap(const QString& key)
to generating documentation.
*/
void QDocDatabase::resolveIssues() {
+ primaryTreeRoot()->normalizeOverloads();
+ fixInheritance();
+ resolveProperties();
+ primaryTreeRoot()->makeUndocumentedChildrenInternal();
resolveQmlInheritance(primaryTreeRoot());
primaryTree()->resolveTargets(primaryTreeRoot());
primaryTree()->resolveCppToQmlLinks();
@@ -1277,6 +1281,7 @@ void QDocDatabase::resolveStuff()
primaryTree()->resolveCppToQmlLinks();
primaryTree()->resolveUsingClauses();
resolveNamespaces();
+ primaryTreeRoot()->normalizeOverloads();
}
/*!
@@ -1394,7 +1399,7 @@ const Node* QDocDatabase::findNodeForTarget(const QString& target, const Node* r
base type node. If the node is found in the tree, set the
node's QML base type node pointer.
*/
-void QDocDatabase::resolveQmlInheritance(InnerNode* root)
+void QDocDatabase::resolveQmlInheritance(Aggregate* root)
{
NodeMap previousSearches;
// Do we need recursion?
@@ -1515,7 +1520,7 @@ FunctionNode* QDocDatabase::findNodeInOpenNamespace(const QStringList& parentPat
This function only searches in the current primary tree.
*/
-Node* QDocDatabase::findNodeInOpenNamespace(QStringList& path, Node::Type type)
+Node* QDocDatabase::findNodeInOpenNamespace(QStringList& path, Node::NodeType type)
{
if (path.isEmpty())
return 0;
@@ -1626,7 +1631,7 @@ const Node* QDocDatabase::findNodeForAtom(const Atom* a, const Node* relative, Q
Tree* domain = 0;
Node::Genus genus = Node::DontCare;
// Reserved for future use
- //Node::Type goal = Node::NoType;
+ //Node::NodeType goal = Node::NoType;
if (atom->isLinkAtom()) {
domain = atom->domain();
diff --git a/src/tools/qdoc/qdocdatabase.h b/src/tools/qdoc/qdocdatabase.h
index b8ca8bc32d..6154ec762b 100644
--- a/src/tools/qdoc/qdocdatabase.h
+++ b/src/tools/qdoc/qdocdatabase.h
@@ -103,7 +103,7 @@ class QDocForest
return 0;
}
- Node* findNodeByNameAndType(const QStringList& path, Node::Type type) {
+ Node* findNodeByNameAndType(const QStringList& path, Node::NodeType type) {
foreach (Tree* t, searchOrder()) {
Node* n = t->findNodeByNameAndType(path, type);
if (n)
@@ -130,9 +130,9 @@ class QDocForest
return 0;
}
- InnerNode* findRelatesNode(const QStringList& path) {
+ Aggregate* findRelatesNode(const QStringList& path) {
foreach (Tree* t, searchOrder()) {
- InnerNode* n = t->findRelatesNode(path);
+ Aggregate* n = t->findRelatesNode(path);
if (n)
return n;
}
@@ -260,12 +260,12 @@ class QDocDatabase
QmlTypeNode* findQmlType(const ImportRec& import, const QString& name);
private:
- void findAllClasses(InnerNode *node);
- void findAllFunctions(InnerNode *node);
- void findAllLegaleseTexts(InnerNode *node);
- void findAllNamespaces(InnerNode *node);
- void findAllObsoleteThings(InnerNode* node);
- void findAllSince(InnerNode *node);
+ void findAllClasses(Aggregate *node);
+ void findAllFunctions(Aggregate *node);
+ void findAllLegaleseTexts(Aggregate *node);
+ void findAllNamespaces(Aggregate *node);
+ void findAllObsoleteThings(Aggregate* node);
+ void findAllSince(Aggregate *node);
public:
/*******************************************************************
@@ -289,7 +289,7 @@ class QDocDatabase
Many of these will be either eliminated or replaced.
********************************************************************/
void resolveInheritance() { primaryTree()->resolveInheritance(); }
- void resolveQmlInheritance(InnerNode* root);
+ void resolveQmlInheritance(Aggregate* root);
void resolveIssues();
void resolveStuff();
void fixInheritance() { primaryTree()->fixInheritance(); }
@@ -297,7 +297,7 @@ class QDocDatabase
void insertTarget(const QString& name,
const QString& title,
- TargetRec::Type type,
+ TargetRec::TargetType type,
Node* node,
int priority) {
primaryTree()->insertTarget(name, title, type, node, priority);
@@ -310,7 +310,7 @@ class QDocDatabase
return primaryTree()->findFunctionNode(parentPath, clone);
}
FunctionNode* findNodeInOpenNamespace(const QStringList& parentPath, const FunctionNode* clone);
- Node* findNodeInOpenNamespace(QStringList& path, Node::Type type);
+ Node* findNodeInOpenNamespace(QStringList& path, Node::NodeType type);
const Node* checkForCollision(const QString& name) {
return primaryTree()->checkForCollision(name);
}
@@ -327,7 +327,7 @@ class QDocDatabase
********************************************************************/
ClassNode* findClassNode(const QStringList& path) { return forest_.findClassNode(path); }
Node* findNodeForInclude(const QStringList& path) { return forest_.findNodeForInclude(path); }
- InnerNode* findRelatesNode(const QStringList& path) { return forest_.findRelatesNode(path); }
+ Aggregate* findRelatesNode(const QStringList& path) { return forest_.findRelatesNode(path); }
const Node* findFunctionNode(const QString& target, const Node* relative, Node::Genus genus) {
return forest_.findFunctionNode(target, relative, genus);
}
@@ -336,7 +336,7 @@ class QDocDatabase
const DocumentNode* findDocumentNodeByTitle(const QString& title) {
return forest_.findDocumentNodeByTitle(title);
}
- Node* findNodeByNameAndType(const QStringList& path, Node::Type type) {
+ Node* findNodeByNameAndType(const QStringList& path, Node::NodeType type) {
return forest_.findNodeByNameAndType(path, type);
}
@@ -414,7 +414,7 @@ class QDocDatabase
Node::Genus genus) {
return forest_.findNode(path, relative, findFlags, genus);
}
- void processForest(void (QDocDatabase::*) (InnerNode*));
+ void processForest(void (QDocDatabase::*) (Aggregate*));
bool isLoaded(const QString& t) { return forest_.isLoaded(t); }
static void initializeDB();
diff --git a/src/tools/qdoc/qdocindexfiles.cpp b/src/tools/qdoc/qdocindexfiles.cpp
index 8961ff71ad..74b0b14347 100644
--- a/src/tools/qdoc/qdocindexfiles.cpp
+++ b/src/tools/qdoc/qdocindexfiles.cpp
@@ -172,9 +172,9 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element,
QString href = element.attribute("href");
Node* node;
Location location;
- InnerNode* parent = 0;
- if (current->isInnerNode())
- parent = static_cast<InnerNode*>(current);
+ Aggregate* parent = 0;
+ if (current->isAggregate())
+ parent = static_cast<Aggregate*>(current);
QString filePath;
int lineNo = 0;
@@ -342,7 +342,7 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element,
else if ((element.nodeName() == "qmlmethod") ||
(element.nodeName() == "qmlsignal") ||
(element.nodeName() == "qmlsignalhandler")) {
- Node::Type t = Node::QmlMethod;
+ Node::NodeType t = Node::QmlMethod;
if (element.nodeName() == "qmlsignal")
t = Node::QmlSignal;
else if (element.nodeName() == "qmlsignalhandler")
@@ -354,7 +354,7 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element,
else if ((element.nodeName() == "jsmethod") ||
(element.nodeName() == "jssignal") ||
(element.nodeName() == "jssignalhandler")) {
- Node::Type t = Node::QmlMethod;
+ Node::NodeType t = Node::QmlMethod;
if (element.nodeName() == "jssignal")
t = Node::QmlSignal;
else if (element.nodeName() == "jssignalhandler")
@@ -405,7 +405,7 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element,
node = cn;
}
else if (element.nodeName() == "page") {
- Node::SubType subtype;
+ Node::DocSubtype subtype;
Node::PageType ptype = Node::NoPageType;
QString attr = element.attribute("subtype");
if (attr == "example") {
@@ -486,8 +486,8 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element,
QString t = element.attribute("virtual");
if (t == "non")
virt = FunctionNode::NonVirtual;
- else if (t == "impure")
- virt = FunctionNode::ImpureVirtual;
+ else if (t == "virtual")
+ virt = FunctionNode::NormalVirtual;
else if (t == "pure")
virt = FunctionNode::PureVirtual;
else
@@ -520,8 +520,14 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element,
functionNode->setMetaness(meta);
functionNode->setConst(element.attribute("const") == "true");
functionNode->setStatic(element.attribute("static") == "true");
- functionNode->setOverload(element.attribute("overload") == "true");
-
+ if (element.attribute("overload") == "true") {
+ functionNode->setOverloadFlag(true);
+ functionNode->setOverloadNumber(element.attribute("overload-number").toUInt());
+ }
+ else {
+ functionNode->setOverloadFlag(false);
+ functionNode->setOverloadNumber(0);
+ }
if (element.hasAttribute("relates")
&& element.attribute("relates") != parent->name()) {
relatedList_.append(
@@ -613,12 +619,12 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element,
node->setStatus(Node::Obsolete);
else if (status == "preliminary")
node->setStatus(Node::Preliminary);
- else if (status == "commendable")
- node->setStatus(Node::Commendable);
+ else if (status == "active")
+ node->setStatus(Node::Active);
else if (status == "internal")
node->setStatus(Node::Internal);
else
- node->setStatus(Node::Commendable);
+ node->setStatus(Node::Active);
QString physicalModuleName = element.attribute("module");
if (!physicalModuleName.isEmpty())
@@ -726,7 +732,7 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer,
/*
Don't include index nodes in a new index file. Or DITA map nodes.
*/
- if (node->isIndexNode() || node->subType() == Node::DitaMap)
+ if (node->isIndexNode() || node->docSubtype() == Node::DitaMap)
return false;
QString nodeName;
@@ -885,8 +891,8 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer,
case Node::Preliminary:
status = "preliminary";
break;
- case Node::Commendable:
- status = "commendable";
+ case Node::Active:
+ status = "active";
break;
case Node::Internal:
status = "internal";
@@ -937,7 +943,7 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer,
else
href = node->name();
if (node->isQmlNode() || node->isJsNode()) {
- InnerNode* p = node->parent();
+ Aggregate* p = node->parent();
if (p) {
if (p->isQmlPropertyGroup() || p->isJsPropertyGroup())
p = p->parent();
@@ -954,11 +960,12 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer,
if (node->isAbstract())
writer.writeAttribute("abstract", "true");
}
- if (!node->location().fileName().isEmpty())
- writer.writeAttribute("location", node->location().fileName());
- if (!node->location().filePath().isEmpty()) {
- writer.writeAttribute("filepath", node->location().filePath());
- writer.writeAttribute("lineno", QString("%1").arg(node->location().lineNo()));
+ const Location& declLocation = node->declLocation();
+ if (!declLocation.fileName().isEmpty())
+ writer.writeAttribute("location", declLocation.fileName());
+ if (!declLocation.filePath().isEmpty()) {
+ writer.writeAttribute("filepath", declLocation.filePath());
+ writer.writeAttribute("lineno", QString("%1").arg(declLocation.lineNo()));
}
if (!node->since().isEmpty()) {
@@ -1019,7 +1026,7 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer,
*/
bool writeModuleName = false;
const DocumentNode* docNode = static_cast<const DocumentNode*>(node);
- switch (docNode->subType()) {
+ switch (docNode->docSubtype()) {
case Node::Example:
writer.writeAttribute("subtype", "example");
writeModuleName = true;
@@ -1139,8 +1146,8 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer,
case FunctionNode::NonVirtual:
writer.writeAttribute("virtual", "non");
break;
- case FunctionNode::ImpureVirtual:
- writer.writeAttribute("virtual", "impure");
+ case FunctionNode::NormalVirtual:
+ writer.writeAttribute("virtual", "virtual");
break;
case FunctionNode::PureVirtual:
writer.writeAttribute("virtual", "pure");
@@ -1182,9 +1189,11 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer,
if (functionNode->relates()) {
writer.writeAttribute("relates", functionNode->relates()->name());
}
- const PropertyNode* propertyNode = functionNode->associatedProperty();
- if (propertyNode)
- writer.writeAttribute("associated-property", propertyNode->name());
+ if (functionNode->hasAssociatedProperties()) {
+ foreach (PropertyNode* pn, functionNode->associatedProperties()) {
+ writer.writeAttribute("associated-property", pn->name());
+ }
+ }
writer.writeAttribute("type", functionNode->returnType());
if (!brief.isEmpty())
writer.writeAttribute("brief", brief);
@@ -1316,7 +1325,7 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer,
bool external = false;
if (node->type() == Node::Document) {
const DocumentNode* docNode = static_cast<const DocumentNode*>(node);
- if (docNode->subType() == Node::ExternalPage)
+ if (docNode->docSubtype() == Node::ExternalPage)
external = true;
}
foreach (const Atom* target, node->doc().targets()) {
@@ -1349,8 +1358,8 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer,
// opening tag, create child elements, then add a closing tag for the
// element. Elements for all other nodes are closed in the opening tag.
- if (node->isInnerNode()) {
- const InnerNode* inner = static_cast<const InnerNode*>(node);
+ if (node->isAggregate()) {
+ const Aggregate* inner = static_cast<const Aggregate*>(node);
if (inner->doc().hasTableOfContents()) {
for (int i = 0; i < inner->doc().tableOfContents().size(); ++i) {
@@ -1453,8 +1462,8 @@ void QDocIndexFiles::generateIndexSections(QXmlStreamWriter& writer,
return;
if (generateIndexSection(writer, node, generateInternalNodes)) {
- if (node->isInnerNode()) {
- const InnerNode* inner = static_cast<const InnerNode*>(node);
+ if (node->isAggregate()) {
+ const Aggregate* inner = static_cast<const Aggregate*>(node);
NodeList cnodes = inner->childNodes();
std::sort(cnodes.begin(), cnodes.end(), compareNodes);
diff --git a/src/tools/qdoc/qdoctagfiles.cpp b/src/tools/qdoc/qdoctagfiles.cpp
index 778df33048..7a1902bbca 100644
--- a/src/tools/qdoc/qdoctagfiles.cpp
+++ b/src/tools/qdoc/qdoctagfiles.cpp
@@ -100,7 +100,7 @@ void QDocTagFiles::destroyQDocTagFiles()
specified, returning true if an element was written; otherwise returns
false.
*/
-void QDocTagFiles::generateTagFileCompounds(QXmlStreamWriter& writer, const InnerNode* inner)
+void QDocTagFiles::generateTagFileCompounds(QXmlStreamWriter& writer, const Aggregate* inner)
{
foreach (const Node* node, inner->childNodes()) {
if (!node->url().isEmpty())
@@ -161,22 +161,22 @@ void QDocTagFiles::generateTagFileCompounds(QXmlStreamWriter& writer, const Inne
}
// Recurse to write all members.
- generateTagFileMembers(writer, static_cast<const InnerNode*>(node));
+ generateTagFileMembers(writer, static_cast<const Aggregate*>(node));
writer.writeEndElement();
// Recurse to write all compounds.
- generateTagFileCompounds(writer, static_cast<const InnerNode*>(node));
+ generateTagFileCompounds(writer, static_cast<const Aggregate*>(node));
}
else {
writer.writeTextElement("name", node->fullDocumentName());
writer.writeTextElement("filename", gen_->fullDocumentLocation(node, false));
// Recurse to write all members.
- generateTagFileMembers(writer, static_cast<const InnerNode*>(node));
+ generateTagFileMembers(writer, static_cast<const Aggregate*>(node));
writer.writeEndElement();
// Recurse to write all compounds.
- generateTagFileCompounds(writer, static_cast<const InnerNode*>(node));
+ generateTagFileCompounds(writer, static_cast<const Aggregate*>(node));
}
}
}
@@ -185,7 +185,7 @@ void QDocTagFiles::generateTagFileCompounds(QXmlStreamWriter& writer, const Inne
Writes all the members of the \a inner node with the \a writer.
The node represents a C++ class, namespace, etc.
*/
-void QDocTagFiles::generateTagFileMembers(QXmlStreamWriter& writer, const InnerNode* inner)
+void QDocTagFiles::generateTagFileMembers(QXmlStreamWriter& writer, const Aggregate* inner)
{
foreach (const Node* node, inner->childNodes()) {
if (!node->url().isEmpty())
@@ -268,7 +268,7 @@ void QDocTagFiles::generateTagFileMembers(QXmlStreamWriter& writer, const InnerN
case FunctionNode::NonVirtual:
writer.writeAttribute("virtualness", "non");
break;
- case FunctionNode::ImpureVirtual:
+ case FunctionNode::NormalVirtual:
writer.writeAttribute("virtualness", "virtual");
break;
case FunctionNode::PureVirtual:
diff --git a/src/tools/qdoc/qdoctagfiles.h b/src/tools/qdoc/qdoctagfiles.h
index 94d3450478..ad1d383bfd 100644
--- a/src/tools/qdoc/qdoctagfiles.h
+++ b/src/tools/qdoc/qdoctagfiles.h
@@ -38,7 +38,7 @@
QT_BEGIN_NAMESPACE
-class InnerNode;
+class Aggregate;
class QDocDatabase;
class Generator;
@@ -53,8 +53,8 @@ class QDocTagFiles
QDocTagFiles();
~QDocTagFiles();
- void generateTagFileCompounds(QXmlStreamWriter& writer, const InnerNode* inner);
- void generateTagFileMembers(QXmlStreamWriter& writer, const InnerNode* inner);
+ void generateTagFileCompounds(QXmlStreamWriter& writer, const Aggregate* inner);
+ void generateTagFileMembers(QXmlStreamWriter& writer, const Aggregate* inner);
void generateTagFile(const QString& fileName, Generator* g);
private:
diff --git a/src/tools/qdoc/qmlcodemarker.cpp b/src/tools/qdoc/qmlcodemarker.cpp
index 86fc79be66..cfb5e16b44 100644
--- a/src/tools/qdoc/qmlcodemarker.cpp
+++ b/src/tools/qdoc/qmlcodemarker.cpp
@@ -96,7 +96,7 @@ bool QmlCodeMarker::recognizeLanguage(const QString &language)
/*!
Returns the type of atom used to represent QML code in the documentation.
*/
-Atom::Type QmlCodeMarker::atomType() const
+Atom::AtomType QmlCodeMarker::atomType() const
{
return Atom::Qml;
}
@@ -166,7 +166,7 @@ QString QmlCodeMarker::addMarkUp(const QString &code,
QQmlJS::Lexer lexer(&engine);
QString newCode = code;
- QList<QQmlJS::AST::SourceLocation> pragmas = extractPragmas(newCode);
+ QVector<QQmlJS::AST::SourceLocation> pragmas = extractPragmas(newCode);
lexer.setCode(newCode, 1);
QQmlJS::Parser parser(&engine);
@@ -209,11 +209,11 @@ static void replaceWithSpace(QString &str, int idx, int n)
Searches for ".pragma <value>" or ".import <stuff>" declarations
in \a script. Currently supported pragmas are: library
*/
-QList<QQmlJS::AST::SourceLocation> QmlCodeMarker::extractPragmas(QString &script)
+QVector<QQmlJS::AST::SourceLocation> QmlCodeMarker::extractPragmas(QString &script)
{
const QString pragma(QLatin1String("pragma"));
const QString library(QLatin1String("library"));
- QList<QQmlJS::AST::SourceLocation> removed;
+ QVector<QQmlJS::AST::SourceLocation> removed;
QQmlJS::Lexer l(0);
l.setCode(script, 0);
diff --git a/src/tools/qdoc/qmlcodemarker.h b/src/tools/qdoc/qmlcodemarker.h
index 805229e366..b3ec03965f 100644
--- a/src/tools/qdoc/qmlcodemarker.h
+++ b/src/tools/qdoc/qmlcodemarker.h
@@ -54,7 +54,7 @@ public:
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 Atom::AtomType atomType() const Q_DECL_OVERRIDE;
virtual QString markedUpCode(const QString &code,
const Node *relative,
const Location &location) Q_DECL_OVERRIDE;
@@ -66,7 +66,7 @@ public:
virtual QString functionEndRegExp(const QString &funcName) Q_DECL_OVERRIDE;
/* Copied from src/declarative/qml/qdeclarativescriptparser.cpp */
- QList<QQmlJS::AST::SourceLocation> extractPragmas(QString &script);
+ QVector<QQmlJS::AST::SourceLocation> extractPragmas(QString &script);
private:
QString addMarkUp(const QString &code, const Node *relative,
diff --git a/src/tools/qdoc/qmlcodeparser.cpp b/src/tools/qdoc/qmlcodeparser.cpp
index 4f5720a94d..f485255b8e 100644
--- a/src/tools/qdoc/qmlcodeparser.cpp
+++ b/src/tools/qdoc/qmlcodeparser.cpp
@@ -57,6 +57,7 @@ QT_BEGIN_NAMESPACE
#define COMMAND_SINCE Doc::alias("since")
#define COMMAND_WRAPPER Doc::alias("wrapper")
+#define COMMAND_ABSTRACT Doc::alias("abstract")
#define COMMAND_QMLABSTRACT Doc::alias("qmlabstract")
#define COMMAND_QMLCLASS Doc::alias("qmlclass")
#define COMMAND_QMLTYPE Doc::alias("qmltype")
@@ -251,6 +252,7 @@ const QSet<QString>& QmlCodeParser::otherMetaCommands()
<< COMMAND_OBSOLETE
<< COMMAND_PRELIMINARY
<< COMMAND_SINCE
+ << COMMAND_ABSTRACT
<< COMMAND_QMLABSTRACT
<< COMMAND_INQMLMODULE
<< COMMAND_INJSMODULE
diff --git a/src/tools/qdoc/qmlmarkupvisitor.cpp b/src/tools/qdoc/qmlmarkupvisitor.cpp
index ee86b6de32..3a7635778e 100644
--- a/src/tools/qdoc/qmlmarkupvisitor.cpp
+++ b/src/tools/qdoc/qmlmarkupvisitor.cpp
@@ -42,7 +42,7 @@
QT_BEGIN_NAMESPACE
QmlMarkupVisitor::QmlMarkupVisitor(const QString &source,
- const QList<QQmlJS::AST::SourceLocation> &pragmas,
+ const QVector<QQmlJS::AST::SourceLocation> &pragmas,
QQmlJS::Engine *engine)
{
this->source = source;
@@ -54,21 +54,22 @@ QmlMarkupVisitor::QmlMarkupVisitor(const QString &source,
// Merge the lists of locations of pragmas and comments in the source code.
int i = 0;
int j = 0;
- while (i < engine->comments().length() && j < pragmas.length()) {
- if (engine->comments()[i].offset < pragmas[j].offset) {
+ const QVector<QQmlJS::AST::SourceLocation> comments = engine->comments();
+ while (i < comments.size() && j < pragmas.length()) {
+ if (comments[i].offset < pragmas[j].offset) {
extraTypes.append(Comment);
- extraLocations.append(engine->comments()[i]);
+ extraLocations.append(comments[i]);
++i;
} else {
extraTypes.append(Pragma);
- extraLocations.append(engine->comments()[j]);
+ extraLocations.append(comments[j]);
++j;
}
}
- while (i < engine->comments().length()) {
+ while (i < comments.size()) {
extraTypes.append(Comment);
- extraLocations.append(engine->comments()[i]);
+ extraLocations.append(comments[i]);
++i;
}
diff --git a/src/tools/qdoc/qmlmarkupvisitor.h b/src/tools/qdoc/qmlmarkupvisitor.h
index 04d6a57564..34d18d6868 100644
--- a/src/tools/qdoc/qmlmarkupvisitor.h
+++ b/src/tools/qdoc/qmlmarkupvisitor.h
@@ -50,7 +50,7 @@ public:
};
QmlMarkupVisitor(const QString &code,
- const QList<QQmlJS::AST::SourceLocation> &pragmas,
+ const QVector<QQmlJS::AST::SourceLocation> &pragmas,
QQmlJS::Engine *engine);
virtual ~QmlMarkupVisitor();
@@ -158,7 +158,7 @@ private:
QQmlJS::Engine *engine;
QList<ExtraType> extraTypes;
- QList<QQmlJS::AST::SourceLocation> extraLocations;
+ QVector<QQmlJS::AST::SourceLocation> extraLocations;
QString source;
QString output;
quint32 cursor;
diff --git a/src/tools/qdoc/qmlparser/qqmljsastfwd_p.h b/src/tools/qdoc/qmlparser/qqmljsastfwd_p.h
index eae4125ab2..bfaa4401d2 100644
--- a/src/tools/qdoc/qmlparser/qqmljsastfwd_p.h
+++ b/src/tools/qdoc/qmlparser/qqmljsastfwd_p.h
@@ -37,6 +37,7 @@
#include "qqmljsglobal_p.h"
#include <QtCore/qglobal.h>
+#include <QtCore/qtypeinfo.h>
//
// W A R N I N G
@@ -53,27 +54,6 @@ QT_QML_BEGIN_NAMESPACE
namespace QQmlJS { namespace AST {
-class SourceLocation
-{
-public:
- explicit SourceLocation(quint32 offset = 0, quint32 length = 0, quint32 line = 0, quint32 column = 0)
- : offset(offset), length(length),
- startLine(line), startColumn(column)
- { }
-
- bool isValid() const { return length != 0; }
-
- quint32 begin() const { return offset; }
- quint32 end() const { return offset + length; }
-
-// attributes
- // ### encode
- quint32 offset;
- quint32 length;
- quint32 startLine;
- quint32 startColumn;
-};
-
class Visitor;
class Node;
class ExpressionNode;
@@ -176,8 +156,31 @@ class UiQualifiedId;
class UiQualifiedPragmaId;
class UiHeaderItemList;
+class SourceLocation
+{
+public:
+ explicit SourceLocation(quint32 offset = 0, quint32 length = 0, quint32 line = 0, quint32 column = 0)
+ : offset(offset), length(length),
+ startLine(line), startColumn(column)
+ { }
+
+ bool isValid() const { return length != 0; }
+
+ quint32 begin() const { return offset; }
+ quint32 end() const { return offset + length; }
+
+// attributes
+ // ### encode
+ quint32 offset;
+ quint32 length;
+ quint32 startLine;
+ quint32 startColumn;
+};
+
} } // namespace AST
+Q_DECLARE_TYPEINFO(QQmlJS::AST::SourceLocation, Q_PRIMITIVE_TYPE);
+
QT_QML_END_NAMESPACE
#endif
diff --git a/src/tools/qdoc/qmlparser/qqmljsengine_p.cpp b/src/tools/qdoc/qmlparser/qqmljsengine_p.cpp
index 1c0a70a372..2a949b630c 100644
--- a/src/tools/qdoc/qmlparser/qqmljsengine_p.cpp
+++ b/src/tools/qdoc/qmlparser/qqmljsengine_p.cpp
@@ -35,7 +35,6 @@
#include "qqmljsglobal_p.h"
#include <QtCore/qnumeric.h>
-#include <QtCore/qhash.h>
#include <QtCore/qdebug.h>
QT_QML_BEGIN_NAMESPACE
@@ -126,7 +125,7 @@ void Engine::setCode(const QString &code)
void Engine::addComment(int pos, int len, int line, int col)
{ if (len > 0) _comments.append(QQmlJS::AST::SourceLocation(pos, len, line, col)); }
-QList<QQmlJS::AST::SourceLocation> Engine::comments() const
+QVector<QQmlJS::AST::SourceLocation> Engine::comments() const
{ return _comments; }
Lexer *Engine::lexer() const
diff --git a/src/tools/qdoc/qmlparser/qqmljsengine_p.h b/src/tools/qdoc/qmlparser/qqmljsengine_p.h
index fb65d7f028..9ab26f0d0f 100644
--- a/src/tools/qdoc/qmlparser/qqmljsengine_p.h
+++ b/src/tools/qdoc/qmlparser/qqmljsengine_p.h
@@ -50,7 +50,7 @@
#include "qqmljsmemorypool_p.h"
#include <QtCore/qstring.h>
-#include <QtCore/qset.h>
+#include <QtCore/qvector.h>
QT_QML_BEGIN_NAMESPACE
@@ -87,7 +87,7 @@ class QML_PARSER_EXPORT Engine
Lexer *_lexer;
Directives *_directives;
MemoryPool _pool;
- QList<AST::SourceLocation> _comments;
+ QVector<AST::SourceLocation> _comments;
QString _extraCode;
QString _code;
@@ -99,7 +99,7 @@ public:
const QString &code() const { return _code; }
void addComment(int pos, int len, int line, int col);
- QList<AST::SourceLocation> comments() const;
+ QVector<AST::SourceLocation> comments() const;
Lexer *lexer() const;
void setLexer(Lexer *lexer);
diff --git a/src/tools/qdoc/qmlvisitor.cpp b/src/tools/qdoc/qmlvisitor.cpp
index 190c9f0444..1468683052 100644
--- a/src/tools/qdoc/qmlvisitor.cpp
+++ b/src/tools/qdoc/qmlvisitor.cpp
@@ -55,6 +55,7 @@ QT_BEGIN_NAMESPACE
#define COMMAND_SINCE Doc::alias(QLatin1String("since"))
#define COMMAND_WRAPPER Doc::alias(QLatin1String("wrapper"))
+#define COMMAND_ABSTRACT Doc::alias(QLatin1String("abstract"))
#define COMMAND_QMLABSTRACT Doc::alias(QLatin1String("qmlabstract"))
#define COMMAND_QMLCLASS Doc::alias(QLatin1String("qmlclass"))
#define COMMAND_QMLTYPE Doc::alias(QLatin1String("qmltype"))
@@ -118,7 +119,7 @@ QmlDocVisitor::~QmlDocVisitor()
*/
QQmlJS::AST::SourceLocation QmlDocVisitor::precedingComment(quint32 offset) const
{
- QListIterator<QQmlJS::AST::SourceLocation> it(engine->comments());
+ QVectorIterator<QQmlJS::AST::SourceLocation> it(engine->comments());
it.toBack();
while (it.hasPrevious()) {
@@ -196,7 +197,7 @@ bool QmlDocVisitor::applyDocumentation(QQmlJS::AST::SourceLocation location, Nod
const TopicList& topicsUsed = doc.topicsUsed();
NodeList nodes;
Node* nodePassedIn = node;
- InnerNode* parent = nodePassedIn->parent();
+ Aggregate* parent = nodePassedIn->parent();
node->setDoc(doc);
nodes.append(node);
if (topicsUsed.size() > 0) {
@@ -497,7 +498,7 @@ void QmlDocVisitor::applyMetacommands(QQmlJS::AST::SourceLocation,
while (i != metacommands.end()) {
QString command = *i;
ArgList args = doc.metaCommandArgs(command);
- if (command == COMMAND_QMLABSTRACT) {
+ if ((command == COMMAND_QMLABSTRACT) || (command == COMMAND_ABSTRACT)) {
if (node->isQmlType() || node->isJsType()) {
node->setAbstract(true);
}
@@ -751,14 +752,14 @@ bool QmlDocVisitor::visit(QQmlJS::AST::FunctionDeclaration* fd)
if (current->isJsType())
qmlMethod->setGenus(Node::JS);
int overloads = 0;
- NodeList::ConstIterator overloadIterator = current->childNodes().constBegin();
- while (overloadIterator != current->childNodes().constEnd()) {
- if ((*overloadIterator)->name() == name)
+ NodeList::ConstIterator i = current->childNodes().constBegin();
+ while (i != current->childNodes().constEnd()) {
+ if ((*i)->name() == name)
overloads++;
- overloadIterator++;
+ i++;
}
if (overloads > 1)
- qmlMethod->setOverload(true);
+ qmlMethod->setOverloadFlag(true);
QList<Parameter> parameters;
QQmlJS::AST::FormalParameterList* formals = fd->formals;
if (formals) {
diff --git a/src/tools/qdoc/qmlvisitor.h b/src/tools/qdoc/qmlvisitor.h
index cfb167c985..8c5e8c5042 100644
--- a/src/tools/qdoc/qmlvisitor.h
+++ b/src/tools/qdoc/qmlvisitor.h
@@ -111,7 +111,7 @@ private:
QSet<QString> commands_;
QSet<QString> topics_;
QSet<quint32> usedComments;
- InnerNode *current;
+ Aggregate *current;
};
QT_END_NAMESPACE
diff --git a/src/tools/qdoc/text.cpp b/src/tools/qdoc/text.cpp
index b4eebe4c75..fa105a8344 100644
--- a/src/tools/qdoc/text.cpp
+++ b/src/tools/qdoc/text.cpp
@@ -72,7 +72,7 @@ Text& Text::operator=(const Text& text)
return *this;
}
-Text& Text::operator<<(Atom::Type atomType)
+Text& Text::operator<<(Atom::AtomType atomType)
{
return operator<<(Atom(atomType));
}
@@ -177,7 +177,7 @@ QString Text::toString() const
return str;
}
-Text Text::subText(Atom::Type left, Atom::Type right, const Atom* from, bool inclusive) const
+Text Text::subText(Atom::AtomType left, Atom::AtomType right, const Atom* from, bool inclusive) const
{
const Atom* begin = from ? from : firstAtom();
const Atom* end;
diff --git a/src/tools/qdoc/text.h b/src/tools/qdoc/text.h
index 7f4eeb3ec2..40ecf3eddc 100644
--- a/src/tools/qdoc/text.h
+++ b/src/tools/qdoc/text.h
@@ -54,7 +54,7 @@ public:
Atom *firstAtom() { return first; }
Atom *lastAtom() { return last; }
- Text& operator<<(Atom::Type atomType);
+ Text& operator<<(Atom::AtomType atomType);
Text& operator<<(const QString& string);
Text& operator<<(const Atom& atom);
Text& operator<<(const LinkAtom& atom);
@@ -66,7 +66,7 @@ public:
QString toString() const;
const Atom *firstAtom() const { return first; }
const Atom *lastAtom() const { return last; }
- Text subText(Atom::Type left, Atom::Type right, const Atom *from = 0, bool inclusive = false) const;
+ Text subText(Atom::AtomType left, Atom::AtomType right, const Atom *from = 0, bool inclusive = false) const;
void dump() const;
void clear();
diff --git a/src/tools/qdoc/tree.cpp b/src/tools/qdoc/tree.cpp
index 1b0aba1a0c..6c21d730c1 100644
--- a/src/tools/qdoc/tree.cpp
+++ b/src/tools/qdoc/tree.cpp
@@ -181,9 +181,9 @@ FunctionNode* Tree::findFunctionNode(const QStringList& parentPath, const Functi
parent = findClassNode(parentPath, 0);
if (parent == 0)
parent = findNode(parentPath, 0, 0, Node::DontCare);
- if (parent == 0 || !parent->isInnerNode())
+ if (parent == 0 || !parent->isAggregate())
return 0;
- return ((const InnerNode*)parent)->findFunctionNode(clone);
+ return ((const Aggregate*)parent)->findFunctionNode(clone);
}
@@ -249,22 +249,22 @@ const FunctionNode* Tree::findFunctionNode(const QStringList& path,
int i;
for (i = 0; i < path.size(); ++i) {
- if (node == 0 || !node->isInnerNode())
+ if (node == 0 || !node->isAggregate())
break;
const Node* next;
if (i == path.size() - 1)
- next = ((const InnerNode*) node)->findFunctionNode(path.at(i));
+ next = ((const Aggregate*) node)->findFunctionNode(path.at(i));
else
- next = ((const InnerNode*) node)->findChildNode(path.at(i), genus);
+ next = ((const Aggregate*) node)->findChildNode(path.at(i), genus);
if (!next && node->isClass() && (findFlags & SearchBaseClasses)) {
NodeList baseClasses = allBaseClasses(static_cast<const ClassNode*>(node));
foreach (const Node* baseClass, baseClasses) {
if (i == path.size() - 1)
- next = static_cast<const InnerNode*>(baseClass)->findFunctionNode(path.at(i));
+ next = static_cast<const Aggregate*>(baseClass)->findFunctionNode(path.at(i));
else
- next = static_cast<const InnerNode*>(baseClass)->findChildNode(path.at(i), genus);
+ next = static_cast<const Aggregate*>(baseClass)->findChildNode(path.at(i), genus);
if (next)
break;
@@ -301,8 +301,8 @@ static const NodeTypeList& relatesTypes()
{
if (t.isEmpty()) {
t.reserve(3);
- t.append(NodeTypePair(Node::Class, Node::NoSubType));
- t.append(NodeTypePair(Node::Namespace, Node::NoSubType));
+ t.append(NodeTypePair(Node::Class, Node::NoSubtype));
+ t.append(NodeTypePair(Node::Namespace, Node::NoSubtype));
t.append(NodeTypePair(Node::Document, Node::HeaderFile));
}
return t;
@@ -320,13 +320,15 @@ static const NodeTypeList& relatesTypes()
If a matching node is found, a pointer to it is returned.
Otherwise 0 is returned.
*/
-InnerNode* Tree::findRelatesNode(const QStringList& path)
+Aggregate* Tree::findRelatesNode(const QStringList& path)
{
Node* n = findNodeRecursive(path, 0, root(), relatesTypes());
- return ((n && n->isInnerNode()) ? static_cast<InnerNode*>(n) : 0);
+ return ((n && n->isAggregate()) ? static_cast<Aggregate*>(n) : 0);
}
/*!
+ Inserts function name \a funcName and function role \a funcRole into
+ the property function map for the specified \a property.
*/
void Tree::addPropertyFunction(PropertyNode* property,
const QString& funcName,
@@ -344,7 +346,7 @@ void Tree::addPropertyFunction(PropertyNode* property,
This function does not resolve QML inheritance.
*/
-void Tree::resolveInheritance(InnerNode* n)
+void Tree::resolveInheritance(Aggregate* n)
{
if (!n)
n = root();
@@ -399,7 +401,7 @@ void Tree::resolveInheritanceHelper(int pass, ClassNode* cn)
node) using the unqualified base class name.
*/
if (!n) {
- InnerNode* parent = cn->parent();
+ Aggregate* parent = cn->parent();
if (parent)
// Exclude the root namespace
if (parent->isNamespace() && !parent->name().isEmpty())
@@ -422,7 +424,7 @@ void Tree::resolveInheritanceHelper(int pass, ClassNode* cn)
FunctionNode* from = findVirtualFunctionInBaseClasses(cn, func);
if (from != 0) {
if (func->virtualness() == FunctionNode::NonVirtual)
- func->setVirtualness(FunctionNode::ImpureVirtual);
+ func->setVirtualness(FunctionNode::NormalVirtual);
func->setReimplementedFrom(from);
}
}
@@ -442,7 +444,7 @@ void Tree::resolveProperties()
propEntry = unresolvedPropertyMap.constBegin();
while (propEntry != unresolvedPropertyMap.constEnd()) {
PropertyNode* property = propEntry.key();
- InnerNode* parent = property->parent();
+ Aggregate* parent = property->parent();
QString getterName = (*propEntry)[PropertyNode::Getter];
QString setterName = (*propEntry)[PropertyNode::Setter];
QString resetterName = (*propEntry)[PropertyNode::Resetter];
@@ -587,7 +589,7 @@ NodeList Tree::allBaseClasses(const ClassNode* classNode) const
search at the tree root. \a subtype is not used unless
\a type is \c{Document}.
*/
-Node* Tree::findNodeByNameAndType(const QStringList& path, Node::Type type) const
+Node* Tree::findNodeByNameAndType(const QStringList& path, Node::NodeType type) const
{
return findNodeRecursive(path, 0, root(), type);
}
@@ -611,7 +613,7 @@ Node* Tree::findNodeByNameAndType(const QStringList& path, Node::Type type) cons
Node* Tree::findNodeRecursive(const QStringList& path,
int pathIndex,
const Node* start,
- Node::Type type) const
+ Node::NodeType type) const
{
if (!start || path.isEmpty())
return 0; // no place to start, or nothing to search for.
@@ -622,7 +624,7 @@ Node* Tree::findNodeRecursive(const QStringList& path,
return 0; // premature leaf
}
- InnerNode* current = static_cast<InnerNode*>(node);
+ Aggregate* current = static_cast<Aggregate*>(node);
const NodeList& children = current->childNodes();
const QString& name = path.at(pathIndex);
for (int i=0; i<children.size(); ++i) {
@@ -678,7 +680,7 @@ Node* Tree::findNodeRecursive(const QStringList& path,
if (pathIndex >= path.size())
return 0;
- InnerNode* current = static_cast<InnerNode*>(start);
+ Aggregate* current = static_cast<Aggregate*>(start);
const NodeList& children = current->childNodes();
for (int i=0; i<children.size(); ++i) {
Node* n = children.at(i);
@@ -778,7 +780,7 @@ const Node* Tree::findNodeForTarget(const QStringList& path,
}
while (current) {
- if (current->isInnerNode()) {
+ if (current->isAggregate()) {
const Node* node = matchPathAndTarget(path, path_idx, target, current, flags, genus, ref);
if (node)
return node;
@@ -848,8 +850,8 @@ const Node* Tree::matchPathAndTarget(const QStringList& path,
return t;
}
if (target.isEmpty()) {
- if ((idx) == (path.size()-1) && node->isInnerNode() && (flags & SearchEnumValues)) {
- t = static_cast<const InnerNode*>(node)->findEnumNodeForValue(path.at(idx));
+ if ((idx) == (path.size()-1) && node->isAggregate() && (flags & SearchEnumValues)) {
+ t = static_cast<const Aggregate*>(node)->findEnumNodeForValue(path.at(idx));
if (t)
return t;
}
@@ -863,7 +865,7 @@ const Node* Tree::matchPathAndTarget(const QStringList& path,
return t;
if (target.isEmpty()) {
if ((idx) == (path.size()-1) && (flags & SearchEnumValues)) {
- t = static_cast<const InnerNode*>(bc)->findEnumNodeForValue(path.at(idx));
+ t = static_cast<const Aggregate*>(bc)->findEnumNodeForValue(path.at(idx));
if (t)
return t;
}
@@ -915,20 +917,20 @@ const Node* Tree::findNode(const QStringList& path,
}
for (i = start_idx; i < path.size(); ++i) {
- if (node == 0 || !node->isInnerNode())
+ if (node == 0 || !node->isAggregate())
break;
- const Node* next = static_cast<const InnerNode*>(node)->findChildNode(path.at(i), genus);
+ const Node* next = static_cast<const Aggregate*>(node)->findChildNode(path.at(i), genus);
if (!next && (findFlags & SearchEnumValues) && i == path.size()-1) {
- next = static_cast<const InnerNode*>(node)->findEnumNodeForValue(path.at(i));
+ next = static_cast<const Aggregate*>(node)->findEnumNodeForValue(path.at(i));
}
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);
+ next = static_cast<const Aggregate*>(baseClass)->findChildNode(path.at(i), genus);
if (!next && (findFlags & SearchEnumValues) && i == path.size() - 1)
- next = static_cast<const InnerNode*>(baseClass)->findEnumNodeForValue(path.at(i));
+ next = static_cast<const Aggregate*>(baseClass)->findEnumNodeForValue(path.at(i));
if (next) {
break;
}
@@ -980,7 +982,7 @@ QString Tree::getRef(const QString& target, const Node* node) const
*/
void Tree::insertTarget(const QString& name,
const QString& title,
- TargetRec::Type type,
+ TargetRec::TargetType type,
Node* node,
int priority)
{
@@ -991,7 +993,7 @@ void Tree::insertTarget(const QString& name,
/*!
*/
-void Tree::resolveTargets(InnerNode* root)
+void Tree::resolveTargets(Aggregate* root)
{
// need recursion
foreach (Node* child, root->childNodes()) {
@@ -1005,7 +1007,7 @@ void Tree::resolveTargets(InnerNode* root)
bool alreadyThere = false;
if (!nodes.empty()) {
for (int i=0; i< nodes.size(); ++i) {
- if (nodes[i]->subType() == Node::ExternalPage) {
+ if (nodes[i]->docSubtype() == Node::ExternalPage) {
if (node->name() == nodes[i]->name()) {
alreadyThere = true;
break;
@@ -1140,18 +1142,15 @@ const DocumentNode* Tree::findDocumentNodeByTitle(const QString& title) const
DocumentNodeMultiMap::const_iterator j = i;
++j;
if (j != docNodesByTitle_.constEnd() && j.key() == i.key()) {
- QList<Location> internalLocations;
while (j != docNodesByTitle_.constEnd()) {
if (j.key() == i.key() && j.value()->url().isEmpty()) {
- internalLocations.append(j.value()->location());
break; // Just report one duplicate for now.
}
++j;
}
- if (internalLocations.size() > 0) {
+ if (j != docNodesByTitle_.cend()) {
i.value()->location().warning("This page title exists in more than one file: " + title);
- foreach (const Location &location, internalLocations)
- location.warning("[It also exists here]");
+ j.value()->location().warning("[It also exists here]");
}
}
return i.value();
@@ -1252,7 +1251,7 @@ CollectionNode* Tree::findCollection(const QString& name, Node::Genus genus)
CNMap::const_iterator i = m->constFind(name);
if (i != m->cend())
return i.value();
- Node::Type t = Node::NoType;
+ Node::NodeType t = Node::NoType;
switch (genus) {
case Node::DOC:
t = Node::Group;
diff --git a/src/tools/qdoc/tree.h b/src/tools/qdoc/tree.h
index 1e9612aeec..0f41c221b6 100644
--- a/src/tools/qdoc/tree.h
+++ b/src/tools/qdoc/tree.h
@@ -49,11 +49,11 @@ class QDocDatabase;
struct TargetRec
{
public:
- enum Type { Unknown, Target, Keyword, Contents, Class, Function, Page, Subtitle };
+ enum TargetType { Unknown, Target, Keyword, Contents, Class, Function, Page, Subtitle };
TargetRec(const QString& name,
const QString& title,
- TargetRec::Type type,
+ TargetRec::TargetType type,
Node* node,
int priority)
: node_(node), ref_(name), title_(title), priority_(priority), type_(type) { }
@@ -64,7 +64,7 @@ struct TargetRec
QString ref_;
QString title_;
int priority_;
- Type type_;
+ TargetType type_;
};
struct TargetLoc
@@ -107,7 +107,7 @@ class Tree
Node* findNodeRecursive(const QStringList& path,
int pathIndex,
const Node* start,
- Node::Type type) const;
+ Node::NodeType type) const;
Node* findNodeRecursive(const QStringList& path,
int pathIndex,
Node* start,
@@ -134,22 +134,22 @@ class Tree
QmlTypeNode* findQmlTypeNode(const QStringList& path);
- Node* findNodeByNameAndType(const QStringList& path, Node::Type type) const;
- InnerNode* findRelatesNode(const QStringList& path);
+ Node* findNodeByNameAndType(const QStringList& path, Node::NodeType type) const;
+ Aggregate* findRelatesNode(const QStringList& path);
QString getRef(const QString& target, const Node* node) const;
void insertTarget(const QString& name,
const QString& title,
- TargetRec::Type type,
+ TargetRec::TargetType type,
Node* node,
int priority);
- void resolveTargets(InnerNode* root);
+ void resolveTargets(Aggregate* root);
const Node* findUnambiguousTarget(const QString& target, QString& ref) const;
const DocumentNode* findDocumentNodeByTitle(const QString& title) const;
void addPropertyFunction(PropertyNode *property,
const QString &funcName,
PropertyNode::FunctionRole funcRole);
- void resolveInheritance(InnerNode* n = 0);
+ void resolveInheritance(Aggregate* n = 0);
void resolveInheritanceHelper(int pass, ClassNode* cn);
void resolveProperties();
void resolveCppToQmlLinks();
diff --git a/src/tools/uic/cpp/cppwriteincludes.h b/src/tools/uic/cpp/cppwriteincludes.h
index 6e7888c62b..e4f1aedb7e 100644
--- a/src/tools/uic/cpp/cppwriteincludes.h
+++ b/src/tools/uic/cpp/cppwriteincludes.h
@@ -36,7 +36,6 @@
#include "treewalker.h"
-#include <qhash.h>
#include <qmap.h>
#include <qset.h>
#include <qstring.h>
diff --git a/src/tools/uic/uic.h b/src/tools/uic/uic.h
index e88326f0da..b65b662473 100644
--- a/src/tools/uic/uic.h
+++ b/src/tools/uic/uic.h
@@ -38,7 +38,6 @@
#include "customwidgetsinfo.h"
#include <qstring.h>
#include <qstringlist.h>
-#include <qhash.h>
#include <qstack.h>
#include <qxmlstream.h>