summaryrefslogtreecommitdiffstats
path: root/src/tools
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/qdoc/codeparser.cpp2
-rw-r--r--src/tools/qdoc/cppcodemarker.cpp15
-rw-r--r--src/tools/qdoc/cppcodeparser.cpp7
-rw-r--r--src/tools/qdoc/doc.cpp5
-rw-r--r--src/tools/qdoc/doc/qdoc-manual-cmdindex.qdoc17
-rw-r--r--src/tools/qdoc/doc/qdoc-manual-contextcmds.qdoc34
-rw-r--r--src/tools/qdoc/doc/qdoc-manual-markupcmds.qdoc23
-rw-r--r--src/tools/qdoc/doc/qdoc-manual-topiccmds.qdoc22
-rw-r--r--src/tools/qdoc/generator.cpp5
-rw-r--r--src/tools/qdoc/htmlgenerator.cpp99
-rw-r--r--src/tools/qdoc/htmlgenerator.h4
-rw-r--r--src/tools/qdoc/main.cpp8
-rw-r--r--src/tools/qdoc/node.cpp16
-rw-r--r--src/tools/qdoc/node.h10
-rw-r--r--src/tools/qdoc/qdocdatabase.cpp106
-rw-r--r--src/tools/qdoc/qdocdatabase.h40
-rw-r--r--src/tools/qdoc/qdocindexfiles.cpp3
-rw-r--r--src/tools/qdoc/tree.cpp9
-rw-r--r--src/tools/qdoc/tree.h4
19 files changed, 162 insertions, 267 deletions
diff --git a/src/tools/qdoc/codeparser.cpp b/src/tools/qdoc/codeparser.cpp
index 4f35672f82..a99a446cc2 100644
--- a/src/tools/qdoc/codeparser.cpp
+++ b/src/tools/qdoc/codeparser.cpp
@@ -256,7 +256,7 @@ void CodeParser::processCommonMetaCommand(const Location& location,
qdb_->addToJsModule(arg.first, node);
}
else if (command == COMMAND_MAINCLASS) {
- node->setStatus(Node::Main);
+ node->doc().location().warning(tr("'\\mainclass' is deprecated. Consider '\\ingroup mainclasses'"));
}
else if (command == COMMAND_OBSOLETE) {
node->setStatus(Node::Obsolete);
diff --git a/src/tools/qdoc/cppcodemarker.cpp b/src/tools/qdoc/cppcodemarker.cpp
index 1546b5226e..4c1e84fe3c 100644
--- a/src/tools/qdoc/cppcodemarker.cpp
+++ b/src/tools/qdoc/cppcodemarker.cpp
@@ -807,6 +807,21 @@ QList<Section> CppCodeMarker::sections(const InnerNode *inner,
}
++n;
}
+ if (inner->isNamespace()) {
+ const NamespaceNode* ns = static_cast<const NamespaceNode*>(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));
+ if (n->isClass())
+ insert(classes, n, style, status);
+ else if (n->isNamespace())
+ insert(namespaces, n, style, status);
+ n->setParent(p);
+ }
+ }
+ }
append(sections, namespaces);
append(sections, classes);
append(sections, types);
diff --git a/src/tools/qdoc/cppcodeparser.cpp b/src/tools/qdoc/cppcodeparser.cpp
index bc24ff5daa..4fbe20b09e 100644
--- a/src/tools/qdoc/cppcodeparser.cpp
+++ b/src/tools/qdoc/cppcodeparser.cpp
@@ -2425,8 +2425,11 @@ void CppCodeParser::createExampleFileNodes(DocumentNode *dn)
proFileName,
userFriendlyFilePath);
if (fullPath.isEmpty()) {
- dn->location().warning(tr("Cannot find file '%1' or '%2'").arg(tmp).arg(proFileName));
- dn->location().warning(tr(" EXAMPLE PATH DOES NOT EXIST: %1").arg(examplePath));
+ QString details = QLatin1String("Example directories: ") + exampleDirs.join(QLatin1Char(' '));
+ if (!exampleFiles.isEmpty())
+ details += QLatin1String(", example files: ") + exampleFiles.join(QLatin1Char(' '));
+ dn->location().warning(tr("Cannot find file '%1' or '%2'").arg(tmp).arg(proFileName), details);
+ dn->location().warning(tr(" EXAMPLE PATH DOES NOT EXIST: %1").arg(examplePath), details);
return;
}
}
diff --git a/src/tools/qdoc/doc.cpp b/src/tools/qdoc/doc.cpp
index e911eed28b..92c6d405de 100644
--- a/src/tools/qdoc/doc.cpp
+++ b/src/tools/qdoc/doc.cpp
@@ -3305,7 +3305,10 @@ CodeMarker *Doc::quoteFromFile(const Location &location,
DocParser::exampleDirs,
fileName, userFriendlyFilePath);
if (filePath.isEmpty()) {
- location.warning(tr("Cannot find file to quote from: '%1'").arg(fileName));
+ QString details = QLatin1String("Example directories: ") + DocParser::exampleDirs.join(QLatin1Char(' '));
+ if (!DocParser::exampleFiles.isEmpty())
+ details += QLatin1String(", example files: ") + DocParser::exampleFiles.join(QLatin1Char(' '));
+ location.warning(tr("Cannot find file to quote from: '%1'").arg(fileName), details);
}
else {
QFile inFile(filePath);
diff --git a/src/tools/qdoc/doc/qdoc-manual-cmdindex.qdoc b/src/tools/qdoc/doc/qdoc-manual-cmdindex.qdoc
index 1a68347682..87416fcd14 100644
--- a/src/tools/qdoc/doc/qdoc-manual-cmdindex.qdoc
+++ b/src/tools/qdoc/doc/qdoc-manual-cmdindex.qdoc
@@ -40,7 +40,7 @@
\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} {\\b}
\li \l {b-command} {\\bold} \span {class="newStuff"} {(deprecated, use \\b)}
\li \l {brief-command} {\\brief}
\li \l {c-command} {\\c}
@@ -52,10 +52,9 @@
\li \l {compat-command} {\\compat}
\li \l {contentspage-command} {\\contentspage}
\li \l {default-command} {\\default}
- \li \l {ditamap-command} {\\ditamap} \span {class="newStuff"}
\li \l {div-command} {\\div}
\li \l {dots-command} {\\dots}
- \li \l {e-command} {\\e} \span {class="newStuff"}
+ \li \l {e-command} {\\e}
\li \l {else-command} {\\else}
\li \l {endif-command} {\\endif}
\li \l {enum-command} {\\enum}
@@ -77,16 +76,14 @@
\li \l {inlineimage-command} {\\inlineimage}
\li \l {inmodule-command} {\\inmodule}
\li \l {inqmlmodule-command} {\\inqmlmodule}
- \li \l {instantiates-command} {\\instantiates} \span {class="newStuff"} {(new 27/7/2012)}
+ \li \l {instantiates-command} {\\instantiates}
\li \l {internal-command} {\\internal}
\li \l {keyword-command} {\\keyword}
\li \l {l-command} {\\l}
\li \l {legalese-command} {\\legalese}
- \li \l {li-command} {\\li} \span {class="newStuff"}
+ \li \l {li-command} {\\li}
\li \l {list-command} {\\list}
\li \l {macro-command} {\\macro}
- \li \l {mainclass-command} {\\mainclass}
- \li \l {mapref-command} {\\mapref} \span {class="newStuff"}
\li \l {meta-command} {\\meta}
\li \l {module-command} {\\module}
\li \l {namespace-command} {\\namespace}
@@ -113,7 +110,7 @@
\li \l {qmlattachedsignal-command} {\\qmlattachedsignal}
\li \l {qmlbasictype-command} {\\qmlbasictype}
\li \l {qmlclass-command} {\\qmlclass} \span {class="newStuff"} {(deprecated, use \\qmltype)}
- \li \l {qmltype-command} {\\qmltype} \span {class="newStuff"}
+ \li \l {qmltype-command} {\\qmltype}
\li \l {qmlmethod-command} {\\qmlmethod}
\li \l {qmlproperty-command} {\\qmlproperty}
\li \l {qmlsignal-command} {\\qmlsignal}
@@ -121,7 +118,7 @@
\li \l {quotation-command} {\\quotation}
\li \l {quotefile-command} {\\quotefile}
\li \l {quotefromfile-command} {\\quotefromfile}
- \li \l {raw-command} {\\raw} \span {class="newStuff"} {(avoid)}
+ \li \l {raw-command} {\\raw}
\li \l {reentrant-command} {\\reentrant}
\li \l {reimp-command} {\\reimp}
\li \l {relates-command} {\\relates}
@@ -131,7 +128,6 @@
\li \l {sectionTwo-command} {\\section2}
\li \l {sectionThree-command} {\\section3}
\li \l {sectionFour-command} {\\section4}
- \li \l {service-command} {\\service}
\li \l {since-command} {\\since}
\li \l {skipline-command} {\\skipline}
\li \l {skipto-command} {\\skipto}
@@ -147,7 +143,6 @@
\li \l {target-command} {\\target}
\li \l {threadsafe-command} {\\threadsafe}
\li \l {title-command} {\\title}
- \li \l {topicref-command} {\\topicref} \span {class="newStuff"}
\li \l {tt-command} {\\tt}
\li \l {typedef-command} {\\typedef}
\li \l {uicontrol-command} {\\uicontrol}
diff --git a/src/tools/qdoc/doc/qdoc-manual-contextcmds.qdoc b/src/tools/qdoc/doc/qdoc-manual-contextcmds.qdoc
index 98321f9a39..77987d6d95 100644
--- a/src/tools/qdoc/doc/qdoc-manual-contextcmds.qdoc
+++ b/src/tools/qdoc/doc/qdoc-manual-contextcmds.qdoc
@@ -53,7 +53,6 @@
\li \l {inherits-command}{\\inherits},
\li \l {inmodule-command}{\\inmodule},
\li \l {internal-command}{\\internal},
- \li \l {mainclass-command}{\\mainclass},
\li \l {nextpage-command}{\\nextpage},
\li \l {nonreentrant-command}{\\nonreentrant},
\li \l {obsolete-command}{\\obsolete},
@@ -542,7 +541,6 @@
\reentrant
\ingroup i18n
\ingroup text
- \mainclass
QLocale is initialized with a language/country pair in its
constructor and offers number-to-string and string-to-number
@@ -887,38 +885,6 @@
\section1 Commands
- \target mainclass-command
- \section2 \\mainclass
-
- The \\mainclass command relates the documented class to
- a group called mainclasses.
-
- The command must stand on its own line.
-
- \code
- / *!
- \class QWidget qwidget.h
- \brief The QWidget class is the base class of
- all user interface objects.
-
- \mainclass
-
- ...
- * /
- \endcode
-
- This will include the QWidget class in the \e mainclasses
- group, which means, for example, that the class will appear on the
- list created by calling the \l {generatelist-command}
- {\\generatelist} command with the \c mainclasses argument:
-
- \l http://doc.qt.digia.com/4.0/mainclasses.html
-
- \note The Qt documentation no longer includes the \e mainclasses
- page.
-
- See also \l {generatelist-command} {\\generatelist}.
-
\target ingroup-command
\section2 \\ingroup
diff --git a/src/tools/qdoc/doc/qdoc-manual-markupcmds.qdoc b/src/tools/qdoc/doc/qdoc-manual-markupcmds.qdoc
index f341699ee8..d9b5a6f659 100644
--- a/src/tools/qdoc/doc/qdoc-manual-markupcmds.qdoc
+++ b/src/tools/qdoc/doc/qdoc-manual-markupcmds.qdoc
@@ -2109,7 +2109,6 @@
\ingroup tools
\ingroup misc
\ingroup shared
- \mainclass
\keyword regular expression
@@ -3549,16 +3548,6 @@
* /
\endcode
- \section2 \c mainclasses
-
- The \c mainclasses argument tells QDoc to generate an alphabetical
- list of the main classes. A class is marked as a main class by
- including a \l {mainclass-command} {\\mainclass} command in the
- \\class comment.
-
- \note The Qt documentation no longer includes a main classes page,
- but you can generate one for your main classes if you want it.
-
\section2 \c overviews
The \c overviews argument is used to tell QDoc to generate a list
@@ -3607,18 +3596,6 @@
\ingroup qt-basic-concepts
\endcode
- \section2 \c service
-
- The \c service argument tells QDoc to generate an alphabetical
- list of the services. Each service name is a link to the service's
- reference documentation.
-
- A service is identified with the \l {service-command} {\\service}
- command.
-
- \note This command and the \l {service-command} {\\service}
- command are not used in the Qt documentation.
-
\target if-command
\section1 \\if
diff --git a/src/tools/qdoc/doc/qdoc-manual-topiccmds.qdoc b/src/tools/qdoc/doc/qdoc-manual-topiccmds.qdoc
index 93cd25610d..4ebe0e6cb0 100644
--- a/src/tools/qdoc/doc/qdoc-manual-topiccmds.qdoc
+++ b/src/tools/qdoc/doc/qdoc-manual-topiccmds.qdoc
@@ -1054,28 +1054,6 @@
\l{QWidget::height} {height}, and \l{QWidget::size} {size}.
\endquotation
- \target service-command
- \section1 \\service
-
- The \\service command tells QDoc that a class is a service class
- and names the service. The command takes two arguments, the name
- of the class and the name of the service. Currently, this command
- is not used in the Qt documentation.
-
- \code
- / *!
- \service TimeService Time
- ...
- * /
- class TimeService : public QCopObjectService
- {
- ...
- }
- \endcode
-
- See also \l {class-command} {\\class} and \l
- {generatelist-command} {\\generatelist}.
-
\target qmlattachedproperty-command
\section1 \\qmlattachedproperty
diff --git a/src/tools/qdoc/generator.cpp b/src/tools/qdoc/generator.cpp
index 0ecd5ed6e3..af6cdf7bd1 100644
--- a/src/tools/qdoc/generator.cpp
+++ b/src/tools/qdoc/generator.cpp
@@ -1006,7 +1006,8 @@ void Generator::generateInnerNode(InnerNode* node)
CodeMarker *marker = CodeMarker::markerForFileName(node->location().filePath());
if (node->parent() != 0) {
- if (node->isNamespace() || node->isClass()) {
+ if ((node->isNamespace() && node->status() != Node::Intermediate)
+ || node->isClass()) {
beginSubPage(node, fileName(node));
generateClassLikeNode(node, marker);
endSubPage();
@@ -1197,7 +1198,6 @@ void Generator::generateStatus(const Node *node, CodeMarker *marker)
switch (node->status()) {
case Node::Commendable:
- case Node::Main:
break;
case Node::Preliminary:
text << Atom::ParaLeft
@@ -1937,7 +1937,6 @@ void Generator::terminate()
imageFiles.clear();
imageDirs.clear();
outDir_.clear();
- QmlTypeNode::terminate();
}
void Generator::terminateGenerator()
diff --git a/src/tools/qdoc/htmlgenerator.cpp b/src/tools/qdoc/htmlgenerator.cpp
index 00a292b17f..0fc9a30836 100644
--- a/src/tools/qdoc/htmlgenerator.cpp
+++ b/src/tools/qdoc/htmlgenerator.cpp
@@ -705,11 +705,6 @@ int HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMark
else if (atom->string() == "classhierarchy") {
generateClassHierarchy(relative, qdb_->getCppClasses());
}
- else if (atom->string() == "compatclasses") {
- // "compatclasses" is no longer used. Delete this at some point.
- // mws 03/10/2013
- generateCompactList(Generic, relative, qdb_->getCompatibilityClasses(), false, QStringLiteral("Q"));
- }
else if (atom->string() == "obsoleteclasses") {
generateCompactList(Generic, relative, qdb_->getObsoleteClasses(), false, QStringLiteral("Q"));
}
@@ -728,16 +723,6 @@ int HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMark
else if (atom->string() == "legalese") {
generateLegaleseList(relative, marker);
}
- else if (atom->string() == "mainclasses") {
- // "mainclasses" is no longer used. Delete this at some point.
- // mws 03/10/2013
- generateCompactList(Generic, relative, qdb_->getMainClasses(), true, QStringLiteral("Q"));
- }
- else if (atom->string() == "services") {
- // "services" is no longer used. Delete this at some point.
- // mws 03/10/2013
- generateCompactList(Generic, relative, qdb_->getServiceClasses(), false, QStringLiteral("Q"));
- }
else if (atom->string() == "overviews") {
generateList(relative, marker, "overviews");
}
@@ -1772,23 +1757,23 @@ void HtmlGenerator::generateCollectionNode(CollectionNode* cn, CodeMarker* marke
generateStatus(cn, marker);
generateSince(cn, marker);
- NodeMap nm;
- cn->getMemberNamespaces(nm);
- if (!nm.isEmpty()) {
+ NodeMultiMap nmm;
+ cn->getMemberNamespaces(nmm);
+ if (!nmm.isEmpty()) {
ref = registerRef("namespaces");
out() << "<a name=\"" << ref << "\"></a>" << divNavTop << '\n';
out() << "<h2 id=\"" << ref << "\">Namespaces</h2>\n";
- generateAnnotatedList(cn, marker, nm);
+ generateAnnotatedList(cn, marker, nmm);
}
- nm.clear();
- cn->getMemberClasses(nm);
- if (!nm.isEmpty()) {
+ nmm.clear();
+ cn->getMemberClasses(nmm);
+ if (!nmm.isEmpty()) {
ref = registerRef("classes");
out() << "<a name=\"" << ref << "\"></a>" << divNavTop << '\n';
out() << "<h2 id=\"" << ref << "\">Classes</h2>\n";
- generateAnnotatedList(cn, marker, nm);
+ generateAnnotatedList(cn, marker, nmm);
}
- nm.clear();
+ nmm.clear();
}
sections = marker->sections(cn, CodeMarker::Summary, CodeMarker::Okay);
@@ -2262,9 +2247,9 @@ void HtmlGenerator::generateQmlRequisites(QmlTypeNode *qcn, CodeMarker *marker)
QString logicalModuleVersion;
CollectionNode* collection = 0;
if (qcn->isJsNode())
- qdb_->findJsModule(qcn->logicalModuleName());
+ collection = qdb_->findJsModule(qcn->logicalModuleName());
else
- qdb_->findQmlModule(qcn->logicalModuleName());
+ collection = qdb_->findQmlModule(qcn->logicalModuleName());
if (collection)
logicalModuleVersion = collection->logicalModuleVersion();
else
@@ -2837,11 +2822,11 @@ void HtmlGenerator::generateClassHierarchy(const Node *relative, NodeMap& classM
*/
void HtmlGenerator::generateAnnotatedList(const Node* relative,
CodeMarker* marker,
- const NodeMap& nodeMap)
+ const NodeMultiMap& nmm)
{
- if (nodeMap.isEmpty())
+ if (nmm.isEmpty())
return;
- generateAnnotatedList(relative, marker, nodeMap.values());
+ generateAnnotatedList(relative, marker, nmm.values());
}
/*!
@@ -2850,19 +2835,19 @@ void HtmlGenerator::generateAnnotatedList(const Node *relative,
CodeMarker *marker,
const NodeList& unsortedNodes)
{
- NodeMap nm;
+ NodeMultiMap nmm;
bool allInternal = true;
foreach (Node* node, unsortedNodes) {
if (!node->isInternal() && !node->isObsolete()) {
allInternal = false;
- nm.insert(node->fullName(relative), node);
+ nmm.insert(node->fullName(relative), node);
}
}
if (allInternal)
return;
out() << "<div class=\"table\"><table class=\"annotated\">\n";
int row = 0;
- NodeList nodes = nm.values();
+ NodeList nodes = nmm.values();
foreach (const Node* node, nodes) {
if (++row % 2 == 1)
out() << "<tr class=\"odd topAlign\">";
@@ -2901,20 +2886,21 @@ void HtmlGenerator::generateAnnotatedList(const Node *relative,
/*!
This function finds the common prefix of the names of all
- the classes in \a classMap and then generates a compact
- list of the class names alphabetized on the part of the
- name not including the common prefix. You can tell the
- function to use \a comonPrefix as the common prefix, but
- normally you let it figure it out itself by looking at
- the name of the first and last classes in \a classMap.
+ the classes in the class map \a nmm and then generates a
+ compact list of the class names alphabetized on the part
+ of the name not including the common prefix. You can tell
+ the function to use \a comonPrefix as the common prefix,
+ but normally you let it figure it out itself by looking at
+ the name of the first and last classes in the class map
+ \a nmm.
*/
void HtmlGenerator::generateCompactList(ListType listType,
const Node *relative,
- const NodeMap &classMap,
+ const NodeMultiMap &nmm,
bool includeAlphabet,
QString commonPrefix)
{
- if (classMap.isEmpty())
+ if (nmm.isEmpty())
return;
const int NumParagraphs = 37; // '0' to '9', 'A' to 'Z', '_'
@@ -2924,14 +2910,14 @@ void HtmlGenerator::generateCompactList(ListType listType,
Divide the data into 37 paragraphs: 0, ..., 9, A, ..., Z,
underscore (_). QAccel will fall in paragraph 10 (A) and
QXtWidget in paragraph 33 (X). This is the only place where we
- assume that NumParagraphs is 37. Each paragraph is a NodeMap.
+ assume that NumParagraphs is 37. Each paragraph is a NodeMultiMap.
*/
- NodeMap paragraph[NumParagraphs+1];
+ NodeMultiMap paragraph[NumParagraphs+1];
QString paragraphName[NumParagraphs+1];
QSet<char> usedParagraphNames;
- NodeMap::ConstIterator c = classMap.constBegin();
- while (c != classMap.constEnd()) {
+ NodeMultiMap::ConstIterator c = nmm.constBegin();
+ while (c != nmm.constEnd()) {
QStringList pieces = c.key().split("::");
QString key;
int idx = commonPrefixLen;
@@ -2991,8 +2977,10 @@ void HtmlGenerator::generateCompactList(ListType listType,
int curParNr = 0;
int curParOffset = 0;
+ QString previousName;
+ bool multipleOccurrences = false;
- for (int i=0; i<classMap.count(); i++) {
+ for (int i=0; i<nmm.count(); i++) {
while ((curParNr < NumParagraphs) &&
(curParOffset == paragraph[curParNr].count())) {
++curParNr;
@@ -3026,7 +3014,8 @@ void HtmlGenerator::generateCompactList(ListType listType,
out() << "<dd>";
if ((curParNr < NumParagraphs) &&
!paragraphName[curParNr].isEmpty()) {
- NodeMap::Iterator it;
+ NodeMultiMap::Iterator it;
+ NodeMultiMap::Iterator next;
it = paragraph[curParNr].begin();
for (int i=0; i<curParOffset; i++)
++it;
@@ -3049,8 +3038,20 @@ void HtmlGenerator::generateCompactList(ListType listType,
}
QStringList pieces;
- if (it.value()->isQmlType() || it.value()->isJsType())
- pieces << it.value()->name();
+ if (it.value()->isQmlType() || it.value()->isJsType()) {
+ QString name = it.value()->name();
+ next = it;
+ ++next;
+ if (name != previousName)
+ multipleOccurrences = false;
+ if ((next != paragraph[curParNr].end()) && (name == next.value()->name())) {
+ multipleOccurrences = true;
+ previousName = name;
+ }
+ if (multipleOccurrences)
+ name += ": " + it.value()->tree()->camelCaseModuleName();
+ pieces << name;
+ }
else
pieces = it.value()->fullName(relative).split("::");
out() << protectEnc(pieces.last());
@@ -3064,7 +3065,7 @@ void HtmlGenerator::generateCompactList(ListType listType,
out() << "</dd>\n";
curParOffset++;
}
- if (classMap.count() > 0)
+ if (nmm.count() > 0)
out() << "</dl>\n";
out() << "</div>\n";
diff --git a/src/tools/qdoc/htmlgenerator.h b/src/tools/qdoc/htmlgenerator.h
index 0c7a4af5ff..efd38ea104 100644
--- a/src/tools/qdoc/htmlgenerator.h
+++ b/src/tools/qdoc/htmlgenerator.h
@@ -159,11 +159,11 @@ private:
CodeMarker *marker,
CodeMarker::Status status);
void generateClassHierarchy(const Node *relative, NodeMap &classMap);
- void generateAnnotatedList(const Node* relative, CodeMarker* marker, const NodeMap& nodeMap);
+ void generateAnnotatedList(const Node* relative, CodeMarker* marker, const NodeMultiMap& nodeMap);
void generateAnnotatedList(const Node* relative, CodeMarker* marker, const NodeList& nodes);
void generateCompactList(ListType listType,
const Node *relative,
- const NodeMap &classMap,
+ const NodeMultiMap &classMap,
bool includeAlphabet,
QString commonPrefix);
void generateFunctionIndex(const Node *relative);
diff --git a/src/tools/qdoc/main.cpp b/src/tools/qdoc/main.cpp
index 4a99ec39de..a521daadbb 100644
--- a/src/tools/qdoc/main.cpp
+++ b/src/tools/qdoc/main.cpp
@@ -341,17 +341,16 @@ static void processQdocconfFile(const QString &fileName)
Location outputFormatsLocation = config.lastLocation();
qdb->clearSearchOrder();
- QString p = config.getString(CONFIG_PROJECT).toLower();
if (!Generator::singleExec()) {
Generator::debug(" loading index files");
loadIndexFiles(config);
Generator::debug(" done loading index files");
- qdb->newPrimaryTree(p);
+ qdb->newPrimaryTree(project);
}
else if (Generator::preparing())
- qdb->newPrimaryTree(p);
+ qdb->newPrimaryTree(project);
else
- qdb->setPrimaryTree(p);
+ qdb->setPrimaryTree(project);
dependModules = config.getStringList(CONFIG_DEPENDS);
dependModules.removeDuplicates();
@@ -776,6 +775,7 @@ int main(int argc, char **argv)
}
translators.clear();
#endif
+ QmlTypeNode::terminate();
#ifdef DEBUG_SHUTDOWN_CRASH
qDebug() << "main(): Delete qdoc database";
diff --git a/src/tools/qdoc/node.cpp b/src/tools/qdoc/node.cpp
index b2f93cc131..8e094f38c4 100644
--- a/src/tools/qdoc/node.cpp
+++ b/src/tools/qdoc/node.cpp
@@ -151,11 +151,6 @@ QString Node::fullName(const Node* relative) const
{
if (isDocumentNode())
return title();
- else if (isClass()) {
- const ClassNode* cn = static_cast<const ClassNode*>(this);
- if (!cn->serviceName().isEmpty())
- return cn->serviceName();
- }
return plainFullName(relative);
}
@@ -888,12 +883,14 @@ void InnerNode::setOverload(FunctionNode *func, bool overlode)
/*!
Mark all child nodes that have no documentation as having
private access and internal status. qdoc will then ignore
- them for documentation purposes.
+ them for documentation purposes. Some nodes have an
+ Intermediate status, meaning that they should be ignored,
+ but not their children.
*/
void InnerNode::makeUndocumentedChildrenInternal()
{
foreach (Node *child, childNodes()) {
- if (child->doc().isEmpty()) {
+ if (child->doc().isEmpty() && child->status() != Node::Intermediate) {
child->setAccess(Node::Private);
child->setStatus(Node::Internal);
}
@@ -2127,9 +2124,10 @@ void QmlTypeNode::terminate()
*/
void QmlTypeNode::addInheritedBy(const QString& base, Node* sub)
{
- if (inheritedBy.constFind(base,sub) == inheritedBy.constEnd()) {
+ if (sub->isInternal())
+ return;
+ if (inheritedBy.constFind(base,sub) == inheritedBy.constEnd())
inheritedBy.insert(base,sub);
- }
}
/*!
diff --git a/src/tools/qdoc/node.h b/src/tools/qdoc/node.h
index 7dd868c3c0..fc9d33edc2 100644
--- a/src/tools/qdoc/node.h
+++ b/src/tools/qdoc/node.h
@@ -116,8 +116,8 @@ public:
Deprecated,
Preliminary,
Commendable,
- Main,
- Internal
+ Internal,
+ Intermediate
}; // don't reorder this enum
enum ThreadSafeness {
@@ -459,10 +459,13 @@ public:
void markSeen() { seen_ = true; }
void markNotSeen() { seen_ = false; }
void setTree(Tree* t) { tree_ = t; }
+ const NodeList& orphans() const { return orphans_; }
+ void addOrphan(Node* child) { orphans_.append(child); }
private:
bool seen_;
Tree* tree_;
+ NodeList orphans_;
};
struct RelatedClass
@@ -523,8 +526,6 @@ public:
const QList<RelatedClass> &ignoredBaseClasses() const { return ignoredBases_; }
const QList<UsingClause>& usingClauses() const { return usingClauses_; }
- QString serviceName() const { return sname; }
- void setServiceName(const QString& value) { sname = value; }
QmlTypeNode* qmlElement() { return qmlelement; }
void setQmlElement(QmlTypeNode* qcn) { qmlelement = qcn; }
virtual bool isAbstract() const Q_DECL_OVERRIDE { return abstract_; }
@@ -539,7 +540,6 @@ private:
QList<UsingClause> usingClauses_;
bool abstract_;
bool wrapper_;
- QString sname;
QString obsoleteLink_;
QmlTypeNode* qmlelement;
};
diff --git a/src/tools/qdoc/qdocdatabase.cpp b/src/tools/qdoc/qdocdatabase.cpp
index 30d4d28a17..f1afb92eff 100644
--- a/src/tools/qdoc/qdocdatabase.cpp
+++ b/src/tools/qdoc/qdocdatabase.cpp
@@ -138,8 +138,9 @@ Tree* QDocForest::nextTree()
*/
void QDocForest::setPrimaryTree(const QString& t)
{
- primaryTree_ = findTree(t);
- forest_.remove(t);
+ QString T = t.toLower();
+ primaryTree_ = findTree(T);
+ forest_.remove(T);
if (!primaryTree_)
qDebug() << "ERROR: Could not set primary tree to:" << t;
}
@@ -841,7 +842,7 @@ TextToNodeMap& QDocDatabase::getLegaleseTexts()
have not already been constructed. Returns a reference to
the map of C++ classes with obsolete members.
*/
-NodeMap& QDocDatabase::getClassesWithObsoleteMembers()
+NodeMultiMap& QDocDatabase::getClassesWithObsoleteMembers()
{
if (obsoleteClasses_.isEmpty() && obsoleteQmlTypes_.isEmpty())
processForest(&QDocDatabase::findAllObsoleteThings);
@@ -853,7 +854,7 @@ NodeMap& QDocDatabase::getClassesWithObsoleteMembers()
have not already been constructed. Returns a reference to
the map of obsolete QML types.
*/
-NodeMap& QDocDatabase::getObsoleteQmlTypes()
+NodeMultiMap& QDocDatabase::getObsoleteQmlTypes()
{
if (obsoleteClasses_.isEmpty() && obsoleteQmlTypes_.isEmpty())
processForest(&QDocDatabase::findAllObsoleteThings);
@@ -865,38 +866,24 @@ NodeMap& QDocDatabase::getObsoleteQmlTypes()
have not already been constructed. Returns a reference to
the map of QML types with obsolete members.
*/
-NodeMap& QDocDatabase::getQmlTypesWithObsoleteMembers()
+NodeMultiMap& QDocDatabase::getQmlTypesWithObsoleteMembers()
{
if (obsoleteClasses_.isEmpty() && obsoleteQmlTypes_.isEmpty())
processForest(&QDocDatabase::findAllObsoleteThings);
return qmlTypesWithObsoleteMembers_;
}
-/*! \fn NodeMap& 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.
*/
/*!
- Construct the C++ class data structures, if they have not
- already been constructed. Returns a reference to the map
- of C++ service clases.
-
- \note This is currently not used.
- */
-NodeMap& QDocDatabase::getServiceClasses()
-{
- if (cppClasses_.isEmpty() && qmlTypes_.isEmpty())
- processForest(&QDocDatabase::findAllClasses);
- return serviceClasses_;
-}
-
-/*!
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()
+NodeMultiMap& QDocDatabase::getQmlBasicTypes()
{
if (cppClasses_.isEmpty() && qmlBasicTypes_.isEmpty())
processForest(&QDocDatabase::findAllClasses);
@@ -906,9 +893,9 @@ NodeMap& QDocDatabase::getQmlBasicTypes()
/*!
Construct the data structures for obsolete things, if they
have not already been constructed. Returns a reference to
- the map of obsolete QML types.
+ the multimap of QML types.
*/
-NodeMap& QDocDatabase::getQmlTypes()
+NodeMultiMap& QDocDatabase::getQmlTypes()
{
if (cppClasses_.isEmpty() && qmlTypes_.isEmpty())
processForest(&QDocDatabase::findAllClasses);
@@ -920,7 +907,7 @@ NodeMap& QDocDatabase::getQmlTypes()
have not already been constructed. Returns a reference to
the map of obsolete C++ clases.
*/
-NodeMap& QDocDatabase::getObsoleteClasses()
+NodeMultiMap& QDocDatabase::getObsoleteClasses()
{
if (obsoleteClasses_.isEmpty() && obsoleteQmlTypes_.isEmpty())
processForest(&QDocDatabase::findAllObsoleteThings);
@@ -930,36 +917,9 @@ NodeMap& QDocDatabase::getObsoleteClasses()
/*!
Construct the C++ class data structures, if they have not
already been constructed. Returns a reference to the map
- of compatibility C++ clases.
- */
-NodeMap& QDocDatabase::getCompatibilityClasses()
-{
- if (cppClasses_.isEmpty() && qmlTypes_.isEmpty())
- processForest(&QDocDatabase::findAllClasses);
- return compatClasses_;
-}
-
-/*!
- Construct the C++ class data structures, if they have not
- already been constructed. Returns a reference to the map
- of main C++ clases.
-
- \note The main C++ classes data structure is currently not
- used.
- */
-NodeMap& QDocDatabase::getMainClasses()
-{
- if (cppClasses_.isEmpty() && qmlTypes_.isEmpty())
- processForest(&QDocDatabase::findAllClasses);
- return mainClasses_;
-}
-
-/*!
- Construct the C++ class data structures, if they have not
- already been constructed. Returns a reference to the map
of all C++ classes.
*/
-NodeMap& QDocDatabase::getCppClasses()
+NodeMultiMap& QDocDatabase::getCppClasses()
{
if (cppClasses_.isEmpty() && qmlTypes_.isEmpty())
processForest(&QDocDatabase::findAllClasses);
@@ -974,7 +934,8 @@ void QDocDatabase::findAllClasses(InnerNode* node)
{
NodeList::const_iterator c = node->childNodes().constBegin();
while (c != node->childNodes().constEnd()) {
- if ((*c)->access() != Node::Private && (!(*c)->isInternal() || showInternal_)) {
+ if ((*c)->access() != Node::Private && (!(*c)->isInternal() || showInternal_) &&
+ (*c)->tree()->camelCaseModuleName() != QString("QDoc")) {
if ((*c)->type() == Node::Class && !(*c)->doc().isEmpty()) {
QString className = (*c)->name();
if ((*c)->parent() &&
@@ -982,19 +943,7 @@ void QDocDatabase::findAllClasses(InnerNode* node)
!(*c)->parent()->name().isEmpty())
className = (*c)->parent()->name()+"::"+className;
- if ((*c)->status() == Node::Compat) {
- compatClasses_.insert(className, *c);
- }
- else {
- cppClasses_.insert(className, *c);
- if ((*c)->status() == Node::Main)
- mainClasses_.insert(className, *c);
- }
-
- QString serviceName = (static_cast<const ClassNode *>(*c))->serviceName();
- if (!serviceName.isEmpty()) {
- serviceClasses_.insert(serviceName, *c);
- }
+ cppClasses_.insert(className, *c);
}
else if (((*c)->isQmlType() || (*c)->isQmlBasicType() ||
(*c)->isJsType() || (*c)->isJsBasicType()) && !(*c)->doc().isEmpty()) {
@@ -1299,7 +1248,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 NodeMultiMap& QDocDatabase::getSinceMap(const QString& key)
+const NodeMap& QDocDatabase::getSinceMap(const QString& key)
{
if (newSinceMaps_.isEmpty() && newClassMaps_.isEmpty() && newQmlTypeMaps_.isEmpty())
processForest(&QDocDatabase::findAllSince);
@@ -1361,11 +1310,24 @@ void QDocDatabase::resolveNamespaces()
foreach (Node* n, nodes) {
if (n->isNamespace()) {
NamespaceNode* NS = static_cast<NamespaceNode*>(n);
- if (NS != ns) {
- while (!NS->childNodes().isEmpty()) {
- Node* child = NS->childNodes().first();
- NS->removeChild(child);
- ns->addChild(child);
+ if ((NS != ns) && !NS->childNodes().isEmpty()) {
+ const NodeList& children = NS->childNodes();
+ int i = children.size() - 1;
+ while (i >= 0) {
+ Node* child = children.at(i--);
+ if (!child)
+ continue;
+ if (!child->isClass()
+ && !child->isQmlType()
+ && !child->isNamespace()) {
+ NS->removeChild(child);
+ ns->addChild(child);
+ }
+ else {
+ NS->setStatus(Node::Intermediate);
+ NS->setAccess(Node::Public);
+ ns->addOrphan(child);
+ }
}
}
}
diff --git a/src/tools/qdoc/qdocdatabase.h b/src/tools/qdoc/qdocdatabase.h
index d0c59d731c..b8ca8bc32d 100644
--- a/src/tools/qdoc/qdocdatabase.h
+++ b/src/tools/qdoc/qdocdatabase.h
@@ -271,22 +271,19 @@ class QDocDatabase
/*******************************************************************
special collection access functions
********************************************************************/
- NodeMap& getCppClasses();
- NodeMap& getMainClasses();
- NodeMap& getCompatibilityClasses();
- NodeMap& getObsoleteClasses();
- NodeMap& getClassesWithObsoleteMembers();
- NodeMap& getObsoleteQmlTypes();
- NodeMap& getQmlTypesWithObsoleteMembers();
- NodeMap& getNamespaces() { resolveNamespaces(); return namespaceIndex_; }
- NodeMap& getServiceClasses();
- NodeMap& getQmlBasicTypes();
- NodeMap& getQmlTypes();
+ NodeMultiMap& getCppClasses();
+ NodeMultiMap& getObsoleteClasses();
+ NodeMultiMap& getClassesWithObsoleteMembers();
+ NodeMultiMap& getObsoleteQmlTypes();
+ NodeMultiMap& getQmlTypesWithObsoleteMembers();
+ NodeMultiMap& getNamespaces() { resolveNamespaces(); return namespaceIndex_; }
+ NodeMultiMap& getQmlBasicTypes();
+ NodeMultiMap& getQmlTypes();
NodeMapMap& getFunctionIndex();
TextToNodeMap& getLegaleseTexts();
const NodeMap& getClassMap(const QString& key);
const NodeMap& getQmlTypeMap(const QString& key);
- const NodeMultiMap& getSinceMap(const QString& key);
+ const NodeMap& getSinceMap(const QString& key);
/*******************************************************************
Many of these will be either eliminated or replaced.
@@ -438,18 +435,15 @@ class QDocDatabase
QString version_;
QDocForest forest_;
- NodeMap cppClasses_;
- NodeMap mainClasses_; // MWS: not needed, should be delete
- NodeMap compatClasses_;
- NodeMap obsoleteClasses_;
- NodeMap classesWithObsoleteMembers_;
- NodeMap obsoleteQmlTypes_;
- NodeMap qmlTypesWithObsoleteMembers_;
- NodeMap namespaceIndex_;
+ NodeMultiMap cppClasses_;
+ NodeMultiMap obsoleteClasses_;
+ NodeMultiMap classesWithObsoleteMembers_;
+ NodeMultiMap obsoleteQmlTypes_;
+ NodeMultiMap qmlTypesWithObsoleteMembers_;
+ NodeMultiMap namespaceIndex_;
NodeMultiMap nmm_;
- NodeMap serviceClasses_; // MWS: not needed, should be deleted
- NodeMap qmlBasicTypes_;
- NodeMap qmlTypes_;
+ NodeMultiMap qmlBasicTypes_;
+ NodeMultiMap qmlTypes_;
NodeMapMap newClassMaps_;
NodeMapMap newQmlTypeMaps_;
NodeMultiMapMap newSinceMaps_;
diff --git a/src/tools/qdoc/qdocindexfiles.cpp b/src/tools/qdoc/qdocindexfiles.cpp
index 026c64b587..8961ff71ad 100644
--- a/src/tools/qdoc/qdocindexfiles.cpp
+++ b/src/tools/qdoc/qdocindexfiles.cpp
@@ -617,8 +617,6 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element,
node->setStatus(Node::Commendable);
else if (status == "internal")
node->setStatus(Node::Internal);
- else if (status == "main")
- node->setStatus(Node::Main);
else
node->setStatus(Node::Commendable);
@@ -893,7 +891,6 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer,
case Node::Internal:
status = "internal";
break;
- case Node::Main:
default:
status = "main";
break;
diff --git a/src/tools/qdoc/tree.cpp b/src/tools/qdoc/tree.cpp
index d36003c665..d0d0bcbb5a 100644
--- a/src/tools/qdoc/tree.cpp
+++ b/src/tools/qdoc/tree.cpp
@@ -64,12 +64,17 @@ QT_BEGIN_NAMESPACE
Constructs a Tree. \a qdb is the pointer to the singleton
qdoc database that is constructing the tree. This might not
be necessary, and it might be removed later.
+
+ \a camelCaseModuleName is the project name for this tree,
+ which was obtained from the qdocconf file via the Config
+ singleton.
*/
-Tree::Tree(const QString& physicalModuleName, QDocDatabase* qdb)
+Tree::Tree(const QString& camelCaseModuleName, QDocDatabase* qdb)
: treeHasBeenAnalyzed_(false),
docsHaveBeenGenerated_(false),
linkCount_(0),
- physicalModuleName_(physicalModuleName),
+ camelCaseModuleName_(camelCaseModuleName),
+ physicalModuleName_(camelCaseModuleName.toLower()),
qdb_(qdb),
root_(0, QString()),
targetListMap_(0)
diff --git a/src/tools/qdoc/tree.h b/src/tools/qdoc/tree.h
index 67063ef86a..1e9612aeec 100644
--- a/src/tools/qdoc/tree.h
+++ b/src/tools/qdoc/tree.h
@@ -95,7 +95,7 @@ class Tree
typedef QMap<PropertyNode::FunctionRole, QString> RoleMap;
typedef QMap<PropertyNode*, RoleMap> PropertyMap;
- Tree(const QString& module, QDocDatabase* qdb);
+ Tree(const QString& camelCaseModuleName, QDocDatabase* qdb);
~Tree();
Node* findNodeForInclude(const QStringList& path) const;
@@ -212,6 +212,7 @@ class Tree
QStringList getTargetListKeys() { return targetListMap_->keys(); }
public:
+ const QString& camelCaseModuleName() const { return camelCaseModuleName_; }
const QString& physicalModuleName() const { return physicalModuleName_; }
const QString& indexFileName() const { return indexFileName_; }
long incrementLinkCount() { return --linkCount_; }
@@ -222,6 +223,7 @@ private:
bool treeHasBeenAnalyzed_;
bool docsHaveBeenGenerated_;
long linkCount_;
+ QString camelCaseModuleName_;
QString physicalModuleName_;
QString indexFileName_;
QDocDatabase* qdb_;