summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Wicking <paul.wicking@qt.io>2019-08-06 11:34:01 +0200
committerPaul Wicking <paul.wicking@qt.io>2019-08-06 11:34:01 +0200
commit6a04f888b7bece2b4276ba6d55073c06e8d4f652 (patch)
tree9d992a96756784f97b967f21cd6a5202fcae4744
parent864a1c0bca7a763d194048009a99a799a9811f4c (diff)
parentb05d6b04e0527953983cc0451015efa27fa58580 (diff)
downloadqttools-6a04f888b7bece2b4276ba6d55073c06e8d4f652.tar.gz
Merge 5.13 into 5.13.1
Change-Id: I9390352a6e8a8802b99c5aac0bb39ae1d11399f7
-rw-r--r--src/qdoc/codeparser.cpp2
-rw-r--r--src/qdoc/generator.cpp3
-rw-r--r--src/qdoc/htmlgenerator.cpp2
-rw-r--r--src/qdoc/node.cpp56
-rw-r--r--src/qdoc/node.h8
-rw-r--r--src/qdoc/qdocdatabase.cpp220
-rw-r--r--src/qdoc/qdocdatabase.h1
-rw-r--r--src/qdoc/qdocindexfiles.cpp3
-rw-r--r--src/qdoc/tree.cpp347
-rw-r--r--src/qdoc/tree.h7
-rw-r--r--src/shared/qtpropertybrowser/qtpropertybrowserutils.cpp6
11 files changed, 350 insertions, 305 deletions
diff --git a/src/qdoc/codeparser.cpp b/src/qdoc/codeparser.cpp
index 42adae244..860836c3d 100644
--- a/src/qdoc/codeparser.cpp
+++ b/src/qdoc/codeparser.cpp
@@ -320,7 +320,7 @@ void CodeParser::checkModuleInclusion(Node* n)
default:
return;
}
- if (!n->isPrivate() && !n->name().isEmpty() && !n->doc().isEmpty()) {
+ if (n->isInAPI() && !n->name().isEmpty()) {
n->doc().location().warning(tr("%1 %2 has no \\inmodule command; "
"using project name by default: %3")
.arg(word).arg(n->name()).arg(Generator::defaultModuleName()));
diff --git a/src/qdoc/generator.cpp b/src/qdoc/generator.cpp
index e80fa5a4c..c7831d1fd 100644
--- a/src/qdoc/generator.cpp
+++ b/src/qdoc/generator.cpp
@@ -216,8 +216,7 @@ int Generator::appendSortedNames(Text& text, const ClassNode* cn, const QList<Re
r = rc.constBegin();
while (r != rc.constEnd()) {
ClassNode* rcn = (*r).node_;
- if (rcn && rcn->access() == Node::Public &&
- !rcn->isInternal() && !rcn->doc().isEmpty()) {
+ if (rcn && rcn->isInAPI()) {
Text className;
appendFullName(className, rcn, cn);
classMap[className.toString().toLower()] = className;
diff --git a/src/qdoc/htmlgenerator.cpp b/src/qdoc/htmlgenerator.cpp
index c5f5b47dd..619630ab9 100644
--- a/src/qdoc/htmlgenerator.cpp
+++ b/src/qdoc/htmlgenerator.cpp
@@ -2917,7 +2917,7 @@ void HtmlGenerator::generateClassHierarchy(const Node *relative, NodeMap& classM
NodeMap newTop;
foreach (const RelatedClass &d, child->derivedClasses()) {
- if (d.node_ && !d.isPrivate() && !d.node_->isInternal() && d.node_->hasDoc())
+ if (d.node_ && d.node_->isInAPI())
newTop.insert(d.node_->name(), d.node_);
}
if (!newTop.isEmpty()) {
diff --git a/src/qdoc/node.cpp b/src/qdoc/node.cpp
index f0ffafa1b..774d41f31 100644
--- a/src/qdoc/node.cpp
+++ b/src/qdoc/node.cpp
@@ -1591,7 +1591,7 @@ bool NamespaceNode::isDocumentedHere() const
bool NamespaceNode::hasDocumentedChildren() const
{
foreach (Node *n, children_) {
- if (n->hasDoc() && !n->isPrivate() && !n->isInternal())
+ if (n->isInAPI())
return true;
}
return false;
@@ -1605,7 +1605,7 @@ bool NamespaceNode::hasDocumentedChildren() const
void NamespaceNode::reportDocumentedChildrenInUndocumentedNamespace() const
{
foreach (Node *n, children_) {
- if (n->hasDoc() && !n->isPrivate() && !n->isInternal()) {
+ if (n->isInAPI()) {
QString msg1 = n->name();
if (n->isFunction())
msg1 += "()";
@@ -1623,7 +1623,7 @@ void NamespaceNode::reportDocumentedChildrenInUndocumentedNamespace() const
*/
bool NamespaceNode::docMustBeGenerated() const
{
- if (hasDoc() && !isInternal() && !isPrivate())
+ if (isInAPI())
return true;
return (hasDocumentedChildren() ? true : false);
}
@@ -1703,8 +1703,37 @@ void ClassNode::addUnresolvedUsingClause(const QString& signature)
}
/*!
+ A base class of this class node was private or internal.
+ That node's list of \a bases is traversed in this function.
+ Each of its public base classes is promoted to be a base
+ class of this node for documentation purposes. For each
+ private or internal class node in \a bases, this function
+ is called recursively with the list of base classes from
+ that private or internal class node.
*/
-void ClassNode::fixBaseClasses()
+void ClassNode::promotePublicBases(const QList<RelatedClass>& bases)
+{
+ if (!bases.isEmpty()) {
+ for (int i = bases.size() - 1; i >= 0; --i) {
+ ClassNode* bc = bases.at(i).node_;
+ if (bc == nullptr)
+ bc = QDocDatabase::qdocDB()->findClassNode(bases.at(i).path_);
+ if (bc != nullptr) {
+ if (bc->isPrivate() || bc->isInternal())
+ promotePublicBases(bc->baseClasses());
+ else
+ bases_.append(bases.at(i));
+ }
+ }
+ }
+}
+
+/*!
+ Remove private and internal bases classes from this class's list
+ of base classes. When a base class is removed from the list, add
+ its base classes to this class's list of base classes.
+ */
+void ClassNode::removePrivateAndInternalBases()
{
int i;
i = 0;
@@ -1715,13 +1744,11 @@ void ClassNode::fixBaseClasses()
ClassNode* bc = bases_.at(i).node_;
if (bc == nullptr)
bc = QDocDatabase::qdocDB()->findClassNode(bases_.at(i).path_);
- if (bc != nullptr && (bc->access() == Node::Private || found.contains(bc))) {
+ if (bc != nullptr && (bc->isPrivate() || bc->isInternal() || found.contains(bc))) {
RelatedClass rc = bases_.at(i);
bases_.removeAt(i);
ignoredBases_.append(rc);
- const QList<RelatedClass> &bb = bc->baseClasses();
- for (int j = bb.size() - 1; j >= 0; --j)
- bases_.insert(i, bb.at(j));
+ promotePublicBases(bc->baseClasses());
}
else {
++i;
@@ -1732,7 +1759,7 @@ void ClassNode::fixBaseClasses()
i = 0;
while (i < derived_.size()) {
ClassNode* dc = derived_.at(i).node_;
- if (dc != nullptr && dc->access() == Node::Private) {
+ if (dc != nullptr && (dc->isPrivate() || dc->isInternal())) {
derived_.removeAt(i);
const QList<RelatedClass> &dd = dc->derivedClasses();
for (int j = dd.size() - 1; j >= 0; --j)
@@ -1745,9 +1772,8 @@ void ClassNode::fixBaseClasses()
}
/*!
- Not sure why this is needed.
*/
-void ClassNode::fixPropertyUsingBaseClasses(PropertyNode* pn)
+void ClassNode::resolvePropertyOverriddenFromPtrs(PropertyNode* pn)
{
QList<RelatedClass>::const_iterator bc = baseClasses().constBegin();
while (bc != baseClasses().constEnd()) {
@@ -1756,11 +1782,11 @@ void ClassNode::fixPropertyUsingBaseClasses(PropertyNode* pn)
Node* n = cn->findNonfunctionChild(pn->name(), &Node::isProperty);
if (n) {
PropertyNode* baseProperty = static_cast<PropertyNode*>(n);
- cn->fixPropertyUsingBaseClasses(baseProperty);
+ cn->resolvePropertyOverriddenFromPtrs(baseProperty);
pn->setOverriddenFrom(baseProperty);
}
else
- cn->fixPropertyUsingBaseClasses(pn);
+ cn->resolvePropertyOverriddenFromPtrs(pn);
}
++bc;
}
@@ -1944,7 +1970,7 @@ HeaderNode::HeaderNode(Aggregate* parent, const QString& name) : Aggregate(Heade
*/
bool HeaderNode::docMustBeGenerated() const
{
- if (hasDoc() && !isInternal() && !isPrivate())
+ if (isInAPI())
return true;
return (hasDocumentedChildren() ? true : false);
}
@@ -1956,7 +1982,7 @@ bool HeaderNode::docMustBeGenerated() const
bool HeaderNode::hasDocumentedChildren() const
{
foreach (Node *n, children_) {
- if (n->hasDoc() && !n->isPrivate() && !n->isInternal())
+ if (n->isInAPI())
return true;
}
return false;
diff --git a/src/qdoc/node.h b/src/qdoc/node.h
index b163541b9..755f5efb4 100644
--- a/src/qdoc/node.h
+++ b/src/qdoc/node.h
@@ -308,6 +308,7 @@ public:
const Location& defLocation() const { return defLocation_; }
const Location& location() const { return (defLocation_.isEmpty() ? declLocation_ : defLocation_); }
const Doc& doc() const { return doc_; }
+ bool isInAPI() const { return !isPrivate() && !isInternal() && hasDoc(); }
bool hasDoc() const { return (hadDoc_ || !doc_.isEmpty()); }
bool hadDoc() const { return hadDoc_; }
Status status() const { return status_; }
@@ -613,8 +614,8 @@ public:
void addDerivedClass(Access access, ClassNode* node);
void addUnresolvedBaseClass(Access access, const QStringList& path, const QString& signature);
void addUnresolvedUsingClause(const QString& signature);
- void fixBaseClasses();
- void fixPropertyUsingBaseClasses(PropertyNode* pn);
+ void removePrivateAndInternalBases();
+ void resolvePropertyOverriddenFromPtrs(PropertyNode* pn);
QList<RelatedClass>& baseClasses() { return bases_; }
QList<RelatedClass>& derivedClasses() { return derived_; }
@@ -636,6 +637,9 @@ public:
PropertyNode* findOverriddenProperty(const FunctionNode* fn);
bool docMustBeGenerated() const override;
+ private:
+ void promotePublicBases(const QList<RelatedClass>& bases);
+
private:
QList<RelatedClass> bases_;
QList<RelatedClass> derived_;
diff --git a/src/qdoc/qdocdatabase.cpp b/src/qdoc/qdocdatabase.cpp
index ef2b5ab33..2cbc8fab9 100644
--- a/src/qdoc/qdocdatabase.cpp
+++ b/src/qdoc/qdocdatabase.cpp
@@ -100,7 +100,7 @@ QDocForest::~QDocForest()
returns a pointer to the root node of the primary
tree. If the forest is empty, it return 0
*/
-NamespaceNode* QDocForest::firstRoot()
+NamespaceNode *QDocForest::firstRoot()
{
currentIndex_ = 0;
return (!searchOrder().isEmpty() ? searchOrder()[0]->root() : nullptr);
@@ -111,7 +111,7 @@ NamespaceNode* QDocForest::firstRoot()
tree index is still within the forest, the function returns
the root node of the current tree. Otherwise it returns 0.
*/
-NamespaceNode* QDocForest::nextRoot()
+NamespaceNode *QDocForest::nextRoot()
{
++currentIndex_;
return (currentIndex_ < searchOrder().size() ? searchOrder()[currentIndex_]->root() : nullptr);
@@ -122,7 +122,7 @@ NamespaceNode* QDocForest::nextRoot()
returns a pointer to the primary tree. If the
forest is empty, it returns 0.
*/
-Tree* QDocForest::firstTree()
+Tree *QDocForest::firstTree()
{
currentIndex_ = 0;
return (!searchOrder().isEmpty() ? searchOrder()[0] : nullptr);
@@ -133,14 +133,14 @@ Tree* QDocForest::firstTree()
tree index is still within the forest, the function returns
the pointer to the current tree. Otherwise it returns 0.
*/
-Tree* QDocForest::nextTree()
+Tree *QDocForest::nextTree()
{
++currentIndex_;
return (currentIndex_ < searchOrder().size() ? searchOrder()[currentIndex_] : nullptr);
}
/*!
- \fn Tree* QDocForest::primaryTree()
+ \fn Tree *QDocForest::primaryTree()
Returns the pointer to the primary tree.
*/
@@ -154,7 +154,7 @@ Tree* QDocForest::nextTree()
\node It gets re-inserted into the forest after the
search order is built.
*/
-void QDocForest::setPrimaryTree(const QString& t)
+void QDocForest::setPrimaryTree(const QString &t)
{
QString T = t.toLower();
primaryTree_ = findTree(T);
@@ -167,7 +167,7 @@ void QDocForest::setPrimaryTree(const QString& t)
If the search order array is empty, create the search order.
If the search order array is not empty, do nothing.
*/
-void QDocForest::setSearchOrder(QStringList& t)
+void QDocForest::setSearchOrder(QStringList &t)
{
if (!searchOrder_.isEmpty())
return;
@@ -257,7 +257,7 @@ void QDocForest::setSearchOrder(QStringList& t)
ordering required in this temporary search order is that
the current tree must be searched first.
*/
-const QVector<Tree*>& QDocForest::searchOrder()
+const QVector<Tree*> &QDocForest::searchOrder()
{
if (searchOrder_.isEmpty())
return indexSearchOrder();
@@ -279,7 +279,7 @@ const QVector<Tree*>& QDocForest::searchOrder()
one being read now. That one is prepended to the front of
the vector.
*/
-const QVector<Tree*>& QDocForest::indexSearchOrder()
+const QVector<Tree*> &QDocForest::indexSearchOrder()
{
if (forest_.size() > indexSearchOrder_.size())
indexSearchOrder_.prepend(primaryTree_);
@@ -291,7 +291,7 @@ const QVector<Tree*>& QDocForest::indexSearchOrder()
\a module and add it to the forest. Return the pointer
to its root.
*/
-NamespaceNode* QDocForest::newIndexTree(const QString& module)
+NamespaceNode *QDocForest::newIndexTree(const QString &module)
{
primaryTree_ = new Tree(module, qdb_);
forest_.insert(module.toLower(), primaryTree_);
@@ -302,7 +302,7 @@ NamespaceNode* QDocForest::newIndexTree(const QString& module)
Create a new Tree for use as the primary tree. This tree
will represent the primary module. \a module is camel case.
*/
-void QDocForest::newPrimaryTree(const QString& module)
+void QDocForest::newPrimaryTree(const QString &module)
{
primaryTree_ = new Tree(module, qdb_);
}
@@ -317,10 +317,10 @@ void QDocForest::newPrimaryTree(const QString& module)
to 0, the starting point for each index tree is the root
of the index tree.
*/
-const Node* QDocForest::findNodeForTarget(QStringList& targetPath,
- const Node* relative,
+const Node *QDocForest::findNodeForTarget(QStringList &targetPath,
+ const Node *relative,
Node::Genus genus,
- QString& ref)
+ QString &ref)
{
int flags = SearchBaseClasses | SearchEnumValues;
@@ -331,8 +331,8 @@ const Node* QDocForest::findNodeForTarget(QStringList& targetPath,
if (!targetPath.isEmpty())
target = targetPath.takeFirst();
- foreach (Tree* t, searchOrder()) {
- const Node* n = t->findNodeForTarget(entityPath, target, relative, flags, genus, ref);
+ foreach (Tree *t, searchOrder()) {
+ const Node *n = t->findNodeForTarget(entityPath, target, relative, flags, genus, ref);
if (n)
return n;
relative = nullptr;
@@ -344,11 +344,11 @@ const Node* QDocForest::findNodeForTarget(QStringList& targetPath,
Print the list of module names ordered according
to how many successful searches each tree had.
*/
-void QDocForest::printLinkCounts(const QString& project)
+void QDocForest::printLinkCounts(const QString &project)
{
Location::null.report(QString("%1: Link Counts").arg(project));
QMultiMap<int, QString> m;
- foreach (Tree* t, searchOrder()) {
+ foreach (Tree *t, searchOrder()) {
if (t->linkCount() < 0)
m.insert(t->linkCount(), t->physicalModuleName());
}
@@ -374,10 +374,10 @@ void QDocForest::printLinkCounts(const QString& project)
Print the list of module names ordered according
to how many successful searches each tree had.
*/
-QString QDocForest::getLinkCounts(QStringList& strings, QVector<int>& counts)
+QString QDocForest::getLinkCounts(QStringList &strings, QVector<int> &counts)
{
QMultiMap<int, QString> m;
- foreach (Tree* t, searchOrder()) {
+ foreach (Tree *t, searchOrder()) {
if (t->linkCount() < 0)
m.insert(t->linkCount(), t->physicalModuleName());
}
@@ -407,10 +407,10 @@ QString QDocForest::getLinkCounts(QStringList& strings, QVector<int>& counts)
*/
const FunctionNode *QDocForest::findFunctionNode(const QStringList &path,
const Parameters &parameters,
- const Node* relative,
+ const Node *relative,
Node::Genus genus)
{
- foreach (Tree* t, searchOrder()) {
+ foreach (Tree *t, searchOrder()) {
const FunctionNode *fn = t->findFunctionNode(path, parameters, relative, genus);
if (fn)
return fn;
@@ -425,7 +425,7 @@ const FunctionNode *QDocForest::findFunctionNode(const QStringList &path,
other useful data structures.
*/
-QDocDatabase* QDocDatabase::qdocDB_ = nullptr;
+QDocDatabase *QDocDatabase::qdocDB_ = nullptr;
NodeMap QDocDatabase::typeNodeMap_;
NodeMultiMap QDocDatabase::obsoleteClasses_;
NodeMultiMap QDocDatabase::classesWithObsoleteMembers_;
@@ -475,7 +475,7 @@ QDocDatabase::~QDocDatabase()
Creates the singleton. Allows only one instance of the class
to be created. Returns a pointer to the singleton.
*/
-QDocDatabase* QDocDatabase::qdocDB()
+QDocDatabase *QDocDatabase::qdocDB()
{
if (qdocDB_ == nullptr) {
qdocDB_ = new QDocDatabase;
@@ -649,35 +649,35 @@ void QDocDatabase::initializeDB()
typeNodeMap_.insert( "zoomTo", nullptr);
}
-/*! \fn NamespaceNode* QDocDatabase::primaryTreeRoot()
+/*! \fn NamespaceNode *QDocDatabase::primaryTreeRoot()
Returns a pointer to the root node of the primary tree.
*/
/*!
- \fn const CNMap& QDocDatabase::groups()
+ \fn const CNMap &QDocDatabase::groups()
Returns a const reference to the collection of all
group nodes in the primary tree.
*/
/*!
- \fn const CNMap& QDocDatabase::modules()
+ \fn const CNMap &QDocDatabase::modules()
Returns a const reference to the collection of all
module nodes in the primary tree.
*/
/*!
- \fn const CNMap& QDocDatabase::qmlModules()
+ \fn const CNMap &QDocDatabase::qmlModules()
Returns a const reference to the collection of all
QML module nodes in the primary tree.
*/
/*!
- \fn const CNMap& QDocDatabase::jsModules()
+ \fn const CNMap &QDocDatabase::jsModules()
Returns a const reference to the collection of all
JovaScript module nodes in the primary tree.
*/
-/*! \fn CollectionNode* QDocDatabase::findGroup(const QString& name)
+/*! \fn CollectionNode *QDocDatabase::findGroup(const QString &name)
Find the group node named \a name and return a pointer
to it. If a matching node is not found, add a new group
node named \a name and return a pointer to that one.
@@ -686,7 +686,7 @@ void QDocDatabase::initializeDB()
and the new group node is marked \e{not seen}.
*/
-/*! \fn CollectionNode* QDocDatabase::findModule(const QString& name)
+/*! \fn CollectionNode *QDocDatabase::findModule(const QString &name)
Find the module node named \a name and return a pointer
to it. If a matching node is not found, add a new module
node named \a name and return a pointer to that one.
@@ -695,7 +695,7 @@ void QDocDatabase::initializeDB()
and the new module node is marked \e{not seen}.
*/
-/*! \fn CollectionNode* QDocDatabase::findQmlModule(const QString& name, bool javaScript)
+/*! \fn CollectionNode *QDocDatabase::findQmlModule(const QString &name, bool javaScript)
Find the QML module node named \a name and return a pointer
to it. If a matching node is not found, add a new QML module
node named \a name and return a pointer to that one.
@@ -707,7 +707,7 @@ void QDocDatabase::initializeDB()
is the tree root, and the new node is marked \e{not seen}.
*/
-/*! \fn CollectionNode* QDocDatabase::addGroup(const QString& name)
+/*! \fn CollectionNode *QDocDatabase::addGroup(const QString &name)
Looks up the group named \a name in the primary tree. If
a match is found, a pointer to the node is returned.
Otherwise, a new group node named \a name is created and
@@ -715,7 +715,7 @@ void QDocDatabase::initializeDB()
is returned.
*/
-/*! \fn CollectionNode* QDocDatabase::addModule(const QString& name)
+/*! \fn CollectionNode *QDocDatabase::addModule(const QString &name)
Looks up the module named \a name in the primary tree. If
a match is found, a pointer to the node is returned.
Otherwise, a new module node named \a name is created and
@@ -723,7 +723,7 @@ void QDocDatabase::initializeDB()
is returned.
*/
-/*! \fn CollectionNode* QDocDatabase::addQmlModule(const QString& name)
+/*! \fn CollectionNode *QDocDatabase::addQmlModule(const QString &name)
Looks up the QML module named \a name in the primary tree.
If a match is found, a pointer to the node is returned.
Otherwise, a new QML module node named \a name is created
@@ -731,7 +731,7 @@ void QDocDatabase::initializeDB()
node is returned.
*/
-/*! \fn CollectionNode* QDocDatabase::addJsModule(const QString& name)
+/*! \fn CollectionNode *QDocDatabase::addJsModule(const QString &name)
Looks up the JavaScript module named \a name in the primary
tree. If a match is found, a pointer to the node is returned.
Otherwise, a new JavaScript module node named \a name is
@@ -739,7 +739,7 @@ void QDocDatabase::initializeDB()
that node is returned.
*/
-/*! \fn CollectionNode* QDocDatabase::addToGroup(const QString& name, Node* node)
+/*! \fn CollectionNode *QDocDatabase::addToGroup(const QString &name, Node *node)
Looks up the group node named \a name in the collection
of all group nodes. If a match is not found, a new group
node named \a name is created and inserted into the collection.
@@ -749,7 +749,7 @@ void QDocDatabase::initializeDB()
the group node.
*/
-/*! \fn CollectionNode* QDocDatabase::addToModule(const QString& name, Node* node)
+/*! \fn CollectionNode *QDocDatabase::addToModule(const QString &name, Node *node)
Looks up the module node named \a name in the collection
of all module nodes. If a match is not found, a new module
node named \a name is created and inserted into the collection.
@@ -757,13 +757,13 @@ void QDocDatabase::initializeDB()
\a node is not changed by this function. Returns the module node.
*/
-/*! \fn Collection* QDocDatabase::addToQmlModule(const QString& name, Node* node)
+/*! \fn Collection *QDocDatabase::addToQmlModule(const QString &name, Node *node)
Looks up the QML module named \a name. If it isn't there,
create it. Then append \a node to the QML module's member
list. The parent of \a node is not changed by this function.
*/
-/*! \fn Collection* QDocDatabase::addToJsModule(const QString& name, Node* node)
+/*! \fn Collection *QDocDatabase::addToJsModule(const QString &name, Node *node)
Looks up the JavaScript module named \a name. If it isn't there,
create it. Then append \a node to the JavaScript module's member
list. The parent of \a node is not changed by this function.
@@ -773,9 +773,9 @@ void QDocDatabase::initializeDB()
Looks up the QML type node identified by the qualified Qml
type \a name and returns a pointer to the QML type node.
*/
-QmlTypeNode* QDocDatabase::findQmlType(const QString& name)
+QmlTypeNode *QDocDatabase::findQmlType(const QString &name)
{
- QmlTypeNode* qcn = forest_.lookupQmlType(name);
+ QmlTypeNode *qcn = forest_.lookupQmlType(name);
if (qcn)
return qcn;
return nullptr;
@@ -789,17 +789,17 @@ QmlTypeNode* QDocDatabase::findQmlType(const QString& name)
If the QML module id is empty, it looks up the QML type by
\a name only.
*/
-QmlTypeNode* QDocDatabase::findQmlType(const QString& qmid, const QString& name)
+QmlTypeNode *QDocDatabase::findQmlType(const QString &qmid, const QString &name)
{
if (!qmid.isEmpty()) {
QString t = qmid + "::" + name;
- QmlTypeNode* qcn = forest_.lookupQmlType(t);
+ QmlTypeNode *qcn = forest_.lookupQmlType(t);
if (qcn)
return qcn;
}
QStringList path(name);
- Node* n = forest_.findNodeByNameAndType(path, &Node::isQmlType);
+ Node *n = forest_.findNodeByNameAndType(path, &Node::isQmlType);
if (n && (n->isQmlType() || n->isJsType()))
return static_cast<QmlTypeNode*>(n);
return nullptr;
@@ -813,17 +813,17 @@ QmlTypeNode* QDocDatabase::findQmlType(const QString& qmid, const QString& name)
If the QML module id is empty, it looks up the QML basic type by
\a name only.
*/
-Aggregate* QDocDatabase::findQmlBasicType(const QString& qmid, const QString& name)
+Aggregate *QDocDatabase::findQmlBasicType(const QString &qmid, const QString &name)
{
if (!qmid.isEmpty()) {
QString t = qmid + "::" + name;
- Aggregate* a = forest_.lookupQmlBasicType(t);
+ Aggregate *a = forest_.lookupQmlBasicType(t);
if (a)
return a;
}
QStringList path(name);
- Node* n = forest_.findNodeByNameAndType(path, &Node::isQmlBasicType);
+ Node *n = forest_.findNodeByNameAndType(path, &Node::isQmlBasicType);
if (n && n->isQmlBasicType())
return static_cast<Aggregate*>(n);
return nullptr;
@@ -835,7 +835,7 @@ Aggregate* QDocDatabase::findQmlBasicType(const QString& qmid, const QString& na
QML type \a name and returns a pointer to the QML type node.
If a QML type node is not found, 0 is returned.
*/
-QmlTypeNode* QDocDatabase::findQmlType(const ImportRec& import, const QString& name)
+QmlTypeNode *QDocDatabase::findQmlType(const ImportRec &import, const QString &name)
{
if (!import.isEmpty()) {
QStringList dotSplit;
@@ -847,7 +847,7 @@ QmlTypeNode* QDocDatabase::findQmlType(const ImportRec& import, const QString& n
qmName = import.importUri_;
for (int i=0; i<dotSplit.size(); ++i) {
QString qualifiedName = qmName + "::" + dotSplit[i];
- QmlTypeNode* qcn = forest_.lookupQmlType(qualifiedName);
+ QmlTypeNode *qcn = forest_.lookupQmlType(qualifiedName);
if (qcn)
return qcn;
}
@@ -864,7 +864,7 @@ QmlTypeNode* QDocDatabase::findQmlType(const ImportRec& import, const QString& n
*/
void QDocDatabase::processForest()
{
- Tree* t = forest_.firstTree();
+ Tree *t = forest_.firstTree();
while (t) {
findAllClasses(t->root());
findAllFunctions(t->root());
@@ -887,7 +887,7 @@ void QDocDatabase::processForest()
*/
void QDocDatabase::processForest(void (QDocDatabase::*func) (Aggregate*))
{
- Tree* t = forest_.firstTree();
+ Tree *t = forest_.firstTree();
while (t) {
if (!t->treeHasBeenAnalyzed()) {
(this->*(func))(t->root());
@@ -900,7 +900,7 @@ void QDocDatabase::processForest(void (QDocDatabase::*func) (Aggregate*))
Constructs the collection of legalese texts, if it has not
already been constructed, and returns a reference to it.
*/
-TextToNodeMap& QDocDatabase::getLegaleseTexts()
+TextToNodeMap &QDocDatabase::getLegaleseTexts()
{
if (legaleseTexts_.isEmpty())
processForest(&QDocDatabase::findAllLegaleseTexts);
@@ -912,7 +912,7 @@ TextToNodeMap& QDocDatabase::getLegaleseTexts()
have not already been constructed. Returns a reference to
the map of C++ classes with obsolete members.
*/
-NodeMultiMap& QDocDatabase::getClassesWithObsoleteMembers()
+NodeMultiMap &QDocDatabase::getClassesWithObsoleteMembers()
{
if (obsoleteClasses_.isEmpty() && obsoleteQmlTypes_.isEmpty())
processForest(&QDocDatabase::findAllObsoleteThings);
@@ -924,7 +924,7 @@ NodeMultiMap& QDocDatabase::getClassesWithObsoleteMembers()
have not already been constructed. Returns a reference to
the map of obsolete QML types.
*/
-NodeMultiMap& QDocDatabase::getObsoleteQmlTypes()
+NodeMultiMap &QDocDatabase::getObsoleteQmlTypes()
{
if (obsoleteClasses_.isEmpty() && obsoleteQmlTypes_.isEmpty())
processForest(&QDocDatabase::findAllObsoleteThings);
@@ -936,14 +936,14 @@ NodeMultiMap& QDocDatabase::getObsoleteQmlTypes()
have not already been constructed. Returns a reference to
the map of QML types with obsolete members.
*/
-NodeMultiMap& QDocDatabase::getQmlTypesWithObsoleteMembers()
+NodeMultiMap &QDocDatabase::getQmlTypesWithObsoleteMembers()
{
if (obsoleteClasses_.isEmpty() && obsoleteQmlTypes_.isEmpty())
processForest(&QDocDatabase::findAllObsoleteThings);
return qmlTypesWithObsoleteMembers_;
}
-/*! \fn NodeMultiMap& QDocDatabase::getNamespaces()
+/*! \fn NodeMultiMap &QDocDatabase::getNamespaces()
Returns a reference to the map of all namespace nodes.
This function must not be called in the -prepare phase.
*/
@@ -953,7 +953,7 @@ NodeMultiMap& QDocDatabase::getQmlTypesWithObsoleteMembers()
have not already been constructed. Returns a reference to
the map of QML basic types.
*/
-NodeMultiMap& QDocDatabase::getQmlBasicTypes()
+NodeMultiMap &QDocDatabase::getQmlBasicTypes()
{
if (cppClasses_.isEmpty() && qmlBasicTypes_.isEmpty())
processForest(&QDocDatabase::findAllClasses);
@@ -965,7 +965,7 @@ NodeMultiMap& QDocDatabase::getQmlBasicTypes()
have not already been constructed. Returns a reference to
the multimap of QML types.
*/
-NodeMultiMap& QDocDatabase::getQmlTypes()
+NodeMultiMap &QDocDatabase::getQmlTypes()
{
if (cppClasses_.isEmpty() && qmlTypes_.isEmpty())
processForest(&QDocDatabase::findAllClasses);
@@ -977,7 +977,7 @@ NodeMultiMap& QDocDatabase::getQmlTypes()
have not already been constructed. Returns a reference to
the multimap of example nodes.
*/
-NodeMultiMap& QDocDatabase::getExamples()
+NodeMultiMap &QDocDatabase::getExamples()
{
if (cppClasses_.isEmpty() && examples_.isEmpty())
processForest(&QDocDatabase::findAllClasses);
@@ -989,7 +989,7 @@ NodeMultiMap& QDocDatabase::getExamples()
have not already been constructed. Returns a reference to
the multimap of attribution nodes.
*/
-NodeMultiMap& QDocDatabase::getAttributions()
+NodeMultiMap &QDocDatabase::getAttributions()
{
if (attributions_.isEmpty())
processForest(&QDocDatabase::findAllAttributions);
@@ -1001,7 +1001,7 @@ NodeMultiMap& QDocDatabase::getAttributions()
have not already been constructed. Returns a reference to
the map of obsolete C++ clases.
*/
-NodeMultiMap& QDocDatabase::getObsoleteClasses()
+NodeMultiMap &QDocDatabase::getObsoleteClasses()
{
if (obsoleteClasses_.isEmpty() && obsoleteQmlTypes_.isEmpty())
processForest(&QDocDatabase::findAllObsoleteThings);
@@ -1013,7 +1013,7 @@ NodeMultiMap& QDocDatabase::getObsoleteClasses()
already been constructed. Returns a reference to the map
of all C++ classes.
*/
-NodeMultiMap& QDocDatabase::getCppClasses()
+NodeMultiMap &QDocDatabase::getCppClasses()
{
if (cppClasses_.isEmpty() && qmlTypes_.isEmpty())
processForest(&QDocDatabase::findAllClasses);
@@ -1024,7 +1024,7 @@ NodeMultiMap& QDocDatabase::getCppClasses()
Construct the function index data structure and return it.
This data structure is used to output the function index page.
*/
-NodeMapMap& QDocDatabase::getFunctionIndex()
+NodeMapMap &QDocDatabase::getFunctionIndex()
{
if (functionIndex_.isEmpty())
processForest(&QDocDatabase::findAllFunctions);
@@ -1035,7 +1035,7 @@ NodeMapMap& QDocDatabase::getFunctionIndex()
Finds all the nodes containing legalese text and puts them
in a map.
*/
-void QDocDatabase::findAllLegaleseTexts(Aggregate* node)
+void QDocDatabase::findAllLegaleseTexts(Aggregate *node)
{
NodeList::ConstIterator c = node->constBegin();
while (c != node->constEnd()) {
@@ -1073,7 +1073,7 @@ void QDocDatabase::findAllLegaleseTexts(Aggregate* node)
reference to the value, which is a NodeMap. If \a key is not
found, return a reference to an empty NodeMap.
*/
-const NodeMap& QDocDatabase::getClassMap(const QString& key)
+const NodeMap &QDocDatabase::getClassMap(const QString &key)
{
if (newSinceMaps_.isEmpty() && newClassMaps_.isEmpty() && newQmlTypeMaps_.isEmpty())
processForest(&QDocDatabase::findAllSince);
@@ -1088,7 +1088,7 @@ const NodeMap& QDocDatabase::getClassMap(const QString& key)
reference to the value, which is a NodeMap. If the \a key is not
found, return a reference to an empty NodeMap.
*/
-const NodeMap& QDocDatabase::getQmlTypeMap(const QString& key)
+const NodeMap &QDocDatabase::getQmlTypeMap(const QString &key)
{
if (newSinceMaps_.isEmpty() && newClassMaps_.isEmpty() && newQmlTypeMaps_.isEmpty())
processForest(&QDocDatabase::findAllSince);
@@ -1103,7 +1103,7 @@ const NodeMap& QDocDatabase::getQmlTypeMap(const QString& key)
a reference to the value, which is a NodeMultiMap. If \a key
is not found, return a reference to an empty NodeMultiMap.
*/
-const NodeMap& QDocDatabase::getSinceMap(const QString& key)
+const NodeMap &QDocDatabase::getSinceMap(const QString &key)
{
if (newSinceMaps_.isEmpty() && newClassMaps_.isEmpty() && newQmlTypeMaps_.isEmpty())
processForest(&QDocDatabase::findAllSince);
@@ -1120,9 +1120,10 @@ const NodeMap& QDocDatabase::getSinceMap(const QString& key)
*/
void QDocDatabase::resolveStuff() {
if (Generator::dualExec() || Generator::preparing()) {
- primaryTree()->resolveInheritance(primaryTreeRoot());
+ primaryTree()->resolveBaseClasses(primaryTreeRoot());
+ primaryTree()->resolvePropertyOverriddenFromPtrs(primaryTreeRoot());
primaryTreeRoot()->normalizeOverloads();
- primaryTree()->fixInheritance(primaryTreeRoot());
+ primaryTree()->removePrivateAndInternalBases(primaryTreeRoot());
primaryTree()->resolveProperties();
primaryTree()->markDontDocumentNodes();
primaryTreeRoot()->markUndocumentedChildrenInternal();
@@ -1132,7 +1133,8 @@ void QDocDatabase::resolveStuff() {
primaryTree()->resolveUsingClauses();
}
if (Generator::singleExec() && Generator::generating()) {
- primaryTree()->resolveInheritance(primaryTreeRoot());
+ primaryTree()->resolveBaseClasses(primaryTreeRoot());
+ primaryTree()->resolvePropertyOverriddenFromPtrs(primaryTreeRoot());
primaryTreeRoot()->resolveQmlInheritance();
//primaryTree()->resolveTargets(primaryTreeRoot());
primaryTree()->resolveCppToQmlLinks();
@@ -1141,11 +1143,21 @@ void QDocDatabase::resolveStuff() {
if (Generator::generating()) {
resolveNamespaces();
resolveProxies();
+ resolveBaseClasses();
}
if (Generator::dualExec())
QDocIndexFiles::destroyQDocIndexFiles();
}
+void QDocDatabase::resolveBaseClasses()
+{
+ Tree *t = forest_.firstTree();
+ while (t) {
+ t->resolveBaseClasses(t->root());
+ t = forest_.nextTree();
+ }
+}
+
/*!
Returns a reference to the namespace map. Constructs the
namespace map if it hasn't been constructed yet.
@@ -1169,15 +1181,15 @@ void QDocDatabase::resolveNamespaces()
if (!namespaceIndex_.isEmpty())
return;
NodeMultiMap namespaceMultimap;
- Tree* t = forest_.firstTree();
+ Tree *t = forest_.firstTree();
while (t) {
t->root()->findAllNamespaces(namespaceMultimap);
t = forest_.nextTree();
}
QList<QString> keys = namespaceMultimap.uniqueKeys();
foreach (const QString &s, keys) {
- NamespaceNode* ns = nullptr;
- NamespaceNode* somewhere = nullptr;
+ NamespaceNode *ns = nullptr;
+ NamespaceNode *somewhere = nullptr;
NodeList namespaces = namespaceMultimap.values(s);
int count = namespaceMultimap.remove(s);
if (count > 0) {
@@ -1191,7 +1203,7 @@ void QDocDatabase::resolveNamespaces()
}
if (ns) {
foreach (Node *n, namespaces) {
- NamespaceNode* NS = static_cast<NamespaceNode*>(n);
+ NamespaceNode *NS = static_cast<NamespaceNode*>(n);
if (NS->hadDoc() && NS != ns) {
ns->doc().location().warning(tr("Namespace %1 documented more than once")
.arg(NS->name()));
@@ -1201,13 +1213,13 @@ void QDocDatabase::resolveNamespaces()
} else if (somewhere == nullptr) {
foreach (Node *n, namespaces) {
- NamespaceNode* NS = static_cast<NamespaceNode*>(n);
+ NamespaceNode *NS = static_cast<NamespaceNode*>(n);
NS->reportDocumentedChildrenInUndocumentedNamespace();
}
}
if (somewhere) {
foreach (Node *n, namespaces) {
- NamespaceNode* NS = static_cast<NamespaceNode*>(n);
+ NamespaceNode *NS = static_cast<NamespaceNode*>(n);
if (NS != somewhere)
NS->setDocNode(somewhere);
}
@@ -1223,7 +1235,7 @@ void QDocDatabase::resolveNamespaces()
*/
if (ns && count > 1) {
foreach (Node *n, namespaces) {
- NamespaceNode* NS = static_cast<NamespaceNode*>(n);
+ NamespaceNode *NS = static_cast<NamespaceNode*>(n);
if (NS != ns) {
NodeList::ConstIterator c = NS->constBegin();
while (c != NS->constEnd()) {
@@ -1315,7 +1327,7 @@ const FunctionNode *QDocDatabase::findFunctionNode(const QString &target,
When searching the index trees, the search begins at the
root.
*/
-const Node* QDocDatabase::findTypeNode(const QString& type, const Node* relative, Node::Genus genus)
+const Node *QDocDatabase::findTypeNode(const QString &type, const Node *relative, Node::Genus genus)
{
QStringList path = type.split("::");
if ((path.size() == 1) && (path.at(0)[0].isLower() || path.at(0) == QString("T"))) {
@@ -1332,9 +1344,9 @@ const Node* QDocDatabase::findTypeNode(const QString& type, const Node* relative
Can this be improved by using the target map in Tree?
*/
-const Node* QDocDatabase::findNodeForTarget(const QString& target, const Node* relative)
+const Node *QDocDatabase::findNodeForTarget(const QString &target, const Node *relative)
{
- const Node* node = nullptr;
+ const Node *node = nullptr;
if (target.isEmpty())
node = relative;
else if (target.endsWith(".html"))
@@ -1342,8 +1354,8 @@ const Node* QDocDatabase::findNodeForTarget(const QString& target, const Node* r
else {
QStringList path = target.split("::");
int flags = SearchBaseClasses | SearchEnumValues;
- foreach (Tree* t, searchOrder()) {
- const Node* n = t->findNode(path, relative, flags, Node::DontCare);
+ foreach (Tree *t, searchOrder()) {
+ const Node *n = t->findNode(path, relative, flags, Node::DontCare);
if (n)
return n;
relative = nullptr;
@@ -1356,7 +1368,7 @@ const Node* QDocDatabase::findNodeForTarget(const QString& target, const Node* r
/*!
Generates a tag file and writes it to \a name.
*/
-void QDocDatabase::generateTagFile(const QString& name, Generator* g)
+void QDocDatabase::generateTagFile(const QString &name, Generator *g)
{
if (!name.isEmpty()) {
QDocTagFiles::qdocTagFiles()->generateTagFile(name, g);
@@ -1367,10 +1379,10 @@ void QDocDatabase::generateTagFile(const QString& name, Generator* g)
/*!
Reads and parses the qdoc index files listed in \a t.
*/
-void QDocDatabase::readIndexes(const QStringList& t)
+void QDocDatabase::readIndexes(const QStringList &t)
{
QStringList indexFiles;
- foreach (const QString& f, t) {
+ foreach (const QString &f, t) {
QString fn = f.mid(f.lastIndexOf(QChar('/'))+1);
if (!isLoaded(fn))
indexFiles << f;
@@ -1403,13 +1415,13 @@ void QDocDatabase::generateIndex(const QString &fileName, const QString &url, co
This function only searches in the current primary tree.
*/
-Node* QDocDatabase::findNodeInOpenNamespace(QStringList& path, bool (Node::*isMatch) () const)
+Node *QDocDatabase::findNodeInOpenNamespace(QStringList &path, bool (Node::*isMatch) () const)
{
if (path.isEmpty())
return nullptr;
- Node* n = nullptr;
+ Node *n = nullptr;
if (!openNamespaces_.isEmpty()) {
- foreach (const QString& t, openNamespaces_) {
+ foreach (const QString &t, openNamespaces_) {
QStringList p;
if (t != path[0])
p = t.split("::") + path;
@@ -1430,12 +1442,12 @@ Node* QDocDatabase::findNodeInOpenNamespace(QStringList& path, bool (Node::*isMa
and merges them into the collection node map \a cnm. Nodes
that match the \a relative node are not included.
*/
-void QDocDatabase::mergeCollections(Node::NodeType type, CNMap& cnm, const Node* relative)
+void QDocDatabase::mergeCollections(Node::NodeType type, CNMap &cnm, const Node *relative)
{
cnm.clear();
CNMultiMap cnmm;
- foreach (Tree* t, searchOrder()) {
- CNMap* m = t->getCollectionMap(type);
+ foreach (Tree *t, searchOrder()) {
+ CNMap *m = t->getCollectionMap(type);
if (m && !m->isEmpty()) {
CNMap::const_iterator i = m->cbegin();
while (i != m->cend()) {
@@ -1451,8 +1463,8 @@ void QDocDatabase::mergeCollections(Node::NodeType type, CNMap& cnm, const Node*
QStringList keys = cnmm.uniqueKeys();
foreach (const QString &key, keys) {
QList<CollectionNode*> values = cnmm.values(key);
- CollectionNode* n = nullptr;
- foreach (CollectionNode* v, values) {
+ CollectionNode *n = nullptr;
+ foreach (CollectionNode *v, values) {
if (v && v->wasSeen() && (v != relative)) {
n = v;
break;
@@ -1460,7 +1472,7 @@ void QDocDatabase::mergeCollections(Node::NodeType type, CNMap& cnm, const Node*
}
if (n) {
if (values.size() > 1) {
- foreach (CollectionNode* v, values) {
+ foreach (CollectionNode *v, values) {
if (v != n) {
// Allow multiple (major) versions of QML/JS modules
if ((n->isQmlModule() || n->isJsModule()) &&
@@ -1469,7 +1481,7 @@ void QDocDatabase::mergeCollections(Node::NodeType type, CNMap& cnm, const Node*
cnm.insert(v->fullTitle().toLower(), v);
continue;
}
- foreach (Node* t, v->members())
+ foreach (Node *t, v->members())
n->addMember(t);
}
}
@@ -1494,15 +1506,15 @@ void QDocDatabase::mergeCollections(Node::NodeType type, CNMap& cnm, const Node*
module identifiers are merged to avoid merging
modules with different (major) versions.
*/
-void QDocDatabase::mergeCollections(CollectionNode* c)
+void QDocDatabase::mergeCollections(CollectionNode *c)
{
- foreach (Tree* t, searchOrder()) {
- CollectionNode* cn = t->getCollection(c->name(), c->nodeType());
+ foreach (Tree *t, searchOrder()) {
+ CollectionNode *cn = t->getCollection(c->name(), c->nodeType());
if (cn && cn != c) {
if ((cn->isQmlModule() || cn->isJsModule()) &&
cn->logicalModuleIdentifier() != c->logicalModuleIdentifier())
continue;
- foreach (Node* n, cn->members())
+ foreach (Node *n, cn->members())
c->addMember(n);
}
}
@@ -1517,15 +1529,15 @@ void QDocDatabase::mergeCollections(CollectionNode* c)
\a ref. If the returned node pointer is null, \a ref is not
valid.
*/
-const Node* QDocDatabase::findNodeForAtom(const Atom* a, const Node* relative, QString& ref)
+const Node *QDocDatabase::findNodeForAtom(const Atom *a, const Node *relative, QString &ref)
{
- const Node* node = nullptr;
+ const Node *node = nullptr;
- Atom* atom = const_cast<Atom*>(a);
+ Atom *atom = const_cast<Atom*>(a);
QStringList targetPath = atom->string().split(QLatin1Char('#'));
QString first = targetPath.first().trimmed();
- Tree* domain = nullptr;
+ Tree *domain = nullptr;
Node::Genus genus = Node::DontCare;
// Reserved for future use
//Node::NodeType goal = Node::NoType;
diff --git a/src/qdoc/qdocdatabase.h b/src/qdoc/qdocdatabase.h
index c04918c69..d7db6b7e5 100644
--- a/src/qdoc/qdocdatabase.h
+++ b/src/qdoc/qdocdatabase.h
@@ -399,6 +399,7 @@ class QDocDatabase
QStringList keys() { return forest_.keys(); }
void resolveNamespaces();
void resolveProxies();
+ void resolveBaseClasses();
private:
friend class Tree;
diff --git a/src/qdoc/qdocindexfiles.cpp b/src/qdoc/qdocindexfiles.cpp
index efd9adefd..b9347c108 100644
--- a/src/qdoc/qdocindexfiles.cpp
+++ b/src/qdoc/qdocindexfiles.cpp
@@ -690,7 +690,8 @@ void QDocIndexFiles::resolveIndex()
{
QPair<ClassNode*,QString> pair;
foreach (pair, basesList_) {
- foreach (const QString& base, pair.second.split(QLatin1Char(','))) {
+ QStringList bases = pair.second.split(QLatin1Char(','));
+ foreach (const QString& base, bases) {
QStringList basePath = base.split(QString("::"));
Node* n = qdb_->findClassNode(basePath);
if (n)
diff --git a/src/qdoc/tree.cpp b/src/qdoc/tree.cpp
index 52ae4ca49..373080163 100644
--- a/src/qdoc/tree.cpp
+++ b/src/qdoc/tree.cpp
@@ -64,7 +64,7 @@ QT_BEGIN_NAMESPACE
which was obtained from the qdocconf file via the Config
singleton.
*/
-Tree::Tree(const QString& camelCaseModuleName, QDocDatabase* qdb)
+Tree::Tree(const QString &camelCaseModuleName, QDocDatabase *qdb)
: treeHasBeenAnalyzed_(false),
docsHaveBeenGenerated_(false),
linkCount_(0),
@@ -107,9 +107,9 @@ Tree::~Tree()
if (Generator::writeQaPages() && targetListMap_) {
TargetListMap::iterator i = targetListMap_->begin();
while (i != targetListMap_->end()) {
- TargetList* tlist = i.value();
+ TargetList *tlist = i.value();
if (tlist) {
- foreach (TargetLoc* tloc, *tlist)
+ foreach (TargetLoc *tloc, *tlist)
delete tloc;
}
delete tlist;
@@ -126,9 +126,9 @@ Tree::~Tree()
findNamespaceNode() with the same parameters. The result
is returned.
*/
-Node* Tree::findNodeForInclude(const QStringList& path) const
+Node *Tree::findNodeForInclude(const QStringList &path) const
{
- Node* n = findClassNode(path);
+ Node *n = findClassNode(path);
if (n == nullptr)
n = findNamespaceNode(path);
return n;
@@ -154,7 +154,7 @@ Aggregate *Tree::findAggregate(const QString &name)
at the root of the tree. Only a C++ class node named \a path is
acceptible. If one is not found, 0 is returned.
*/
-ClassNode* Tree::findClassNode(const QStringList& path, const Node* start) const
+ClassNode *Tree::findClassNode(const QStringList &path, const Node *start) const
{
if (start == nullptr)
start = const_cast<NamespaceNode*>(root());
@@ -166,9 +166,9 @@ ClassNode* Tree::findClassNode(const QStringList& path, const Node* start) const
the root of the tree. Only a Namespace node named \a path
is acceptible. If one is not found, 0 is returned.
*/
-NamespaceNode* Tree::findNamespaceNode(const QStringList& path) const
+NamespaceNode *Tree::findNamespaceNode(const QStringList &path) const
{
- Node* start = const_cast<NamespaceNode*>(root());
+ Node *start = const_cast<NamespaceNode*>(root());
return static_cast<NamespaceNode*>(findNodeRecursive(path, 0, start, &Node::isNamespace));
}
@@ -178,7 +178,7 @@ NamespaceNode* Tree::findNamespaceNode(const QStringList& path) const
at the root of the tree. Only a Qml type node named <\a path is
acceptible. If one is not found, 0 is returned.
*/
-QmlTypeNode* Tree::findQmlTypeNode(const QStringList& path)
+QmlTypeNode *Tree::findQmlTypeNode(const QStringList &path)
{
/*
If the path contains one or two double colons ("::"),
@@ -189,7 +189,7 @@ QmlTypeNode* Tree::findQmlTypeNode(const QStringList& path)
class node.
*/
if (path.size() >= 2 && !path[0].isEmpty()) {
- QmlTypeNode* qcn = qdb_->findQmlType(path[0], path[1]);
+ QmlTypeNode *qcn = qdb_->findQmlType(path[0], path[1]);
if (qcn != nullptr)
return qcn;
}
@@ -210,7 +210,7 @@ QmlTypeNode* Tree::findQmlTypeNode(const QStringList& path)
*/
Aggregate *Tree::findRelatesNode(const QStringList &path)
{
- Node* n = findNodeRecursive(path, 0, root(), &Node::isRelatableType);
+ Node *n = findNodeRecursive(path, 0, root(), &Node::isRelatableType);
return (((n != nullptr) && n->isAggregate()) ? static_cast<Aggregate*>(n) : nullptr);
}
@@ -218,8 +218,8 @@ Aggregate *Tree::findRelatesNode(const QStringList &path)
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,
+void Tree::addPropertyFunction(PropertyNode *property,
+ const QString &funcName,
PropertyNode::FunctionRole funcRole)
{
unresolvedPropertyMap[property].insert(funcRole, funcName);
@@ -229,83 +229,73 @@ void Tree::addPropertyFunction(PropertyNode* property,
This function resolves C++ inheritance and reimplementation
settings for each C++ class node found in the tree beginning
at \a n. It also calls itself recursively for each C++ class
- node or namespace node it encounters. For each child of \a n
- that is a class node, it calls resolveInheritanceHelper().
+ node or namespace node it encounters.
This function does not resolve QML inheritance.
*/
-void Tree::resolveInheritance(Aggregate* n)
+void Tree::resolveBaseClasses(Aggregate *n)
{
- for (int pass = 0; pass < 2; pass++) {
- NodeList::ConstIterator c = n->constBegin();
- while (c != n->constEnd()) {
- if ((*c)->isClassNode()) {
- resolveInheritanceHelper(pass, static_cast<ClassNode*>(*c));
- resolveInheritance(static_cast<ClassNode*>(*c));
- } else if ((*c)->isNamespace()) {
- resolveInheritance(static_cast<NamespaceNode*>(*c));
+ NodeList::ConstIterator c = n->constBegin();
+ while (c != n->constEnd()) {
+ if ((*c)->isClassNode()) {
+ ClassNode *cn = static_cast<ClassNode*>(*c);
+ QList<RelatedClass> &bases = cn->baseClasses();
+ QList<RelatedClass>::iterator b = bases.begin();
+ while (b != bases.end()) {
+ if ((*b).node_ == nullptr) {
+ Node *n = qdb_->findClassNode((*b).path_);
+ /*
+ If the node for the base class was not found,
+ the reason might be that the subclass is in a
+ namespace and the base class is in the same
+ namespace, but the base class name was not
+ qualified with the namespace name. That is the
+ case most of the time. Then restart the search
+ at the parent of the subclass node (the namespace
+ node) using the unqualified base class name.
+ */
+ if (n == nullptr) {
+ Aggregate *parent = cn->parent();
+ if (parent != nullptr)
+ // Exclude the root namespace
+ if (parent->isNamespace() && !parent->name().isEmpty())
+ n = findClassNode((*b).path_, parent);
+ }
+ if (n != nullptr) {
+ ClassNode *bcn = static_cast<ClassNode*>(n);
+ (*b).node_ = bcn;
+ bcn->addDerivedClass((*b).access_, cn);
+ }
+ }
+ ++b;
}
- ++c;
+ resolveBaseClasses(cn);
+ } else if ((*c)->isNamespace()) {
+ resolveBaseClasses(static_cast<NamespaceNode*>(*c));
}
+ ++c;
}
}
/*!
- This function is run twice for eachclass node \a cn in the
- tree. First it is run with \a pass set to 0 for each
- class node \a cn. Then it is run with \a pass set to 1 for
- eachclass node \a cn.
-
- In \a pass 0, all the base classes ofclass node \a cn are
- found and added to the base class list forclass node \a cn.
-
- In \a pass 1, each child ofclass node \a cn that is a function
- that is reimplemented from one of the base classes is marked
- as being reimplemented from that class.
-
- Some property node fixing up is also done in \a pass 1.
*/
-void Tree::resolveInheritanceHelper(int pass, ClassNode* cn)
+void Tree::resolvePropertyOverriddenFromPtrs(Aggregate *n)
{
- if (pass == 0) {
- QList<RelatedClass>& bases = cn->baseClasses();
- QList<RelatedClass>::iterator b = bases.begin();
- while (b != bases.end()) {
- if ((*b).node_ == nullptr) {
- Node* n = qdb_->findClassNode((*b).path_);
- /*
- If the node for the base class was not found,
- the reason might be that the subclass is in a
- namespace and the base class is in the same
- namespace, but the base class name was not
- qualified with the namespace name. That is the
- case most of the time. Then restart the search
- at the parent of the subclass node (the namespace
- node) using the unqualified base class name.
- */
- if (n == nullptr) {
- Aggregate* parent = cn->parent();
- if (parent != nullptr)
- // Exclude the root namespace
- if (parent->isNamespace() && !parent->name().isEmpty())
- n = findClassNode((*b).path_, parent);
- }
- if (n != nullptr) {
- ClassNode* bcn = static_cast<ClassNode*>(n);
- (*b).node_ = bcn;
- bcn->addDerivedClass((*b).access_, cn);
- }
+ NodeList::ConstIterator c = n->constBegin();
+ while (c != n->constEnd()) {
+ if ((*c)->isClassNode()) {
+ ClassNode *cn = static_cast<ClassNode*>(*c);
+ NodeList::ConstIterator p = cn->constBegin();
+ while (p != cn->constEnd()) {
+ if ((*p)->isProperty())
+ cn->resolvePropertyOverriddenFromPtrs(static_cast<PropertyNode*>(*p));
+ ++p;
}
- ++b;
- }
- }
- else {
- NodeList::ConstIterator c = cn->constBegin();
- while (c != cn->constEnd()) {
- if ((*c)->isProperty())
- cn->fixPropertyUsingBaseClasses(static_cast<PropertyNode*>(*c));
- ++c;
+ resolvePropertyOverriddenFromPtrs(cn);
+ } else if ((*c)->isNamespace()) {
+ resolvePropertyOverriddenFromPtrs(static_cast<NamespaceNode*>(*c));
}
+ ++c;
}
}
@@ -317,8 +307,8 @@ void Tree::resolveProperties()
propEntry = unresolvedPropertyMap.constBegin();
while (propEntry != unresolvedPropertyMap.constEnd()) {
- PropertyNode* property = propEntry.key();
- Aggregate* parent = property->parent();
+ PropertyNode *property = propEntry.key();
+ Aggregate *parent = property->parent();
QString getterName = (*propEntry)[PropertyNode::Getter];
QString setterName = (*propEntry)[PropertyNode::Setter];
QString resetterName = (*propEntry)[PropertyNode::Resetter];
@@ -327,7 +317,7 @@ void Tree::resolveProperties()
NodeList::ConstIterator c = parent->constBegin();
while (c != parent->constEnd()) {
if ((*c)->isFunction()) {
- FunctionNode* function = static_cast<FunctionNode*>(*c);
+ FunctionNode *function = static_cast<FunctionNode*>(*c);
if (function->access() == property->access() &&
(function->status() == property->status() ||
function->doc().isEmpty())) {
@@ -352,7 +342,7 @@ void Tree::resolveProperties()
propEntry = unresolvedPropertyMap.constBegin();
while (propEntry != unresolvedPropertyMap.constEnd()) {
- PropertyNode* property = propEntry.key();
+ PropertyNode *property = propEntry.key();
// redo it to set the property functions
if (property->overriddenFrom())
property->setOverriddenFrom(property->overriddenFrom());
@@ -373,8 +363,8 @@ void Tree::resolveCppToQmlLinks()
const NodeList &children = root_.childNodes();
foreach (Node *child, children) {
if (child->isQmlType() || child->isJsType()) {
- QmlTypeNode* qcn = static_cast<QmlTypeNode*>(child);
- ClassNode* cn = const_cast<ClassNode*>(qcn->classNode());
+ QmlTypeNode *qcn = static_cast<QmlTypeNode*>(child);
+ ClassNode *cn = const_cast<ClassNode*>(qcn->classNode());
if (cn)
cn->setQmlElement(qcn);
}
@@ -388,14 +378,14 @@ void Tree::resolveCppToQmlLinks()
void Tree::resolveUsingClauses()
{
const NodeList &children = root_.childNodes();
- foreach (Node* child, children) {
+ foreach (Node *child, children) {
if (child->isClassNode()) {
- ClassNode* cn = static_cast<ClassNode*>(child);
- QList<UsingClause>& usingClauses = cn->usingClauses();
+ ClassNode *cn = static_cast<ClassNode*>(child);
+ QList<UsingClause> &usingClauses = cn->usingClauses();
QList<UsingClause>::iterator uc = usingClauses.begin();
while (uc != usingClauses.end()) {
if ((*uc).node() == nullptr) {
- const Node* n = qdb_->findFunctionNode((*uc).signature(), cn, Node::CPP);
+ const Node *n = qdb_->findFunctionNode((*uc).signature(), cn, Node::CPP);
if (n != nullptr)
(*uc).setNode(n);
}
@@ -406,8 +396,15 @@ void Tree::resolveUsingClauses()
}
/*!
+ Traverse this Tree and for each ClassNode found, remove
+ from its list of base classes any that are marked private
+ or internal. When a class is removed from a base class
+ list, promote its public pase classes to be base classes
+ of the class where the base class was removed. This is
+ done for documentation purposes. The function is recursive
+ on namespace nodes.
*/
-void Tree::fixInheritance(NamespaceNode* rootNode)
+void Tree::removePrivateAndInternalBases(NamespaceNode *rootNode)
{
if (rootNode == nullptr)
rootNode = root();
@@ -415,9 +412,9 @@ void Tree::fixInheritance(NamespaceNode* rootNode)
NodeList::ConstIterator c = rootNode->constBegin();
while (c != rootNode->constEnd()) {
if ((*c)->isClassNode())
- static_cast<ClassNode*>(*c)->fixBaseClasses();
+ static_cast<ClassNode*>(*c)->removePrivateAndInternalBases();
else if ((*c)->isNamespace())
- fixInheritance(static_cast<NamespaceNode*>(*c));
+ removePrivateAndInternalBases(static_cast<NamespaceNode*>(*c));
++c;
}
}
@@ -427,7 +424,7 @@ void Tree::fixInheritance(NamespaceNode* rootNode)
ClassList Tree::allBaseClasses(const ClassNode *classNode) const
{
ClassList result;
- foreach (const RelatedClass& r, classNode->baseClasses()) {
+ foreach (const RelatedClass &r, classNode->baseClasses()) {
if (r.node_ != nullptr) {
result += r.node_;
result += allBaseClasses(r.node_);
@@ -443,7 +440,7 @@ ClassList Tree::allBaseClasses(const ClassNode *classNode) const
search at the tree root. \a subtype is not used unless
\a type is \c{Page}.
*/
-Node* Tree::findNodeByNameAndType(const QStringList& path, bool (Node::*isMatch) () const) const
+Node *Tree::findNodeByNameAndType(const QStringList &path, bool (Node::*isMatch) () const) const
{
return findNodeRecursive(path, 0, root(), isMatch);
}
@@ -464,23 +461,23 @@ Node* Tree::findNodeByNameAndType(const QStringList& path, bool (Node::*isMatch)
If the algorithm is successful, the pointer to the final
node is returned. Otherwise 0 is returned.
*/
-Node* Tree::findNodeRecursive(const QStringList& path,
+Node *Tree::findNodeRecursive(const QStringList &path,
int pathIndex,
- const Node* start,
+ const Node *start,
bool (Node::*isMatch) () const) const
{
if (start == nullptr || path.isEmpty())
return nullptr;
- Node* node = const_cast<Node*>(start);
+ Node *node = const_cast<Node*>(start);
if (!node->isAggregate())
return ((pathIndex >= path.size()) ? node : nullptr);
#if 0
if (pathIndex >= path.size())
return nullptr;
#endif
- Aggregate* current = static_cast<Aggregate*>(node);
- const NodeList& children = current->childNodes();
- const QString& name = path.at(pathIndex);
+ Aggregate *current = static_cast<Aggregate*>(node);
+ const NodeList &children = current->childNodes();
+ const QString &name = path.at(pathIndex);
foreach (Node *n, children) {
if (n == nullptr)
continue;
@@ -513,14 +510,14 @@ Node* Tree::findNodeRecursive(const QStringList& path,
If a matching node is found, \a ref is an output parameter that
is set to the HTML reference to use for the link.
*/
-const Node* Tree::findNodeForTarget(const QStringList& path,
- const QString& target,
- const Node* start,
+const Node *Tree::findNodeForTarget(const QStringList &path,
+ const QString &target,
+ const Node *start,
int flags,
Node::Genus genus,
- QString& ref) const
+ QString &ref) const
{
- const Node* node = nullptr;
+ const Node *node = nullptr;
if ((genus == Node::DontCare) || (genus == Node::DOC)) {
node = findPageNodeByTitle(path.at(0));
if (node) {
@@ -545,7 +542,7 @@ const Node* Tree::findNodeForTarget(const QStringList& path,
return node;
}
- const Node* current = start;
+ const Node *current = start;
if (current == nullptr)
current = root();
@@ -560,7 +557,7 @@ const Node* Tree::findNodeForTarget(const QStringList& path,
int path_idx = 0;
if (((genus == Node::QML) || (genus == Node::DontCare)) &&
(path.size() >= 2) && !path[0].isEmpty()) {
- QmlTypeNode* qcn = lookupQmlType(QString(path[0] + "::" + path[1]));
+ QmlTypeNode *qcn = lookupQmlType(QString(path[0] + "::" + path[1]));
if (qcn) {
current = qcn;
if (path.size() == 2) {
@@ -579,7 +576,7 @@ const Node* Tree::findNodeForTarget(const QStringList& path,
while (current != nullptr) {
if (current->isAggregate()) { // Should this be isPageNode() ???
- const Node* node = matchPathAndTarget(path, path_idx, target, current, flags, genus, ref);
+ const Node *node = matchPathAndTarget(path, path_idx, target, current, flags, genus, ref);
if (node)
return node;
}
@@ -609,13 +606,13 @@ const Node* Tree::findNodeForTarget(const QStringList& path,
\a path is a not a fully-qualified name. \a node is
most often the root of this Tree.
*/
-const Node* Tree::matchPathAndTarget(const QStringList& path,
+const Node *Tree::matchPathAndTarget(const QStringList &path,
int idx,
- const QString& target,
- const Node* node,
+ const QString &target,
+ const Node *node,
int flags,
Node::Genus genus,
- QString& ref) const
+ QString &ref) const
{
/*
If the path has been matched, then if there is a target,
@@ -677,17 +674,17 @@ const Node* Tree::matchPathAndTarget(const QStringList& path,
recursively if no match is found. The \a flags are used to
restrict the search.
*/
-const Node* Tree::findNode(const QStringList& path,
- const Node* start,
+const Node *Tree::findNode(const QStringList &path,
+ const Node *start,
int flags,
Node::Genus genus) const
{
- const Node* current = start;
+ const Node *current = start;
if (current == nullptr)
current = root();
do {
- const Node* node = current;
+ const Node *node = current;
int i;
int start_idx = 0;
@@ -701,7 +698,7 @@ const Node* Tree::findNode(const QStringList& path,
*/
if (((genus == Node::QML) || (genus == Node::DontCare)) &&
(path.size() >= 2) && !path[0].isEmpty()) {
- QmlTypeNode* qcn = lookupQmlType(QString(path[0] + "::" + path[1]));
+ QmlTypeNode *qcn = lookupQmlType(QString(path[0] + "::" + path[1]));
if (qcn != nullptr) {
node = qcn;
if (path.size() == 2)
@@ -718,7 +715,7 @@ const Node* Tree::findNode(const QStringList& path,
// We also ignore module nodes as they are not aggregates and thus have no children.
int tmpFlags = (i < path.size() - 1) ? (flags & ~TypesOnly) | IgnoreModules : flags;
- const Node* next = static_cast<const Aggregate*>(node)->findChildNode(path.at(i), genus, tmpFlags);
+ const Node *next = static_cast<const Aggregate*>(node)->findChildNode(path.at(i), genus, tmpFlags);
if ((next == nullptr) && (flags & SearchEnumValues) && i == path.size()-1) {
next = static_cast<const Aggregate*>(node)->findEnumNodeForValue(path.at(i));
}
@@ -749,7 +746,7 @@ const Node* Tree::findNode(const QStringList& path,
it returns the ref from that node. Otherwise it returns an
empty string.
*/
-QString Tree::getRef(const QString& target, const Node* node) const
+QString Tree::getRef(const QString &target, const Node *node) const
{
TargetMap::const_iterator i = nodesByTargetTitle_.constFind(target);
if (i != nodesByTargetTitle_.constEnd()) {
@@ -777,24 +774,24 @@ QString Tree::getRef(const QString& target, const Node* node) const
the \a node, the \a priority. and a canonicalized form of
the \a name, which is later used.
*/
-void Tree::insertTarget(const QString& name,
- const QString& title,
+void Tree::insertTarget(const QString &name,
+ const QString &title,
TargetRec::TargetType type,
- Node* node,
+ Node *node,
int priority)
{
- TargetRec* target = new TargetRec(name, title, type, node, priority);
+ TargetRec *target = new TargetRec(name, title, type, node, priority);
nodesByTargetRef_.insert(name, target);
nodesByTargetTitle_.insert(title, target);
}
/*!
*/
-void Tree::resolveTargets(Aggregate* root)
+void Tree::resolveTargets(Aggregate *root)
{
- foreach (Node* child, root->childNodes()) {
+ foreach (Node *child, root->childNodes()) {
if (child->isTextPageNode()) {
- PageNode* node = static_cast<PageNode*>(child);
+ PageNode *node = static_cast<PageNode*>(child);
QString key = node->title();
if (!key.isEmpty()) {
if (key.contains(QChar(' ')))
@@ -817,38 +814,38 @@ void Tree::resolveTargets(Aggregate* root)
}
if (child->doc().hasTableOfContents()) {
- const QList<Atom*>& toc = child->doc().tableOfContents();
+ const QList<Atom*> &toc = child->doc().tableOfContents();
for (int i = 0; i < toc.size(); ++i) {
QString ref = refForAtom(toc.at(i));
QString title = Text::sectionHeading(toc.at(i)).toString();
if (!ref.isEmpty() && !title.isEmpty()) {
QString key = Doc::canonicalTitle(title);
- TargetRec* target = new TargetRec(ref, title, TargetRec::Contents, child, 3);
+ TargetRec *target = new TargetRec(ref, title, TargetRec::Contents, child, 3);
nodesByTargetRef_.insert(key, target);
nodesByTargetTitle_.insert(title, target);
}
}
}
if (child->doc().hasKeywords()) {
- const QList<Atom*>& keywords = child->doc().keywords();
+ const QList<Atom*> &keywords = child->doc().keywords();
for (int i = 0; i < keywords.size(); ++i) {
QString ref = refForAtom(keywords.at(i));
QString title = keywords.at(i)->string();
if (!ref.isEmpty() && !title.isEmpty()) {
- TargetRec* target = new TargetRec(ref, title, TargetRec::Keyword, child, 1);
+ TargetRec *target = new TargetRec(ref, title, TargetRec::Keyword, child, 1);
nodesByTargetRef_.insert(Doc::canonicalTitle(title), target);
nodesByTargetTitle_.insert(title, target);
}
}
}
if (child->doc().hasTargets()) {
- const QList<Atom*>& targets = child->doc().targets();
+ const QList<Atom*> &targets = child->doc().targets();
for (int i = 0; i < targets.size(); ++i) {
QString ref = refForAtom(targets.at(i));
QString title = targets.at(i)->string();
if (!ref.isEmpty() && !title.isEmpty()) {
QString key = Doc::canonicalTitle(title);
- TargetRec* target = new TargetRec(ref, title, TargetRec::Target, child, 2);
+ TargetRec *target = new TargetRec(ref, title, TargetRec::Target, child, 2);
nodesByTargetRef_.insert(key, target);
nodesByTargetTitle_.insert(title, target);
}
@@ -864,10 +861,10 @@ void Tree::resolveTargets(Aggregate* root)
finds one, it sets \a ref and returns the found node.
*/
const Node*
-Tree::findUnambiguousTarget(const QString& target, Node::Genus genus, QString& ref) const
+Tree::findUnambiguousTarget(const QString &target, Node::Genus genus, QString &ref) const
{
int numBestTargets = 0;
- TargetRec* bestTarget = nullptr;
+ TargetRec *bestTarget = nullptr;
QList<TargetRec*> bestTargetList;
QString key = target;
@@ -875,7 +872,7 @@ Tree::findUnambiguousTarget(const QString& target, Node::Genus genus, QString& r
while (i != nodesByTargetTitle_.constEnd()) {
if (i.key() != key)
break;
- TargetRec* candidate = i.value();
+ TargetRec *candidate = i.value();
if ((genus == Node::DontCare) || (genus == candidate->genus())) {
if (!bestTarget || (candidate->priority_ < bestTarget->priority_)) {
bestTarget = candidate;
@@ -902,7 +899,7 @@ Tree::findUnambiguousTarget(const QString& target, Node::Genus genus, QString& r
while (i != nodesByTargetRef_.constEnd()) {
if (i.key() != key)
break;
- TargetRec* candidate = i.value();
+ TargetRec *candidate = i.value();
if ((genus == Node::DontCare) || (genus == candidate->genus())) {
if (!bestTarget || (candidate->priority_ < bestTarget->priority_)) {
bestTarget = candidate;
@@ -929,7 +926,7 @@ Tree::findUnambiguousTarget(const QString& target, Node::Genus genus, QString& r
/*!
This function searches for a node with the specified \a title.
*/
-const PageNode* Tree::findPageNodeByTitle(const QString& title) const
+const PageNode *Tree::findPageNodeByTitle(const QString &title) const
{
PageNodeMultiMap::const_iterator i;
if (title.contains(QChar(' ')))
@@ -965,7 +962,7 @@ const PageNode* Tree::findPageNodeByTitle(const QString& title) const
Returns a canonical title for the \a atom, if the \a atom
is a SectionLeft or a Target.
*/
-QString Tree::refForAtom(const Atom* atom)
+QString Tree::refForAtom(const Atom *atom)
{
if (atom) {
if (atom->type() == Atom::SectionLeft)
@@ -977,19 +974,19 @@ QString Tree::refForAtom(const Atom* atom)
}
/*!
- \fn const CNMap& Tree::groups() const
+ \fn const CNMap &Tree::groups() const
Returns a const reference to the collection of all
group nodes.
*/
/*!
- \fn const ModuleMap& Tree::modules() const
+ \fn const ModuleMap &Tree::modules() const
Returns a const reference to the collection of all
module nodes.
*/
/*!
- \fn const QmlModuleMap& Tree::qmlModules() const
+ \fn const QmlModuleMap &Tree::qmlModules() const
Returns a const reference to the collection of all
QML module nodes.
*/
@@ -998,7 +995,7 @@ QString Tree::refForAtom(const Atom* atom)
Returns a pointer to the collection map specified by \a type.
Returns null if \a type is not specified.
*/
-CNMap* Tree::getCollectionMap(Node::NodeType type)
+CNMap *Tree::getCollectionMap(Node::NodeType type)
{
switch (type) {
case Node::Group:
@@ -1021,9 +1018,9 @@ CNMap* Tree::getCollectionMap(Node::NodeType type)
to it is returned. If a collection is not found, null is
returned.
*/
-CollectionNode* Tree::getCollection(const QString& name, Node::NodeType type)
+CollectionNode *Tree::getCollection(const QString &name, Node::NodeType type)
{
- CNMap* m = getCollectionMap(type);
+ CNMap *m = getCollectionMap(type);
if (m) {
CNMap::const_iterator i = m->constFind(name);
if (i != m->cend())
@@ -1047,21 +1044,21 @@ CollectionNode* Tree::getCollection(const QString& name, Node::NodeType type)
If it is \c{DontCare}, 0 is returned, which is a programming
error.
*/
-CollectionNode* Tree::findCollection(const QString& name, Node::NodeType type)
+CollectionNode *Tree::findCollection(const QString &name, Node::NodeType type)
{
- CNMap* m = getCollectionMap(type);
+ CNMap *m = getCollectionMap(type);
if (!m) // error
return nullptr;
CNMap::const_iterator i = m->constFind(name);
if (i != m->cend())
return i.value();
- CollectionNode* cn = new CollectionNode(type, root(), name);
+ CollectionNode *cn = new CollectionNode(type, root(), name);
cn->markNotSeen();
m->insert(name, cn);
return cn;
}
-/*! \fn CollectionNode* Tree::findGroup(const QString& name)
+/*! \fn CollectionNode *Tree::findGroup(const QString &name)
Find the group node named \a name and return a pointer
to it. If the group node is not found, add a new group
node named \a name and return a pointer to the new one.
@@ -1070,7 +1067,7 @@ CollectionNode* Tree::findCollection(const QString& name, Node::NodeType type)
and the new group node is marked \e{not seen}.
*/
-/*! \fn CollectionNode* Tree::findModule(const QString& name)
+/*! \fn CollectionNode *Tree::findModule(const QString &name)
Find the module node named \a name and return a pointer
to it. If a matching node is not found, add a new module
node named \a name and return a pointer to that one.
@@ -1079,7 +1076,7 @@ CollectionNode* Tree::findCollection(const QString& name, Node::NodeType type)
and the new module node is marked \e{not seen}.
*/
-/*! \fn CollectionNode* Tree::findQmlModule(const QString& name)
+/*! \fn CollectionNode *Tree::findQmlModule(const QString &name)
Find the QML module node named \a name and return a pointer
to it. If a matching node is not found, add a new QML module
node named \a name and return a pointer to that one.
@@ -1088,7 +1085,7 @@ CollectionNode* Tree::findCollection(const QString& name, Node::NodeType type)
and the new node is marked \e{not seen}.
*/
-/*! \fn CollectionNode* Tree::findJsModule(const QString& name)
+/*! \fn CollectionNode *Tree::findJsModule(const QString &name)
Find the JavaScript module named \a name and return a pointer
to it. If a matching node is not found, add a new JavaScript
module node named \a name and return a pointer to that one.
@@ -1097,7 +1094,7 @@ CollectionNode* Tree::findCollection(const QString& name, Node::NodeType type)
tree root, and the new node is marked \e{not seen}.
*/
-/*! \fn CollectionNode* Tree::addGroup(const QString& name)
+/*! \fn CollectionNode *Tree::addGroup(const QString &name)
Looks up the group node named \a name in the collection
of all group nodes. If a match is found, a pointer to the
node is returned. Otherwise, a new group node named \a name
@@ -1105,7 +1102,7 @@ CollectionNode* Tree::findCollection(const QString& name, Node::NodeType type)
to that node is returned.
*/
-/*! \fn CollectionNode* Tree::addModule(const QString& name)
+/*! \fn CollectionNode *Tree::addModule(const QString &name)
Looks up the module node named \a name in the collection
of all module nodes. If a match is found, a pointer to the
node is returned. Otherwise, a new module node named \a name
@@ -1113,7 +1110,7 @@ CollectionNode* Tree::findCollection(const QString& name, Node::NodeType type)
to that node is returned.
*/
-/*! \fn CollectionNode* Tree::addQmlModule(const QString& name)
+/*! \fn CollectionNode *Tree::addQmlModule(const QString &name)
Looks up the QML module node named \a name in the collection
of all QML module nodes. If a match is found, a pointer to the
node is returned. Otherwise, a new QML module node named \a name
@@ -1121,7 +1118,7 @@ CollectionNode* Tree::findCollection(const QString& name, Node::NodeType type)
to that node is returned.
*/
-/*! \fn CollectionNode* Tree::addJsModule(const QString& name)
+/*! \fn CollectionNode *Tree::addJsModule(const QString &name)
Looks up the JavaScript module node named \a name in the collection
of all JavaScript module nodes. If a match is found, a pointer to the
node is returned. Otherwise, a new JavaScrpt module node named \a name
@@ -1138,9 +1135,9 @@ CollectionNode* Tree::findCollection(const QString& name, Node::NodeType type)
\a node is not changed by this function. Returns a pointer to
the group node.
*/
-CollectionNode* Tree::addToGroup(const QString& name, Node* node)
+CollectionNode *Tree::addToGroup(const QString &name, Node *node)
{
- CollectionNode* cn = findGroup(name);
+ CollectionNode *cn = findGroup(name);
if (!node->isInternal()) {
cn->addMember(node);
node->appendGroupName(name);
@@ -1155,9 +1152,9 @@ CollectionNode* Tree::addToGroup(const QString& name, Node* node)
Then append \a node to the module's members list. The parent of
\a node is not changed by this function. Returns the module node.
*/
-CollectionNode* Tree::addToModule(const QString& name, Node* node)
+CollectionNode *Tree::addToModule(const QString &name, Node *node)
{
- CollectionNode* cn = findModule(name);
+ CollectionNode *cn = findModule(name);
cn->addMember(node);
node->setPhysicalModuleName(name);
return cn;
@@ -1169,7 +1166,7 @@ CollectionNode* Tree::addToModule(const QString& name, Node* node)
list. The parent of \a node is not changed by this function.
Returns the pointer to the QML module node.
*/
-CollectionNode* Tree::addToQmlModule(const QString& name, Node* node)
+CollectionNode *Tree::addToQmlModule(const QString &name, Node *node)
{
QStringList qmid;
QStringList dotSplit;
@@ -1181,11 +1178,11 @@ CollectionNode* Tree::addToQmlModule(const QString& name, Node* node)
qmid.append(blankSplit[0] + dotSplit[0]);
}
- CollectionNode* cn = findQmlModule(blankSplit[0]);
+ CollectionNode *cn = findQmlModule(blankSplit[0]);
cn->addMember(node);
node->setQmlModule(cn);
if (node->isQmlType()) {
- QmlTypeNode* n = static_cast<QmlTypeNode*>(node);
+ QmlTypeNode *n = static_cast<QmlTypeNode*>(node);
for (int i=0; i<qmid.size(); ++i) {
QString key = qmid[i] + "::" + node->name();
insertQmlType(key, n);
@@ -1200,7 +1197,7 @@ CollectionNode* Tree::addToQmlModule(const QString& name, Node* node)
list. The parent of \a node is not changed by this function.
Returns the pointer to the QML module node.
*/
-CollectionNode* Tree::addToJsModule(const QString& name, Node* node)
+CollectionNode *Tree::addToJsModule(const QString &name, Node *node)
{
QStringList qmid;
QStringList dotSplit;
@@ -1212,11 +1209,11 @@ CollectionNode* Tree::addToJsModule(const QString& name, Node* node)
qmid.append(blankSplit[0] + dotSplit[0]);
}
- CollectionNode* cn = findJsModule(blankSplit[0]);
+ CollectionNode *cn = findJsModule(blankSplit[0]);
cn->addMember(node);
node->setQmlModule(cn);
if (node->isJsType()) {
- QmlTypeNode* n = static_cast<QmlTypeNode*>(node);
+ QmlTypeNode *n = static_cast<QmlTypeNode*>(node);
for (int i=0; i<qmid.size(); ++i) {
QString key = qmid[i] + "::" + node->name();
insertQmlType(key, n);
@@ -1229,7 +1226,7 @@ CollectionNode* Tree::addToJsModule(const QString& name, Node* node)
If the QML type map does not contain \a key, insert node
\a n with the specified \a key.
*/
-void Tree::insertQmlType(const QString& key, QmlTypeNode* n)
+void Tree::insertQmlType(const QString &key, QmlTypeNode *n)
{
if (!qmlTypeMap_.contains(key))
qmlTypeMap_.insert(key,n);
@@ -1257,7 +1254,7 @@ const FunctionNode *Tree::findFunctionNode(const QStringList &path,
QmlTypeNode *qcn = lookupQmlType(QString(path[0] + "::" + path[1]));
if (qcn == nullptr) {
QStringList p(path[1]);
- Node* n = findNodeByNameAndType(p, &Node::isQmlType);
+ Node *n = findNodeByNameAndType(p, &Node::isQmlType);
if ((n != nullptr) && (n->isQmlType() || n->isJsType()))
qcn = static_cast<QmlTypeNode*>(n);
}
@@ -1336,15 +1333,15 @@ const FunctionNode *Tree::findFunctionNode(const QStringList &path,
The node \a t
*/
-QString Tree::getNewLinkTarget(const Node* locNode,
- const Node* t,
- const QString& fileName,
- QString& text,
+QString Tree::getNewLinkTarget(const Node *locNode,
+ const Node *t,
+ const QString &fileName,
+ QString &text,
bool broken)
{
QString physicalModuleName;
if (t != nullptr && !broken) {
- Tree* tree = t->tree();
+ Tree *tree = t->tree();
if (tree != this)
tree->incrementLinkCount();
physicalModuleName = tree->physicalModuleName();
@@ -1353,8 +1350,8 @@ QString Tree::getNewLinkTarget(const Node* locNode,
physicalModuleName = "broken";
incrementLinkCount();
QString target = QString("qa-target-%1").arg(-(linkCount()));
- TargetLoc* tloc = new TargetLoc(locNode, target, fileName, text, broken);
- TargetList* tList = nullptr;
+ TargetLoc *tloc = new TargetLoc(locNode, target, fileName, text, broken);
+ TargetList *tList = nullptr;
TargetListMap::iterator i = targetListMap_->find(physicalModuleName);
if (i == targetListMap_->end()) {
tList = new TargetList;
@@ -1370,7 +1367,7 @@ QString Tree::getNewLinkTarget(const Node* locNode,
Look up the target list for the specified \a module
and return a pointer to it.
*/
-TargetList* Tree::getTargetList(const QString& module)
+TargetList *Tree::getTargetList(const QString &module)
{
return targetListMap_->value(module);
}
@@ -1384,7 +1381,7 @@ FunctionNode *Tree::findFunctionNodeForTag(const QString &tag, Aggregate *parent
{
if (parent == nullptr)
parent = root();
- const NodeList& children = parent->childNodes();
+ const NodeList &children = parent->childNodes();
for (Node *n : children) {
if (n != nullptr && n->isFunction() && n->hasTag(tag))
return static_cast<FunctionNode*>(n);
@@ -1434,7 +1431,7 @@ void Tree::addToDontDocumentMap(QString &arg)
QStringList sl = t.split(QChar(' '));
if (sl.isEmpty())
return;
- for (const QString& s : sl) {
+ for (const QString &s : sl) {
if (!dontDocumentMap_.contains(s))
dontDocumentMap_.insert(s, nullptr);
}
@@ -1457,7 +1454,7 @@ void Tree::markDontDocumentNodes()
{
NodeMap::iterator i = dontDocumentMap_.begin();
while (i != dontDocumentMap_.end()) {
- Aggregate* node = findAggregate(i.key());
+ Aggregate *node = findAggregate(i.key());
if (node != nullptr)
node->setStatus(Node::DontDocument);
++i;
diff --git a/src/qdoc/tree.h b/src/qdoc/tree.h
index 2586f5c01..a70d0f5d2 100644
--- a/src/qdoc/tree.h
+++ b/src/qdoc/tree.h
@@ -168,12 +168,13 @@ class Tree
void addPropertyFunction(PropertyNode *property,
const QString &funcName,
PropertyNode::FunctionRole funcRole);
- void resolveInheritance(Aggregate *n);
- void resolveInheritanceHelper(int pass, ClassNode* cn);
+ void resolveBaseClasses(Aggregate *n);
+ void resolveBaseClassesHelper(int pass, ClassNode* cn);
+ void resolvePropertyOverriddenFromPtrs(Aggregate *n);
void resolveProperties();
void resolveCppToQmlLinks();
void resolveUsingClauses();
- void fixInheritance(NamespaceNode *rootNode);
+ void removePrivateAndInternalBases(NamespaceNode *rootNode);
NamespaceNode *root() { return &root_; }
const NamespaceNode *root() const { return &root_; }
diff --git a/src/shared/qtpropertybrowser/qtpropertybrowserutils.cpp b/src/shared/qtpropertybrowser/qtpropertybrowserutils.cpp
index 0840176dc..9602b10d0 100644
--- a/src/shared/qtpropertybrowser/qtpropertybrowserutils.cpp
+++ b/src/shared/qtpropertybrowser/qtpropertybrowserutils.cpp
@@ -214,7 +214,11 @@ QString QtPropertyBrowserUtils::fontValueText(const QFont &f)
QString QtPropertyBrowserUtils::dateFormat()
{
QLocale loc;
- return loc.dateFormat(QLocale::ShortFormat);
+ QString format = loc.dateFormat(QLocale::ShortFormat);
+ // Change dd.MM.yy, MM/dd/yy to 4 digit years
+ if (format.count(QLatin1Char('y')) == 2)
+ format.insert(format.indexOf(QLatin1Char('y')), QLatin1String("yy"));
+ return format;
}
QString QtPropertyBrowserUtils::timeFormat()