summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJerome Pasion <jerome.pasion@digia.com>2014-07-15 13:25:19 +0200
committerJerome Pasion <jerome.pasion@digia.com>2014-07-15 14:13:07 +0200
commit0e4807455a0d9a5c2d72a2534ae069fd609c9e6c (patch)
tree0154858b58d5e860e01aa716cbed39bc9a6d8b9f
parent4aec47b1ebd25ead5775767f3e8d6b2e29fd8630 (diff)
QDoc: Allow QDoc to collect all QML basic types in a map.
-needed if a list of just QML basic types is needed. -adding QML basic types to map of QML types. -generating the list of "qmlbasictypes" also now supported. -part of the fix for QTBUG-32871 Change-Id: Id291982a5684645b2b5e75256be673c1701e60b1 Task-number: QTBUG-32871 Reviewed-by: Martin Smith <martin.smith@digia.com>
-rw-r--r--src/tools/qdoc/htmlgenerator.cpp3
-rw-r--r--src/tools/qdoc/qdocdatabase.cpp18
-rw-r--r--src/tools/qdoc/qdocdatabase.h2
3 files changed, 22 insertions, 1 deletions
diff --git a/src/tools/qdoc/htmlgenerator.cpp b/src/tools/qdoc/htmlgenerator.cpp
index 8e50857258..b534027234 100644
--- a/src/tools/qdoc/htmlgenerator.cpp
+++ b/src/tools/qdoc/htmlgenerator.cpp
@@ -506,6 +506,9 @@ int HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMark
QString rootName = atom->string().mid(atom->string().indexOf("classes") + 7).trimmed();
generateCompactList(Generic, relative, qdb_->getCppClasses(), true, rootName);
}
+ else if (atom->string() == "qmlbasictypes") {
+ generateCompactList(Generic, relative, qdb_->getQmlBasicTypes(), true, QStringLiteral(""));
+ }
else if (atom->string() == "qmltypes") {
generateCompactList(Generic, relative, qdb_->getQmlTypes(), true, QStringLiteral(""));
}
diff --git a/src/tools/qdoc/qdocdatabase.cpp b/src/tools/qdoc/qdocdatabase.cpp
index 8f28e38431..d43fdf4970 100644
--- a/src/tools/qdoc/qdocdatabase.cpp
+++ b/src/tools/qdoc/qdocdatabase.cpp
@@ -908,6 +908,18 @@ NodeMap& QDocDatabase::getServiceClasses()
}
/*!
+ Construct the data structures for QML basic types, if they
+ have not already been constructed. Returns a reference to
+ the map of QML basic types.
+ */
+NodeMap& QDocDatabase::getQmlBasicTypes()
+{
+ if (nonCompatClasses_.isEmpty() && qmlBasicTypes_.isEmpty())
+ processForest(&QDocDatabase::findAllClasses);
+ return qmlBasicTypes_;
+}
+
+/*!
Construct the data structures for obsolete things, if they
have not already been constructed. Returns a reference to
the map of obsolete QML types.
@@ -1000,12 +1012,16 @@ void QDocDatabase::findAllClasses(InnerNode* node)
serviceClasses_.insert(serviceName, *c);
}
}
- else if ((*c)->isQmlType() && !(*c)->doc().isEmpty()) {
+ else if (((*c)->isQmlType() || (*c)->isQmlBasicType())&& !(*c)->doc().isEmpty()) {
QString qmlTypeName = (*c)->name();
if (qmlTypeName.startsWith(QLatin1String("QML:")))
qmlClasses_.insert(qmlTypeName.mid(4),*c);
else
qmlClasses_.insert(qmlTypeName,*c);
+
+ //also add to the QML basic type map
+ if ((*c)->isQmlBasicType())
+ qmlBasicTypes_.insert(qmlTypeName,*c);
}
else if ((*c)->isInnerNode()) {
findAllClasses(static_cast<InnerNode*>(*c));
diff --git a/src/tools/qdoc/qdocdatabase.h b/src/tools/qdoc/qdocdatabase.h
index 7c398a9d51..99d1c46ca2 100644
--- a/src/tools/qdoc/qdocdatabase.h
+++ b/src/tools/qdoc/qdocdatabase.h
@@ -261,6 +261,7 @@ class QDocDatabase
NodeMap& getQmlTypesWithObsoleteMembers();
NodeMap& getNamespaces();
NodeMap& getServiceClasses();
+ NodeMap& getQmlBasicTypes();
NodeMap& getQmlTypes();
NodeMapMap& getFunctionIndex();
TextToNodeMap& getLegaleseTexts();
@@ -401,6 +402,7 @@ class QDocDatabase
NodeMap qmlTypesWithObsoleteMembers_;
NodeMap namespaceIndex_;
NodeMap serviceClasses_;
+ NodeMap qmlBasicTypes_;
NodeMap qmlClasses_;
NodeMapMap newClassMaps_;
NodeMapMap newQmlTypeMaps_;