summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/qdoc/atom.cpp2
-rw-r--r--src/qdoc/clangcodeparser.cpp23
-rw-r--r--src/qdoc/codemarker.cpp41
-rw-r--r--src/qdoc/codemarker.h2
-rw-r--r--src/qdoc/codeparser.cpp2
-rw-r--r--src/qdoc/codeparser.h2
-rw-r--r--src/qdoc/config.cpp208
-rw-r--r--src/qdoc/config.h2
-rw-r--r--src/qdoc/cppcodemarker.cpp83
-rw-r--r--src/qdoc/cppcodeparser.cpp46
-rw-r--r--src/qdoc/doc.cpp150
-rw-r--r--src/qdoc/doc.h16
-rw-r--r--src/qdoc/editdistance.cpp20
-rw-r--r--src/qdoc/generator.cpp293
-rw-r--r--src/qdoc/generator.h18
-rw-r--r--src/qdoc/helpprojectwriter.cpp5
-rw-r--r--src/qdoc/helpprojectwriter.h6
-rw-r--r--src/qdoc/htmlgenerator.cpp902
-rw-r--r--src/qdoc/htmlgenerator.h26
-rw-r--r--src/qdoc/jscodemarker.cpp4
-rw-r--r--src/qdoc/location.cpp4
-rw-r--r--src/qdoc/main.cpp152
-rw-r--r--src/qdoc/node.cpp238
-rw-r--r--src/qdoc/node.h43
-rw-r--r--src/qdoc/openedlist.cpp2
-rw-r--r--src/qdoc/parameters.cpp17
-rw-r--r--src/qdoc/parameters.h6
-rw-r--r--src/qdoc/qdoc.pro2
-rw-r--r--src/qdoc/qdocdatabase.cpp96
-rw-r--r--src/qdoc/qdocindexfiles.cpp39
-rw-r--r--src/qdoc/qdoctagfiles.cpp2
-rw-r--r--src/qdoc/qmlcodemarker.cpp14
-rw-r--r--src/qdoc/qmlcodemarker.h2
-rw-r--r--src/qdoc/qmlmarkupvisitor.cpp2
-rw-r--r--src/qdoc/qmlmarkupvisitor.h4
-rw-r--r--src/qdoc/qmlvisitor.cpp16
-rw-r--r--src/qdoc/quoter.cpp7
-rw-r--r--src/qdoc/sections.cpp148
-rw-r--r--src/qdoc/sections.h8
-rw-r--r--src/qdoc/tokenizer.cpp2
-rw-r--r--src/qdoc/tree.cpp204
-rw-r--r--src/qdoc/webxmlgenerator.cpp57
-rw-r--r--src/qdoc/webxmlgenerator.h2
-rw-r--r--src/qdoc/xmlgenerator.cpp478
-rw-r--r--src/qdoc/xmlgenerator.h71
-rw-r--r--src/qdoc/yyindent.cpp8
-rw-r--r--src/shared/winutils/utils.cpp15
-rw-r--r--src/shared/winutils/utils.h5
-rw-r--r--src/windeployqt/main.cpp10
-rw-r--r--tests/auto/qdoc/generatedoutput/bug80259/inc/testmodule/TestModule.h3
-rw-r--r--tests/auto/qdoc/generatedoutput/bug80259/inc/testmodule/aaa.h4
-rw-r--r--tests/auto/qdoc/generatedoutput/bug80259/inc/testmodule/bbb.h5
-rw-r--r--tests/auto/qdoc/generatedoutput/bug80259/inc/testmodule/ccc.h4
-rw-r--r--tests/auto/qdoc/generatedoutput/bug80259/src/main.cpp54
-rw-r--r--tests/auto/qdoc/generatedoutput/bug80259/src/qdoc/index.qdoc7
-rw-r--r--tests/auto/qdoc/generatedoutput/bug80259/testmodule.qdocconf13
-rw-r--r--tests/auto/qdoc/generatedoutput/bug80259/webxml_testmodule.qdocconf2
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/first.html32
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/html/first.webxml15
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/html/index.webxml10
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/html/qdoctests-qdocfileoutput-linking.webxml18
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/html/qdoctests-qdocfileoutput.webxml82
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/html/second.webxml10
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/html/test-componentset-example.webxml38
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/html/testcpp-module.webxml4
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/html/testqdoc-test.webxml54
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/html/testqdoc-testderived.webxml13
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/html/testqdoc.webxml75
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/html/third.webxml10
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/html/uicomponents-qmlmodule.webxml4
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/index.html23
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/qdoc-test-qmlmodule.html24
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/qml-int.html24
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-abstractparent.html67
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-child.html67
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-doctest.html87
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-type-members.html28
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-type.html141
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/qml-uicomponents-progressbar.html98
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/qml-uicomponents-switch.html69
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/qml-uicomponents-tabwidget.html85
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/second.html32
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/third.html32
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/uicomponents-qmlmodule.html5
-rw-r--r--tests/auto/qdoc/generatedoutput/qml/DocTest.qml84
-rw-r--r--tests/auto/qdoc/generatedoutput/qml/componentset/ProgressBar.qml (renamed from tests/auto/qdoc/generatedoutput/componentset/ProgressBar.qml)0
-rw-r--r--tests/auto/qdoc/generatedoutput/qml/componentset/Switch.qml (renamed from tests/auto/qdoc/generatedoutput/componentset/Switch.qml)0
-rw-r--r--tests/auto/qdoc/generatedoutput/qml/componentset/TabWidget.qml (renamed from tests/auto/qdoc/generatedoutput/componentset/TabWidget.qml)0
-rw-r--r--tests/auto/qdoc/generatedoutput/qml/componentset/componentset.pro (renamed from tests/auto/qdoc/generatedoutput/componentset/componentset.pro)0
-rw-r--r--tests/auto/qdoc/generatedoutput/qml/componentset/examples.qdoc (renamed from tests/auto/qdoc/generatedoutput/examples.qdoc)0
-rw-r--r--tests/auto/qdoc/generatedoutput/qml/componentset/uicomponents.qdoc.sample (renamed from tests/auto/qdoc/generatedoutput/componentset/uicomponents.qdoc.sample)0
-rw-r--r--tests/auto/qdoc/generatedoutput/qml/parent.qdoc59
-rw-r--r--tests/auto/qdoc/generatedoutput/qml/type.cpp87
-rw-r--r--tests/auto/qdoc/generatedoutput/testqml.qdocconf13
-rw-r--r--tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp90
-rw-r--r--tests/auto/qdoc/generatedoutput/webxml.qdocconf3
-rw-r--r--tests/auto/qdoc/generatedoutput/webxml_test.qdocconf2
-rw-r--r--tests/auto/qdoc/generatedoutput/webxml_testcpp.qdocconf2
-rw-r--r--tests/auto/qdoc/generatedoutput/webxml_testqml.qdocconf2
99 files changed, 3233 insertions, 1853 deletions
diff --git a/src/qdoc/atom.cpp b/src/qdoc/atom.cpp
index dff90b299..ecbea2013 100644
--- a/src/qdoc/atom.cpp
+++ b/src/qdoc/atom.cpp
@@ -334,7 +334,7 @@ QString Atom::typeString() const
while (atms[i].english != nullptr) {
if (atms[i].no != i)
Location::internalError(QCoreApplication::translate("QDoc::Atom", "atom %1 missing").arg(i));
- i++;
+ ++i;
}
deja = true;
}
diff --git a/src/qdoc/clangcodeparser.cpp b/src/qdoc/clangcodeparser.cpp
index 5d95c9c7e..2e96a092d 100644
--- a/src/qdoc/clangcodeparser.cpp
+++ b/src/qdoc/clangcodeparser.cpp
@@ -269,7 +269,7 @@ static Node *findNodeForCursor(QDocDatabase *qdb, CXCursor cur) {
if (isVariadic && parameters.last().type() != QLatin1String("..."))
continue;
bool different = false;
- for (int i = 0; i < actualArg; i++) {
+ for (int i = 0; i < actualArg; ++i) {
if (args.size() <= i)
args.append(fromCXString(clang_getTypeSpelling(clang_getArgType(funcType, i))));
QString t1 = parameters.at(i).type();
@@ -347,7 +347,7 @@ static Node *findFunctionNodeForCursor(QDocDatabase *qdb, CXCursor cur) {
if (isVariadic && parameters.last().type() != QLatin1String("..."))
continue;
bool different = false;
- for (int i = 0; i < numArg; i++) {
+ for (int i = 0; i < numArg; ++i) {
if (args.size() <= i)
args.append(fromCXString(clang_getTypeSpelling(clang_getArgType(funcType, i))));
QString t1 = parameters.at(i).type();
@@ -884,7 +884,7 @@ void ClangVisitor::readParameterNamesAndAttributes(FunctionNode *fn, CXCursor cu
}
return CXChildVisit_Continue;
});
- i++;
+ ++i;
}
return CXChildVisit_Continue;
});
@@ -1156,7 +1156,7 @@ void ClangCodeParser::getDefaultArgs()
static QVector<QByteArray> includePathsFromHeaders(const QHash<QString, QString> &allHeaders)
{
QVector<QByteArray> result;
- for (auto it = allHeaders.cbegin(), end = allHeaders.cend(); it != end; ++it) {
+ for (auto it = allHeaders.cbegin(); it != allHeaders.cend(); ++it) {
const QByteArray path = "-I" + it.value().toLatin1();
const QByteArray parent = "-I"
+ QDir::cleanPath(it.value() + QLatin1String("/../")).toLatin1();
@@ -1284,13 +1284,12 @@ void ClangCodeParser::buildPCH()
if (tmpHeaderFile.open(QIODevice::Text | QIODevice::WriteOnly)) {
QTextStream out(&tmpHeaderFile);
if (header.isEmpty()) {
- QList<QString> keys = allHeaders_.keys();
- QList<QString> values = allHeaders_.values();
- for (int i = 0; i < keys.size(); i++) {
- if (!keys.at(i).endsWith(QLatin1String("_p.h")) &&
- !keys.at(i).startsWith(QLatin1String("moc_"))) {
- QString line = QLatin1String("#include \"") + values.at(i) +
- QLatin1String("/") + keys.at(i) + QLatin1String("\"");
+ for (auto it = allHeaders_.constKeyValueBegin();
+ it != allHeaders_.constKeyValueEnd(); ++it) {
+ if (!(*it).first.endsWith(QLatin1String("_p.h")) &&
+ !(*it).first.startsWith(QLatin1String("moc_"))) {
+ QString line = QLatin1String("#include \"") + (*it).second +
+ QLatin1String("/") + (*it).first + QLatin1String("\"");
out << line << "\n";
}
}
@@ -1522,7 +1521,7 @@ Node *ClangCodeParser::parseFnArg(const Location &location, const QString &fnArg
QString pName = blankSplit.last();
int j = 0;
while (j < pName.length() && !pName.at(i).isLetter())
- j++;
+ ++j;
if (j > 0)
pName = pName.mid(j);
if (!pName.isEmpty() && pName != parameters[i].name())
diff --git a/src/qdoc/codemarker.cpp b/src/qdoc/codemarker.cpp
index 7c8843c65..f9b1a163e 100644
--- a/src/qdoc/codemarker.cpp
+++ b/src/qdoc/codemarker.cpp
@@ -39,7 +39,7 @@
QT_BEGIN_NAMESPACE
QString CodeMarker::defaultLang;
-QList<CodeMarker *> CodeMarker::markers;
+QVector<CodeMarker *> CodeMarker::markers;
/*!
When a code marker constructs itself, it puts itself into
@@ -85,11 +85,8 @@ void CodeMarker::terminateMarker()
void CodeMarker::initialize(const Config &config)
{
defaultLang = config.getString(CONFIG_LANGUAGE);
- QList<CodeMarker *>::ConstIterator m = markers.constBegin();
- while (m != markers.constEnd()) {
- (*m)->initializeMarker(config);
- ++m;
- }
+ for (const auto &marker : qAsConst(markers))
+ marker->initializeMarker(config);
}
/*!
@@ -97,11 +94,8 @@ void CodeMarker::initialize(const Config &config)
*/
void CodeMarker::terminate()
{
- QList<CodeMarker *>::ConstIterator m = markers.constBegin();
- while (m != markers.constEnd()) {
- (*m)->terminateMarker();
- ++m;
- }
+ for (const auto &marker : qAsConst(markers))
+ marker->terminateMarker();
}
CodeMarker *CodeMarker::markerForCode(const QString &code)
@@ -110,12 +104,11 @@ CodeMarker *CodeMarker::markerForCode(const QString &code)
if (defaultMarker != nullptr && defaultMarker->recognizeCode(code))
return defaultMarker;
- QList<CodeMarker *>::ConstIterator m = markers.constBegin();
- while (m != markers.constEnd()) {
- if ((*m)->recognizeCode(code))
- return *m;
- ++m;
+ for (const auto &marker : qAsConst(markers)) {
+ if (marker->recognizeCode(code))
+ return marker;
}
+
return defaultMarker;
}
@@ -127,11 +120,9 @@ CodeMarker *CodeMarker::markerForFileName(const QString &fileName)
QString ext = fileName.mid(dot + 1);
if (defaultMarker != nullptr && defaultMarker->recognizeExtension(ext))
return defaultMarker;
- QList<CodeMarker *>::ConstIterator m = markers.constBegin();
- while (m != markers.constEnd()) {
- if ((*m)->recognizeExtension(ext))
- return *m;
- ++m;
+ for (const auto &marker : qAsConst(markers)) {
+ if (marker->recognizeExtension(ext))
+ return marker;
}
--dot;
}
@@ -140,11 +131,9 @@ CodeMarker *CodeMarker::markerForFileName(const QString &fileName)
CodeMarker *CodeMarker::markerForLanguage(const QString &lang)
{
- QList<CodeMarker *>::ConstIterator m = markers.constBegin();
- while (m != markers.constEnd()) {
- if ((*m)->recognizeLanguage(lang))
- return *m;
- ++m;
+ for (const auto &marker : qAsConst(markers)) {
+ if (marker->recognizeLanguage(lang))
+ return marker;
}
return nullptr;
}
diff --git a/src/qdoc/codemarker.h b/src/qdoc/codemarker.h
index 687d808df..4a6264ea6 100644
--- a/src/qdoc/codemarker.h
+++ b/src/qdoc/codemarker.h
@@ -86,7 +86,7 @@ private:
QString macName(const Node *parent, const QString &name = QString());
static QString defaultLang;
- static QList<CodeMarker *> markers;
+ static QVector<CodeMarker *> markers;
};
QT_END_NAMESPACE
diff --git a/src/qdoc/codeparser.cpp b/src/qdoc/codeparser.cpp
index 99bd5b1c8..b8d884a13 100644
--- a/src/qdoc/codeparser.cpp
+++ b/src/qdoc/codeparser.cpp
@@ -42,7 +42,7 @@
QT_BEGIN_NAMESPACE
-QList<CodeParser *> CodeParser::parsers;
+QVector<CodeParser *> CodeParser::parsers;
bool CodeParser::showInternal_ = false;
bool CodeParser::singleExec_ = false;
diff --git a/src/qdoc/codeparser.h b/src/qdoc/codeparser.h
index 78ef8c931..b9a85fb75 100644
--- a/src/qdoc/codeparser.h
+++ b/src/qdoc/codeparser.h
@@ -85,7 +85,7 @@ protected:
QDocDatabase *qdb_;
private:
- static QList<CodeParser *> parsers;
+ static QVector<CodeParser *> parsers;
static bool showInternal_;
static bool singleExec_;
};
diff --git a/src/qdoc/config.cpp b/src/qdoc/config.cpp
index 1ffcdd39a..079ffd0e5 100644
--- a/src/qdoc/config.cpp
+++ b/src/qdoc/config.cpp
@@ -200,18 +200,13 @@ void MetaStack::process(QChar ch, const Location &location)
location.fatal(tr("Unexpected '}'"));
top().close();
- QStringList suffixes = pop().accum;
- QStringList prefixes = top().next;
+ const QStringList suffixes = pop().accum;
+ const QStringList prefixes = top().next;
top().next.clear();
- QStringList::ConstIterator pre = prefixes.constBegin();
- while (pre != prefixes.constEnd()) {
- QStringList::ConstIterator suf = suffixes.constBegin();
- while (suf != suffixes.constEnd()) {
- top().next << (*pre + *suf);
- ++suf;
- }
- ++pre;
+ for (const auto &prefix : prefixes) {
+ for (const auto &suffix: suffixes)
+ top().next << prefix + suffix;
}
} else if (ch == QLatin1Char(',') && count() > 1) {
top().close();
@@ -220,11 +215,8 @@ void MetaStack::process(QChar ch, const Location &location)
/*
This is where all the processing is done.
*/
- QStringList::Iterator pre = top().next.begin();
- while (pre != top().next.end()) {
- *pre += ch;
- ++pre;
- }
+ for (auto it = top().next.begin(); it != top().next.end(); ++it)
+ *it += ch;
}
}
@@ -267,7 +259,7 @@ QMap<QString, QStringList> Config::includeFilesMap_;
Config::Config(const QString &programName, const QStringList &args)
: prog(programName)
{
- numInstances++;
+ ++numInstances;
processCommandLineOptions(args);
reset();
}
@@ -452,17 +444,13 @@ bool Config::getBool(const QString &var) const
*/
int Config::getInt(const QString &var) const
{
- QStringList strs = getStringList(var);
+ const QStringList strs = getStringList(var);
if (strs.isEmpty())
return -1;
- QStringList::ConstIterator s = strs.constBegin();
int sum = 0;
-
- while (s != strs.constEnd()) {
- sum += (*s).toInt();
- ++s;
- }
+ for (const auto &str : strs)
+ sum += str.toInt();
return sum;
}
@@ -655,16 +643,14 @@ QStringList Config::getCanonicalPathList(const QString &var, bool validate) cons
QRegExp Config::getRegExp(const QString &var) const
{
QString pattern;
- QList<QRegExp> subRegExps = getRegExpList(var);
- QList<QRegExp>::ConstIterator s = subRegExps.constBegin();
+ const QVector<QRegExp> subRegExps = getRegExpList(var);
- while (s != subRegExps.constEnd()) {
- if (!(*s).isValid())
- return *s;
+ for (const auto &regExp : subRegExps) {
+ if (!regExp.isValid())
+ return regExp;
if (!pattern.isEmpty())
pattern += QLatin1Char('|');
- pattern += QLatin1String("(?:") + (*s).pattern() + QLatin1Char(')');
- ++s;
+ pattern += QLatin1String("(?:") + regExp.pattern() + QLatin1Char(')');
}
if (pattern.isEmpty())
pattern = QLatin1String("$x"); // cannot match
@@ -676,16 +662,12 @@ QRegExp Config::getRegExp(const QString &var) const
map, converts the string list to a list of regular expressions,
and returns it.
*/
-QList<QRegExp> Config::getRegExpList(const QString &var) const
+QVector<QRegExp> Config::getRegExpList(const QString &var) const
{
- QStringList strs = getStringList(var);
- QStringList::ConstIterator s = strs.constBegin();
- QList<QRegExp> regExps;
-
- while (s != strs.constEnd()) {
- regExps += QRegExp(*s);
- ++s;
- }
+ const QStringList strs = getStringList(var);
+ QVector<QRegExp> regExps;
+ for (const auto &str : strs)
+ regExps += QRegExp(str);
return regExps;
}
@@ -699,17 +681,15 @@ QSet<QString> Config::subVars(const QString &var) const
{
QSet<QString> result;
QString varDot = var + QLatin1Char('.');
- ConfigVarMultimap::ConstIterator i = configVars_.constBegin();
- while (i != configVars_.constEnd()) {
- if (i.key().startsWith(varDot)) {
- QString subVar = i.key().mid(varDot.length());
+ for (auto it = configVars_.constBegin(); it != configVars_.constEnd(); ++it) {
+ if (it.key().startsWith(varDot)) {
+ QString subVar = it.key().mid(varDot.length());
int dot = subVar.indexOf(QLatin1Char('.'));
if (dot != -1)
subVar.truncate(dot);
if (!result.contains(subVar))
result.insert(subVar);
}
- ++i;
}
return result;
}
@@ -722,16 +702,14 @@ QSet<QString> Config::subVars(const QString &var) const
void Config::subVarsAndValues(const QString &var, ConfigVarMultimap &t) const
{
QString varDot = var + QLatin1Char('.');
- ConfigVarMultimap::ConstIterator v = configVars_.constBegin();
- while (v != configVars_.constEnd()) {
- if (v.key().startsWith(varDot)) {
- QString subVar = v.key().mid(varDot.length());
+ for (auto it = configVars_.constBegin(); it != configVars_.constEnd(); ++it) {
+ if (it.key().startsWith(varDot)) {
+ QString subVar = it.key().mid(varDot.length());
int dot = subVar.indexOf(QLatin1Char('.'));
if (dot != -1)
subVar.truncate(dot);
- t.insert(subVar,v.value());
+ t.insert(subVar, it.value());
}
- ++v;
}
}
@@ -746,18 +724,15 @@ QString Config::getIncludeFilePath(const QString &fileName) const
if (!includeFilesMap_.contains(ext)) {
QSet<QString> t;
QStringList result;
- QStringList dirs = getCanonicalPathList(CONFIG_SOURCEDIRS);
- QStringList::ConstIterator d = dirs.constBegin();
- while (d != dirs.constEnd()) {
- result += getFilesHere(*d, ext, location(), t, t);
- ++d;
- }
+ const QStringList dirs = getCanonicalPathList(CONFIG_SOURCEDIRS);
+ for (const auto &dir : dirs)
+ result += getFilesHere(dir, ext, location(), t, t);
includeFilesMap_.insert(ext, result);
}
const QStringList &paths = (*includeFilesMap_.find(ext));
- for (int i=0; i<paths.size(); ++i) {
- if (paths[i].endsWith(fileName))
- return paths[i];
+ for (const auto &path : paths) {
+ if (path.endsWith(fileName))
+ return path;
}
return QString();
}
@@ -777,15 +752,12 @@ QStringList Config::getAllFiles(const QString &filesVar,
const QSet<QString> &excludedFiles)
{
QStringList result = getCanonicalPathList(filesVar, true);
- QStringList dirs = getCanonicalPathList(dirsVar, true);
+ const QStringList dirs = getCanonicalPathList(dirsVar, true);
- QString nameFilter = getString(filesVar + dot + CONFIG_FILEEXTENSIONS);
+ const QString nameFilter = getString(filesVar + dot + CONFIG_FILEEXTENSIONS);
- QStringList::ConstIterator d = dirs.constBegin();
- while (d != dirs.constEnd()) {
- result += getFilesHere(*d, nameFilter, location(), excludedDirs, excludedFiles);
- ++d;
- }
+ for (const auto &dir : dirs)
+ result += getFilesHere(dir, nameFilter, location(), excludedDirs, excludedFiles);
return result;
}
@@ -793,14 +765,11 @@ QStringList Config::getExampleQdocFiles(const QSet<QString> &excludedDirs,
const QSet<QString> &excludedFiles)
{
QStringList result;
- QStringList dirs = getCanonicalPathList("exampledirs");
- QString nameFilter = " *.qdoc";
+ const QStringList dirs = getCanonicalPathList("exampledirs");
+ const QString nameFilter = " *.qdoc";
- QStringList::ConstIterator d = dirs.constBegin();
- while (d != dirs.constEnd()) {
- result += getFilesHere(*d, nameFilter, location(), excludedDirs, excludedFiles);
- ++d;
- }
+ for (const auto &dir : dirs)
+ result += getFilesHere(dir, nameFilter, location(), excludedDirs, excludedFiles);
return result;
}
@@ -808,14 +777,11 @@ QStringList Config::getExampleImageFiles(const QSet<QString> &excludedDirs,
const QSet<QString> &excludedFiles)
{
QStringList result;
- QStringList dirs = getCanonicalPathList("exampledirs");
- QString nameFilter = getString(CONFIG_EXAMPLES + dot + CONFIG_IMAGEEXTENSIONS);
+ const QStringList dirs = getCanonicalPathList("exampledirs");
+ const QString nameFilter = getString(CONFIG_EXAMPLES + dot + CONFIG_IMAGEEXTENSIONS);
- QStringList::ConstIterator d = dirs.constBegin();
- while (d != dirs.constEnd()) {
- result += getFilesHere(*d, nameFilter, location(), excludedDirs, excludedFiles);
- ++d;
- }
+ for (const auto &dir : dirs)
+ result += getFilesHere(dir, nameFilter, location(), excludedDirs, excludedFiles);
return result;
}
@@ -844,25 +810,21 @@ QString Config::findFile(const Location &location,
QStringList components = fileName.split(QLatin1Char('?'));
QString firstComponent = components.first();
- QStringList::ConstIterator f = files.constBegin();
- while (f != files.constEnd()) {
- if (*f == firstComponent ||
- (*f).endsWith(QLatin1Char('/') + firstComponent)) {
- fileInfo.setFile(*f);
+ for (const auto &file : files) {
+ if (file == firstComponent ||
+ file.endsWith(QLatin1Char('/') + firstComponent)) {
+ fileInfo.setFile(file);
if (!fileInfo.exists())
- location.fatal(tr("File '%1' does not exist").arg(*f));
+ location.fatal(tr("File '%1' does not exist").arg(file));
break;
}
- ++f;
}
if (fileInfo.fileName().isEmpty()) {
- QStringList::ConstIterator d = dirs.constBegin();
- while (d != dirs.constEnd()) {
- fileInfo.setFile(QDir(*d), firstComponent);
+ for (const auto &dir : dirs) {
+ fileInfo.setFile(QDir(dir), firstComponent);
if (fileInfo.exists())
break;
- ++d;
}
}
@@ -872,8 +834,7 @@ QString Config::findFile(const Location &location,
return QString();
if (userFriendlyFilePath) {
- QStringList::ConstIterator c = components.constBegin();
- for (;;) {
+ for (auto c = components.constBegin();;) {
bool isArchive = (c != components.constEnd() - 1);
userFriendlyFilePath->append(*c);
@@ -900,16 +861,14 @@ QString Config::findFile(const Location &location,
const QStringList &fileExtensions,
QString *userFriendlyFilePath)
{
- QStringList::ConstIterator e = fileExtensions.constBegin();
- while (e != fileExtensions.constEnd()) {
+ for (const auto &extension : fileExtensions) {
QString filePath = findFile(location,
files,
dirs,
- fileBase + QLatin1Char('.') + *e,
+ fileBase + QLatin1Char('.') + extension,
userFriendlyFilePath);
if (!filePath.isEmpty())
return filePath;
- ++e;
}
return findFile(location, files, dirs, fileBase, userFriendlyFilePath);
}
@@ -962,7 +921,7 @@ QString Config::copyFile(const Location &location,
int Config::numParams(const QString &value)
{
int max = 0;
- for (int i = 0; i != value.length(); i++) {
+ for (int i = 0; i != value.length(); ++i) {
uint c = value[i].unicode();
if (c > 0 && c < 8)
max = qMax(max, static_cast<int>(c));
@@ -978,28 +937,25 @@ int Config::numParams(const QString &value)
bool Config::removeDirContents(const QString &dir)
{
QDir dirInfo(dir);
- QFileInfoList entries = dirInfo.entryInfoList();
+ const QFileInfoList entries = dirInfo.entryInfoList();
bool ok = true;
- QFileInfoList::Iterator it = entries.begin();
- while (it != entries.end()) {
- if ((*it).isFile()) {
- if (!dirInfo.remove((*it).fileName()))
+ for (const auto &entry : entries) {
+ if (entry.isFile()) {
+ if (!dirInfo.remove(entry.fileName()))
ok = false;
}
- else if ((*it).isDir()) {
- if ((*it).fileName() != QLatin1String(".") && (*it).fileName() != QLatin1String("..")) {
- if (removeDirContents((*it).absoluteFilePath())) {
- if (!dirInfo.rmdir((*it).fileName()))
+ else if (entry.isDir()) {
+ if (entry.fileName() != QLatin1String(".") && entry.fileName() != QLatin1String("..")) {
+ if (removeDirContents(entry.absoluteFilePath())) {
+ if (!dirInfo.rmdir(entry.fileName()))
ok = false;
- }
- else {
+ } else {
ok = false;
}
}
}
- ++it;
}
return ok;
}
@@ -1131,7 +1087,7 @@ void Config::load(Location location, const QString &fileName)
SKIP_CHAR();
} while (isMetaKeyChar(c));
- QStringList keys = stack.getExpanded(location);
+ const QStringList keys = stack.getExpanded(location);
SKIP_SPACES();
if (keys.count() == 1 && keys.first() == QLatin1String("include")) {
@@ -1270,16 +1226,13 @@ void Config::load(Location location, const QString &fileName)
PUT_CHAR();
}
}
-
- QStringList::ConstIterator key = keys.constBegin();
- while (key != keys.constEnd()) {
- if (!keySyntax.exactMatch(*key))
- keyLoc.fatal(tr("Invalid key '%1'").arg(*key));
+ for (const auto &key : keys) {
+ if (!keySyntax.exactMatch(key))
+ keyLoc.fatal(tr("Invalid key '%1'").arg(key));
ConfigVarMultimap::Iterator i;
- i = configVars_.insert(*key, ConfigVar(*key, rhsValues, QDir::currentPath(), keyLoc));
+ i = configVars_.insert(key, ConfigVar(key, rhsValues, QDir::currentPath(), keyLoc));
i.value().plus_ = plus;
- ++key;
}
}
} else {
@@ -1315,32 +1268,25 @@ QStringList Config::getFilesHere(const QString &uncleanDir,
return result;
QDir dirInfo(dir);
- QStringList fileNames;
- QStringList::const_iterator fn;
dirInfo.setNameFilters(nameFilter.split(QLatin1Char(' ')));
dirInfo.setSorting(QDir::Name);
dirInfo.setFilter(QDir::Files);
- fileNames = dirInfo.entryList();
- fn = fileNames.constBegin();
- while (fn != fileNames.constEnd()) {
- if (!fn->startsWith(QLatin1Char('~'))) {
- QString s = dirInfo.filePath(*fn);
+ QStringList fileNames = dirInfo.entryList();
+ for (const auto &file: qAsConst(fileNames)) {
+ if (!file.startsWith(QLatin1Char('~'))) {
+ QString s = dirInfo.filePath(file);
QString c = QDir::cleanPath(s);
if (!isFileExcluded(c, excludedFiles))
result.append(c);
}
- ++fn;
}
dirInfo.setNameFilters(QStringList(QLatin1String("*")));
dirInfo.setFilter(QDir::Dirs|QDir::NoDotAndDotDot);
fileNames = dirInfo.entryList();
- fn = fileNames.constBegin();
- while (fn != fileNames.constEnd()) {
- result += getFilesHere(dirInfo.filePath(*fn), nameFilter, location, excludedDirs, excludedFiles);
- ++fn;
- }
+ for (const auto &file : fileNames)
+ result += getFilesHere(dirInfo.filePath(file), nameFilter, location, excludedDirs, excludedFiles);
return result;
}
diff --git a/src/qdoc/config.h b/src/qdoc/config.h
index 61ed53d87..7006f002a 100644
--- a/src/qdoc/config.h
+++ b/src/qdoc/config.h
@@ -100,7 +100,7 @@ public:
QStringList getStringList(const QString &var) const;
QStringList getCanonicalPathList(const QString &var, bool validate = false) const;
QRegExp getRegExp(const QString &var) const;
- QList<QRegExp> getRegExpList(const QString &var) const;
+ QVector<QRegExp> getRegExpList(const QString &var) const;
QSet<QString> subVars(const QString &var) const;
void subVarsAndValues(const QString &var, ConfigVarMultimap &t) const;
QStringList getAllFiles(const QString &filesVar,
diff --git a/src/qdoc/cppcodemarker.cpp b/src/qdoc/cppcodemarker.cpp
index a59654cfa..843e24db6 100644
--- a/src/qdoc/cppcodemarker.cpp
+++ b/src/qdoc/cppcodemarker.cpp
@@ -139,8 +139,9 @@ QString CppCodeMarker::markedUpSynopsis(const Node *node,
!node->parent()->isHeader() &&
!node->isProperty() &&
!node->isQmlNode() &&
- !node->isJsNode())
+ !node->isJsNode()) {
name.prepend(taggedNode(node->parent()) + "::");
+ }
}
switch (node->nodeType()) {
@@ -160,7 +161,7 @@ QString CppCodeMarker::markedUpSynopsis(const Node *node,
synopsis += QLatin1Char('(');
if (!func->parameters().isEmpty()) {
const Parameters &parameters = func->parameters();
- for (int i = 0; i < parameters.count(); i++) {
+ for (int i = 0; i < parameters.count(); ++i) {
if (i > 0)
synopsis += ", ";
QString name = parameters.at(i).name();
@@ -197,12 +198,10 @@ QString CppCodeMarker::markedUpSynopsis(const Node *node,
synopsis.append(" &");
else if (func->isRefRef())
synopsis.append(" &&");
- }
- else if (style == Section::AllMembers) {
+ } else if (style == Section::AllMembers) {
if (!func->returnType().isEmpty() && func->returnType() != "void")
synopsis += " : " + typified(func->returnType());
- }
- else {
+ } else {
if (func->isRef())
synopsis.append(" &");
else if (func->isRefRef())
@@ -220,19 +219,15 @@ QString CppCodeMarker::markedUpSynopsis(const Node *node,
bracketed += "virtual";
}
- if (func->access() == Node::Protected) {
+ if (func->access() == Node::Protected)
bracketed += "protected";
- }
- else if (func->access() == Node::Private) {
+ else if (func->access() == Node::Private)
bracketed += "private";
- }
- if (func->isSignal()) {
+ if (func->isSignal())
bracketed += "signal";
- }
- else if (func->isSlot()) {
+ else if (func->isSlot())
bracketed += "slot";
- }
if (!bracketed.isEmpty())
extra += QLatin1Char('[') + bracketed.join(' ') + QStringLiteral("] ");
}
@@ -259,15 +254,13 @@ QString CppCodeMarker::markedUpSynopsis(const Node *node,
synopsis += ", ";
synopsis += documentedItems.at(i);
}
- }
- else {
+ } else {
for (int i = 0; i < documentedItems.size(); ++i) {
if (i < MaxEnumValues-2 || i == documentedItems.size()-1) {
if (i != 0)
synopsis += ", ";
synopsis += documentedItems.at(i);
- }
- else if (i == MaxEnumValues - 1) {
+ } else if (i == MaxEnumValues - 1) {
synopsis += ", ...";
}
}
@@ -281,8 +274,7 @@ QString CppCodeMarker::markedUpSynopsis(const Node *node,
typedeff = static_cast<const TypedefNode *>(node);
if (typedeff->associatedEnum()) {
synopsis = "flags " + name;
- }
- else {
+ } else {
synopsis = "typedef " + name;
}
break;
@@ -294,8 +286,7 @@ QString CppCodeMarker::markedUpSynopsis(const Node *node,
variable = static_cast<const VariableNode *>(node);
if (style == Section::AllMembers) {
synopsis = name + " : " + typified(variable->dataType());
- }
- else {
+ } else {
synopsis = typified(variable->leftType(), true) +
name + protect(variable->rightType());
}
@@ -325,9 +316,9 @@ QString CppCodeMarker::markedUpSynopsis(const Node *node,
QString CppCodeMarker::markedUpQmlItem(const Node *node, bool summary)
{
QString name = taggedQmlNode(node);
- if (summary)
- name = linkTag(node,name);
- else if (node->isQmlProperty() || node->isJsProperty()) {
+ if (summary) {
+ name = linkTag(node, name);
+ } else if (node->isQmlProperty() || node->isJsProperty()) {
const QmlPropertyNode *pn = static_cast<const QmlPropertyNode *>(node);
if (pn->isAttached())
name.prepend(pn->element() + QLatin1Char('.'));
@@ -346,7 +337,7 @@ QString CppCodeMarker::markedUpQmlItem(const Node *node, bool summary)
synopsis += QLatin1Char('(');
if (!func->parameters().isEmpty()) {
const Parameters &parameters = func->parameters();
- for (int i = 0; i < parameters.count(); i++) {
+ for (int i = 0; i < parameters.count(); ++i) {
if (i > 0)
synopsis += ", ";
QString name = parameters.at(i).name();
@@ -362,8 +353,9 @@ QString CppCodeMarker::markedUpQmlItem(const Node *node, bool summary)
}
}
synopsis += QLatin1Char(')');
- } else
+ } else {
synopsis = name;
+ }
QString extra;
if (summary) {
@@ -392,20 +384,18 @@ QString CppCodeMarker::markedUpName(const Node *node)
QString CppCodeMarker::markedUpFullName(const Node *node, const Node *relative)
{
- if (node->name().isEmpty()) {
+ if (node->name().isEmpty())
return "global";
+
+ QString fullName;
+ for (;;) {
+ fullName.prepend(markedUpName(node));
+ if (node->parent() == relative || node->parent()->name().isEmpty())
+ break;
+ fullName.prepend("<@op>::</@op>");
+ node = node->parent();
}
- else {
- QString fullName;
- for (;;) {
- fullName.prepend(markedUpName(node));
- if (node->parent() == relative || node->parent()->name().isEmpty())
- break;
- fullName.prepend("<@op>::</@op>");
- node = node->parent();
- }
- return fullName;
- }
+ return fullName;
}
QString CppCodeMarker::markedUpEnumValue(const QString &enumValue, const Node *relative)
@@ -432,18 +422,15 @@ QString CppCodeMarker::markedUpIncludes(const QStringList &includes)
{
QString code;
- QStringList::ConstIterator inc = includes.constBegin();
- while (inc != includes.constEnd()) {
- code += "<@preprocessor>#include &lt;<@headerfile>" + *inc + "</@headerfile>&gt;</@preprocessor>\n";
- ++inc;
- }
+ for (const auto &include : includes)
+ code += "<@preprocessor>#include &lt;<@headerfile>"
+ + include + "</@headerfile>&gt;</@preprocessor>\n";
return code;
}
QString CppCodeMarker::functionBeginRegExp(const QString &funcName)
{
return QLatin1Char('^') + QRegExp::escape(funcName) + QLatin1Char('$');
-
}
QString CppCodeMarker::functionEndRegExp(const QString &/* funcName */)
@@ -508,7 +495,7 @@ QString CppCodeMarker::addMarkUp(const QString &in,
keywords.insert(keywordTable[j]);
}
#define readChar() \
- ch = (i < (int)code.length()) ? code[i++].cell() : EOF
+ ch = (i < code.length()) ? code[i++].cell() : EOF
QString code = in;
QString out;
@@ -620,12 +607,12 @@ QString CppCodeMarker::addMarkUp(const QString &in,
case '(':
finish = i;
readChar();
- parenDepth++;
+ ++parenDepth;
break;
case ')':
finish = i;
readChar();
- parenDepth--;
+ --parenDepth;
break;
case ':':
finish = i;
diff --git a/src/qdoc/cppcodeparser.cpp b/src/qdoc/cppcodeparser.cpp
index b05e2ab3c..ce92448de 100644
--- a/src/qdoc/cppcodeparser.cpp
+++ b/src/qdoc/cppcodeparser.cpp
@@ -710,17 +710,11 @@ void CppCodeParser::processMetaCommand(const Doc &doc,
*/
void CppCodeParser::processMetaCommands(const Doc &doc, Node *node)
{
- QStringList metaCommandsUsed = doc.metaCommandsUsed().values();
- metaCommandsUsed.sort(); // TODO: why are these sorted? mws 24/12/2018
- QStringList::ConstIterator cmd = metaCommandsUsed.constBegin();
- while (cmd != metaCommandsUsed.constEnd()) {
- ArgList args = doc.metaCommandArgs(*cmd);
- ArgList::ConstIterator arg = args.constBegin();
- while (arg != args.constEnd()) {
- processMetaCommand(doc, *cmd, *arg, node);
- ++arg;
- }
- ++cmd;
+ const QStringList metaCommandsUsed = doc.metaCommandsUsed().values();
+ for (const auto &command : metaCommandsUsed) {
+ const ArgList args = doc.metaCommandArgs(command);
+ for (const auto &arg : args)
+ processMetaCommand(doc, command, arg, node);
}
}
@@ -986,18 +980,17 @@ void CppCodeParser::processTopicArgs(const Doc &doc, const QString &topic, NodeL
}
} else if (args.size() > 1) {
QVector<SharedCommentNode *> sharedCommentNodes;
- ArgList::ConstIterator arg = args.constBegin();
- while (arg != args.constEnd()) {
+ for (const auto &arg : qAsConst(args)) {
node = nullptr;
if (topic == COMMAND_FN) {
if (showInternal() || !doc.isInternal())
- node = parserForLanguage("Clang")->parseFnArg(doc.location(), arg->first);
+ node = parserForLanguage("Clang")->parseFnArg(doc.location(), arg.first);
} else if (topic == COMMAND_MACRO) {
- node = parseMacroArg(doc.location(), arg->first);
+ node = parseMacroArg(doc.location(), arg.first);
} else if (isQMLMethodTopic(topic) || isJSMethodTopic(topic)) {
- node = parseOtherFuncArg(topic, doc.location(), arg->first);
+ node = parseOtherFuncArg(topic, doc.location(), arg.first);
} else {
- node = processTopicCommand(doc, topic, *arg);
+ node = processTopicCommand(doc, topic, arg);
}
if (node != nullptr) {
bool found = false;
@@ -1015,7 +1008,6 @@ void CppCodeParser::processTopicArgs(const Doc &doc, const QString &topic, NodeL
docs.append(doc);
}
}
- ++arg;
}
}
}
@@ -1023,15 +1015,14 @@ void CppCodeParser::processTopicArgs(const Doc &doc, const QString &topic, NodeL
void CppCodeParser::processMetaCommands(NodeList &nodes, DocList &docs)
{
- NodeList::Iterator n = nodes.begin();
- QList<Doc>::Iterator d = docs.begin();
- while (n != nodes.end()) {
- if (*n != nullptr) {
- processMetaCommands(*d, *n);
- (*n)->setDoc(*d);
- checkModuleInclusion(*n);
- if ((*n)->isAggregate()) {
- Aggregate *aggregate = static_cast<Aggregate *>(*n);
+ QVector<Doc>::Iterator d = docs.begin();
+ for (const auto &node : nodes) {
+ if (node != nullptr) {
+ processMetaCommands(*d, node);
+ node->setDoc(*d);
+ checkModuleInclusion(node);
+ if (node->isAggregate()) {
+ Aggregate *aggregate = static_cast<Aggregate *>(node);
if (aggregate->includeFiles().isEmpty()) {
Aggregate *parent = aggregate;
while (parent->physicalModuleName().isEmpty() && (parent->parent() != nullptr))
@@ -1044,7 +1035,6 @@ void CppCodeParser::processMetaCommands(NodeList &nodes, DocList &docs)
}
}
++d;
- ++n;
}
}
diff --git a/src/qdoc/doc.cpp b/src/qdoc/doc.cpp
index 90799bd8c..83033ca51 100644
--- a/src/qdoc/doc.cpp
+++ b/src/qdoc/doc.cpp
@@ -55,7 +55,7 @@ QT_BEGIN_NAMESPACE
Q_GLOBAL_STATIC(QSet<QString>, null_Set_QString)
Q_GLOBAL_STATIC(TopicList, nullTopicList)
Q_GLOBAL_STATIC(QStringList, null_QStringList)
-Q_GLOBAL_STATIC(QList<Text>, null_QList_Text)
+Q_GLOBAL_STATIC(QVector<Text>, null_QVector_Text)
Q_GLOBAL_STATIC(QStringMultiMap, null_QStringMultiMap)
struct Macro
@@ -298,10 +298,10 @@ class DocPrivateExtra
public:
Doc::Sections granularity_;
Doc::Sections section_; // ###
- QList<Atom *> tableOfContents_;
+ QVector<Atom *> tableOfContents_;
QVector<int> tableOfContentsLevels_;
- QList<Atom *> keywords_;
- QList<Atom *> targets_;
+ QVector<Atom *> keywords_;
+ QVector<Atom *> targets_;
QStringMultiMap metaMap_;
DocPrivateExtra()
@@ -349,7 +349,7 @@ public:
QString src;
Text text;
QSet<QString> params;
- QList<Text> alsoList;
+ QVector<Text> alsoList;
QStringList enumItemList;
QStringList omitEnumItemList;
QSet<QString> metacommandsUsed;
@@ -586,12 +586,12 @@ void DocParser::parse(const QString &source,
case '\\': {
QString cmdStr;
backslashPos = pos;
- pos++;
+ ++pos;
while (pos < len) {
ch = input_.at(pos);
if (ch.isLetterOrNumber()) {
cmdStr += ch;
- pos++;
+ ++pos;
}
else {
break;
@@ -1350,24 +1350,20 @@ void DocParser::parse(const QString &source,
} else if (macroHash()->contains(cmdStr)) {
const Macro &macro = macroHash()->value(cmdStr);
int numPendingFi = 0;
- QStringMap::ConstIterator d;
int numFormatDefs = 0;
QString matchExpr;
- d = macro.otherDefs.constBegin();
- while (d != macro.otherDefs.constEnd()) {
- if (d.key() == "match") {
- matchExpr = d.value();
- ++d;
+ for (auto it = macro.otherDefs.constBegin(); it != macro.otherDefs.constEnd(); ++it) {
+ if (it.key() == "match") {
+ matchExpr = it.value();
} else {
- append(Atom::FormatIf, d.key());
- expandMacro(cmdStr, *d, macro.numParams);
- ++d;
+ append(Atom::FormatIf, it.key());
+ expandMacro(cmdStr, *it, macro.numParams);
++numFormatDefs;
- if (d == macro.otherDefs.constEnd()) {
+ if (it == macro.otherDefs.constEnd()) {
append(Atom::FormatEndif);
} else {
append(Atom::FormatElse);
- numPendingFi++;
+ ++numPendingFi;
}
}
}
@@ -1456,23 +1452,23 @@ void DocParser::parse(const QString &source,
case '{':
enterPara();
appendChar('{');
- braceDepth++;
- pos++;
+ ++braceDepth;
+ ++pos;
break;
case '}': {
- braceDepth--;
- pos++;
+ --braceDepth;
+ ++pos;
- QMap<int, QString>::Iterator f = pendingFormats.find(braceDepth);
- if (f == pendingFormats.end()) {
+ auto format = pendingFormats.find(braceDepth);
+ if (format == pendingFormats.end()) {
enterPara();
appendChar('}');
} else {
- append(Atom::FormattingRight, *f);
- if (*f == ATOM_FORMATTING_INDEX) {
+ append(Atom::FormattingRight, *format);
+ if (*format == ATOM_FORMATTING_INDEX) {
if (indexStartedPara)
skipAllSpaces();
- } else if (*f == ATOM_FORMATTING_LINK) {
+ } else if (*format == ATOM_FORMATTING_LINK) {
// hack for C++ to support links like
// \l{QString::}{count()}
if (currentLinkAtom &&
@@ -1483,7 +1479,7 @@ void DocParser::parse(const QString &source,
}
currentLinkAtom = nullptr;
}
- pendingFormats.erase(f);
+ pendingFormats.erase(format);
}
break;
}
@@ -1646,7 +1642,7 @@ QString DocParser::detailsUnknownCommand(const QSet<QString> &metaCommandSet,
int i = 0;
while (cmds[i].english != nullptr) {
commandSet.insert(*cmds[i].alias);
- i++;
+ ++i;
}
if (aliasMap()->contains(str))
@@ -1761,14 +1757,12 @@ void DocParser::startFormat(const QString &format, int cmd)
{
enterPara();
- QMap<int, QString>::ConstIterator f = pendingFormats.constBegin();
- while (f != pendingFormats.constEnd()) {
- if (*f == format) {
+ for (const auto &item : qAsConst(pendingFormats)) {
+ if (item == format) {
location().warning(tr("Cannot nest '\\%1' commands")
.arg(cmdName(cmd)));
return;
}
- ++f;
}
append(Atom::FormattingLeft, format);
@@ -2141,7 +2135,7 @@ bool DocParser::expandMacro()
QString cmdStr;
int backslashPos = pos++;
- while (pos < (int) input_.length() && input_[pos].isLetterOrNumber())
+ while (pos < input_.length() && input_[pos].isLetterOrNumber())
cmdStr += input_[pos++];
endPos = pos;
@@ -2185,7 +2179,7 @@ void DocParser::expandMacro(const QString &name,
QStringList args;
QString rawString;
- for (int i = 0; i < numParams; i++) {
+ for (int i = 0; i < numParams; ++i) {
if (numParams == 1 || isLeftBraceAhead()) {
args << getArgument(true);
}
@@ -2227,7 +2221,7 @@ QString DocParser::expandMacroToString(const QString &name, const QString &def,
rawString = def;
} else {
QStringList args;
- for (int i = 0; i < numParams; i++) {
+ for (int i = 0; i < numParams; ++i) {
if (numParams == 1 || isLeftBraceAhead()) {
args << getArgument(true);
}
@@ -2307,20 +2301,20 @@ QString DocParser::getBracedArgument(bool verbatim)
{
QString arg;
int delimDepth = 0;
- if (pos < (int) input_.length() && input_[pos] == '{') {
- pos++;
- while (pos < (int) input_.length() && delimDepth >= 0) {
+ if (pos < input_.length() && input_[pos] == '{') {
+ ++pos;
+ while (pos < input_.length() && delimDepth >= 0) {
switch (input_[pos].unicode()) {
case '{':
- delimDepth++;
+ ++delimDepth;
arg += QLatin1Char('{');
- pos++;
+ ++pos;
break;
case '}':
- delimDepth--;
+ --delimDepth;
if (delimDepth >= 0)
arg += QLatin1Char('}');
- pos++;
+ ++pos;
break;
case '\\':
if (verbatim || !expandMacro())
@@ -2331,7 +2325,7 @@ QString DocParser::getBracedArgument(bool verbatim)
arg += QChar(' ');
else
arg += input_[pos];
- pos++;
+ ++pos;
}
}
if (delimDepth > 0)
@@ -2368,17 +2362,17 @@ QString DocParser::getArgument(bool verbatim)
case '(':
case '[':
case '{':
- delimDepth++;
+ ++delimDepth;
arg += input_[pos];
- pos++;
+ ++pos;
break;
case ')':
case ']':
case '}':
- delimDepth--;
+ --delimDepth;
if (pos == startPos || delimDepth >= 0) {
arg += input_[pos];
- pos++;
+ ++pos;
}
break;
case '\\':
@@ -2387,7 +2381,7 @@ QString DocParser::getArgument(bool verbatim)
break;
default:
arg += input_[pos];
- pos++;
+ ++pos;
}
}
endPos = pos;
@@ -2395,7 +2389,7 @@ QString DocParser::getArgument(bool verbatim)
(QString(".,:;!?").indexOf(input_[pos - 1]) != -1) &&
!arg.endsWith("...")) {
arg.truncate(arg.length() - 1);
- pos--;
+ --pos;
}
if (arg.length() > 2 && input_.mid(pos - 2, 2) == "'s") {
arg.truncate(arg.length() - 2);
@@ -2417,27 +2411,27 @@ QString DocParser::getBracketedArgument()
int delimDepth = 0;
skipSpacesOrOneEndl();
if (pos < input_.length() && input_[pos] == '[') {
- pos++;
+ ++pos;
while (pos < input_.length() && delimDepth >= 0) {
switch (input_[pos].unicode()) {
case '[':
- delimDepth++;
+ ++delimDepth;
arg += QLatin1Char('[');
- pos++;
+ ++pos;
break;
case ']':
- delimDepth--;
+ --delimDepth;
if (delimDepth >= 0)
arg += QLatin1Char(']');
- pos++;
+ ++pos;
break;
case '\\':
arg += input_[pos];
- pos++;
+ ++pos;
break;
default:
arg += input_[pos];
- pos++;
+ ++pos;
}
}
if (delimDepth > 0)
@@ -2449,7 +2443,7 @@ QString DocParser::getBracketedArgument()
QString DocParser::getOptionalArgument()
{
skipSpacesOrOneEndl();
- if (pos + 1 < (int) input_.length() && input_[pos] == '\\' &&
+ if (pos + 1 < input_.length() && input_[pos] == '\\' &&
input_[pos + 1].isLetterOrNumber()) {
return QString();
}
@@ -2592,7 +2586,7 @@ bool DocParser::isBlankLine()
while (i < len && input_[i].isSpace()) {
if (input_[i] == '\n')
return true;
- i++;
+ ++i;
}
return false;
}
@@ -2606,7 +2600,7 @@ bool DocParser::isLeftBraceAhead()
// ### bug with '\\'
if (input_[i] == '\n')
numEndl++;
- i++;
+ ++i;
}
return numEndl < 2 && i < len && input_[i] == '{';
}
@@ -2620,7 +2614,7 @@ bool DocParser::isLeftBracketAhead()
// ### bug with '\\'
if (input_[i] == '\n')
numEndl++;
- i++;
+ ++i;
}
return numEndl < 2 && i < len && input_[i] == '[';
}
@@ -2642,7 +2636,7 @@ void DocParser::skipSpacesOnLine()
void DocParser::skipSpacesOrOneEndl()
{
int firstEndl = -1;
- while (pos < (int) input_.length() && input_[pos].isSpace()) {
+ while (pos < input_.length() && input_[pos].isSpace()) {
QChar ch = input_[pos];
if (ch == '\n') {
if (firstEndl == -1) {
@@ -2653,14 +2647,14 @@ void DocParser::skipSpacesOrOneEndl()
break;
}
}
- pos++;
+ ++pos;
}
}
void DocParser::skipAllSpaces()
{
while (pos < len && input_[pos].isSpace())
- pos++;
+ ++pos;
}
void DocParser::skipToNextPreprocessorCommand()
@@ -2746,7 +2740,7 @@ QString DocParser::untabifyEtc(const QString &str)
result.reserve(str.length());
int column = 0;
- for (int i = 0; i < str.length(); i++) {
+ for (int i = 0; i < str.length(); ++i) {
const QChar c = str.at(i);
if (c == QLatin1Char('\r'))
continue;
@@ -2763,7 +2757,7 @@ QString DocParser::untabifyEtc(const QString &str)
continue;
}
result += c;
- column++;
+ ++column;
}
while (result.endsWith("\n\n"))
@@ -2779,14 +2773,14 @@ int DocParser::indentLevel(const QString &str)
int minIndent = INT_MAX;
int column = 0;
- for (int i = 0; i < (int) str.length(); i++) {
+ for (int i = 0; i < str.length(); ++i) {
if (str[i] == '\n') {
column = 0;
}
else {
if (str[i] != ' ' && column < minIndent)
minIndent = column;
- column++;
+ ++column;
}
}
return minIndent;
@@ -2800,7 +2794,7 @@ QString DocParser::unindent(int level, const QString &str)
QString t;
int column = 0;
- for (int i = 0; i < (int) str.length(); i++) {
+ for (int i = 0; i < str.length(); ++i) {
if (str[i] == QLatin1Char('\n')) {
t += '\n';
column = 0;
@@ -2808,7 +2802,7 @@ QString DocParser::unindent(int level, const QString &str)
else {
if (column >= level)
t += str[i];
- column++;
+ ++column;
}
}
return t;
@@ -3104,9 +3098,9 @@ ArgList Doc::metaCommandArgs(const QString &metacommand) const
return priv == nullptr ? ArgList() : priv->metaCommandMap.value(metacommand);
}
-const QList<Text> &Doc::alsoList() const
+const QVector<Text> &Doc::alsoList() const
{
- return priv == nullptr ? *null_QList_Text() : priv->alsoList;
+ return priv == nullptr ? *null_QVector_Text() : priv->alsoList;
}
bool Doc::hasTableOfContents() const
@@ -3124,7 +3118,7 @@ bool Doc::hasTargets() const
return priv && priv->extra && !priv->extra->targets_.isEmpty();
}
-const QList<Atom *> &Doc::tableOfContents() const
+const QVector<Atom *> &Doc::tableOfContents() const
{
priv->constructExtra();
return priv->extra->tableOfContents_;
@@ -3136,13 +3130,13 @@ const QVector<int> &Doc::tableOfContentsLevels() const
return priv->extra->tableOfContentsLevels_;
}
-const QList<Atom *> &Doc::keywords() const
+const QVector<Atom *> &Doc::keywords() const
{
priv->constructExtra();
return priv->extra->keywords_;
}
-const QList<Atom *> &Doc::targets() const
+const QVector<Atom *> &Doc::targets() const
{
priv->constructExtra();
return priv->extra->targets_;
@@ -3188,7 +3182,7 @@ void Doc::initialize(const Config &config)
if (cmds[i].no != i)
Location::internalError(tr("command %1 missing").arg(i));
- i++;
+ ++i;
}
for (const auto &macroName : config.subVars(CONFIG_MACRO)) {
@@ -3279,7 +3273,7 @@ void Doc::trimCStyleComment(Location &location, QString &str)
int asterColumn = location.columnNo() + 1;
int i;
- for (i = 0; i < (int) str.length(); i++) {
+ for (i = 0; i < str.length(); ++i) {
if (m.columnNo() == asterColumn) {
if (str[i] != '*')
break;
@@ -3299,7 +3293,7 @@ void Doc::trimCStyleComment(Location &location, QString &str)
if (cleaned.length() == str.length())
str = cleaned;
- for (int i = 0; i < 3; i++)
+ for (int i = 0; i < 3; ++i)
location.advance(str[i]);
str = str.mid(3, str.length() - 5);
}
diff --git a/src/qdoc/doc.h b/src/qdoc/doc.h
index d67275565..38c469ee3 100644
--- a/src/qdoc/doc.h
+++ b/src/qdoc/doc.h
@@ -50,7 +50,7 @@ class Text;
class DitaRef;
typedef QPair<QString, Location> ArgLocPair;
-typedef QList<ArgLocPair> ArgList;
+typedef QVector<ArgLocPair> ArgList;
typedef QMap<QString, QString> QStringMap;
typedef QMultiMap<QString, QString> QStringMultiMap;
@@ -63,9 +63,9 @@ struct Topic
bool isEmpty() const { return topic.isEmpty(); }
void clear() { topic.clear(); args.clear(); }
};
-typedef QList<Topic> TopicList;
+typedef QVector<Topic> TopicList;
-typedef QList<DitaRef *> DitaRefList;
+typedef QVector<DitaRef *> DitaRefList;
class DitaRef
{
@@ -154,16 +154,16 @@ public:
const QSet<QString> &metaCommandsUsed() const;
const TopicList &topicsUsed() const;
ArgList metaCommandArgs(const QString &metaCommand) const;
- const QList<Text> &alsoList() const;
+ const QVector<Text> &alsoList() const;
bool hasTableOfContents() const;
bool hasKeywords() const;
bool hasTargets() const;
bool isInternal() const;
bool isMarkedReimp() const;
- const QList<Atom *> &tableOfContents() const;
+ const QVector<Atom *> &tableOfContents() const;
const QVector<int> &tableOfContentsLevels() const;
- const QList<Atom *> &keywords() const;
- const QList<Atom *> &targets() const;
+ const QVector<Atom *> &keywords() const;
+ const QVector<Atom *> &targets() const;
const QStringMultiMap &metaTagMap() const;
static void initialize(const Config &config);
@@ -184,7 +184,7 @@ private:
static const Config *config_;
};
Q_DECLARE_TYPEINFO(Doc, Q_MOVABLE_TYPE);
-typedef QList<Doc> DocList;
+typedef QVector<Doc> DocList;
QT_END_NAMESPACE
diff --git a/src/qdoc/editdistance.cpp b/src/qdoc/editdistance.cpp
index c96071bf0..ff4630e15 100644
--- a/src/qdoc/editdistance.cpp
+++ b/src/qdoc/editdistance.cpp
@@ -44,12 +44,12 @@ int editDistance(const QString &s, const QString &t)
int *d = new int[m * n];
int result;
- for ( i = 0; i < m; i++ )
+ for (i = 0; i < m; ++i)
D( i, 0 ) = i;
- for ( j = 0; j < n; j++ )
+ for (j = 0; j < n; ++j)
D( 0, j ) = j;
- for ( i = 1; i < m; i++ ) {
- for ( j = 1; j < n; j++ ) {
+ for (i = 1; i < m; ++i) {
+ for (j = 1; j < n; ++j) {
if ( s[i - 1] == t[j - 1] ) {
D( i, j ) = D( i - 1, j - 1 );
} else {
@@ -75,19 +75,17 @@ QString nearestName(const QString &actual, const QSet<QString> &candidates)
int numBest = 0;
QString best;
- QSet<QString>::ConstIterator c = candidates.constBegin();
- while (c != candidates.constEnd()) {
- if ((*c)[0] == actual[0]) {
- int delta = editDistance(actual, *c);
+ for (const auto &candidate : candidates) {
+ if (candidate[0] == actual[0]) {
+ int delta = editDistance(actual, candidate);
if (delta < deltaBest) {
deltaBest = delta;
numBest = 1;
- best = *c;
+ best = candidate;
} else if (delta == deltaBest) {
- numBest++;
+ ++numBest;
}
}
- ++c;
}
if (numBest == 1 && deltaBest <= 2 && actual.length() + best.length() >= 5)
diff --git a/src/qdoc/generator.cpp b/src/qdoc/generator.cpp
index 184b1f67a..fe2b56b7a 100644
--- a/src/qdoc/generator.cpp
+++ b/src/qdoc/generator.cpp
@@ -36,6 +36,7 @@
#include "doc.h"
#include "editdistance.h"
#include "loggingcategory.h"
+#include "node.h"
#include "openedlist.h"
#include "qdocdatabase.h"
#include "quoter.h"
@@ -56,7 +57,7 @@ QStringList Generator::exampleDirs;
QStringList Generator::exampleImgExts;
QMap<QString, QMap<QString, QString> > Generator::fmtLeftMaps;
QMap<QString, QMap<QString, QString> > Generator::fmtRightMaps;
-QList<Generator *> Generator::generators;
+QVector<Generator *> Generator::generators;
QStringList Generator::imageDirs;
QStringList Generator::imageFiles;
QMap<QString, QStringList> Generator::imgFileExts;
@@ -144,12 +145,10 @@ void Generator::appendFullName(Text &text,
void Generator::appendFullNames(Text &text, const NodeList &nodes, const Node *relative)
{
- NodeList::ConstIterator n = nodes.constBegin();
int index = 0;
- while (n != nodes.constEnd()) {
- appendFullName(text,*n,relative);
+ for (const auto &node : nodes) {
+ appendFullName(text, node, relative);
text << comma(index++,nodes.count());
- ++n;
}
}
@@ -176,35 +175,29 @@ void Generator::signatureList(const NodeList &nodes, const Node *relative, CodeM
Text text;
int count = 0;
text << Atom(Atom::ListLeft, QString("bullet"));
- NodeList::ConstIterator n = nodes.constBegin();
- while (n != nodes.constEnd()) {
+ for (const auto &node: nodes) {
text << Atom(Atom::ListItemNumber, QString::number(++count));
text << Atom(Atom::ListItemLeft, QString("bullet"));
- appendSignature(text, *n);
+ appendSignature(text, node);
text << Atom(Atom::ListItemRight, QString("bullet"));
- ++n;
}
text << Atom(Atom::ListRight, QString("bullet"));
generateText(text, relative, marker);
}
-int Generator::appendSortedNames(Text &text, const ClassNode *cn, const QList<RelatedClass> &rc)
+int Generator::appendSortedNames(Text &text, const ClassNode *cn, const QVector<RelatedClass> &rc)
{
- QList<RelatedClass>::ConstIterator r;
QMap<QString,Text> classMap;
- int index = 0;
-
- r = rc.constBegin();
- while (r != rc.constEnd()) {
- ClassNode *rcn = (*r).node_;
+ for (const auto &relatedClass : rc) {
+ ClassNode *rcn = relatedClass.node_;
if (rcn && rcn->isInAPI()) {
Text className;
appendFullName(className, rcn, cn);
classMap[className.toString().toLower()] = className;
}
- ++r;
}
+ int index = 0;
const QStringList classNames = classMap.keys();
for (const auto &className : classNames) {
text << classMap[className];
@@ -216,17 +209,17 @@ int Generator::appendSortedNames(Text &text, const ClassNode *cn, const QList<Re
int Generator::appendSortedQmlNames(Text &text, const Node *base, const NodeList &subs)
{
QMap<QString,Text> classMap;
- int index = 0;
- for (int i = 0; i < subs.size(); ++i) {
- Text t;
- if (!base->isQtQuickNode() || !subs[i]->isQtQuickNode() ||
- (base->logicalModuleName() == subs[i]->logicalModuleName())) {
- appendFullName(t, subs[i], base);
- classMap[t.toString().toLower()] = t;
+ for (const auto sub : subs) {
+ Text text;
+ if (!base->isQtQuickNode() || !sub->isQtQuickNode() ||
+ (base->logicalModuleName() == sub->logicalModuleName())) {
+ appendFullName(text, sub, base);
+ classMap[text.toString().toLower()] = text;
}
}
+ int index = 0;
const QStringList names = classMap.keys();
for (const auto &name : names) {
text << classMap[name];
@@ -251,30 +244,49 @@ void Generator::writeOutFileNames()
}
/*!
- Creates the file named \a fileName in the output directory.
- Attaches a QTextStream to the created file, which is written
- to all over the place using out(). This function does not
- store the \a fileName in the \a node as the output file name.
+ Creates the file named \a fileName in the output directory
+ and returns a QFile pointing to this file. In particular,
+ this method deals with errors when opening the file:
+ the returned QFile is always valid and can be written to.
- \sa beginSubPage()
+ \sa beginFilePage()
*/
-void Generator::beginFilePage(const Node *node, const QString &fileName)
+QFile *Generator::openSubPageFile(const Node *node, const QString &fileName)
{
QString path = outputDir() + QLatin1Char('/');
if (Generator::useOutputSubdirs() && !node->outputSubdirectory().isEmpty() &&
- !outputDir().endsWith(node->outputSubdirectory()))
+ !outputDir().endsWith(node->outputSubdirectory())) {
path += node->outputSubdirectory() + QLatin1Char('/');
+ }
path += fileName;
- QFile* outFile = new QFile(redirectDocumentationToDevNull_ ? QStringLiteral("/dev/null") : path);
- if (!redirectDocumentationToDevNull_ && outFile->exists())
- node->location().error(tr("Output file already exists; overwriting %1").arg(outFile->fileName()));
- if (!outFile->open(QFile::WriteOnly))
- node->location().fatal(tr("Cannot open output file '%1'").arg(outFile->fileName()));
+ auto outPath = redirectDocumentationToDevNull_ ? QStringLiteral("/dev/null") : path;
+ auto outFile = new QFile(outPath);
+ if (!redirectDocumentationToDevNull_ && outFile->exists()) {
+ node->location().error(
+ tr("Output file already exists; overwriting %1").arg(outFile->fileName()));
+ }
+ if (!outFile->open(QFile::WriteOnly)) {
+ node->location().fatal(
+ tr("Cannot open output file '%1'").arg(outFile->fileName()));
+ }
qCDebug(lcQdoc, "Writing: %s", qPrintable(path));
outFileNames_ << fileName;
- QTextStream* out = new QTextStream(outFile);
+ return outFile;
+}
+/*!
+ Creates the file named \a fileName in the output directory.
+ Attaches a QTextStream to the created file, which is written
+ to all over the place using out(). This function does not
+ store the \a fileName in the \a node as the output file name.
+
+ \sa beginSubPage()
+ */
+void Generator::beginFilePage(const Node *node, const QString &fileName)
+{
+ QFile *outFile = openSubPageFile(node, fileName);
+ QTextStream* out = new QTextStream(outFile);
#ifndef QT_NO_TEXTCODEC
if (outputCodec)
out->setCodec(outputCodec);
@@ -704,7 +716,7 @@ QString Generator::fullDocumentLocation(const Node *node, bool useSubdir)
void Generator::generateAlsoList(const Node *node, CodeMarker *marker)
{
- QList<Text> alsoList = node->doc().alsoList();
+ QVector<Text> alsoList = node->doc().alsoList();
supplementAlsoList(node, alsoList);
if (!alsoList.isEmpty()) {
@@ -867,66 +879,56 @@ void Generator::generateBody(const Node *node, CodeMarker *marker)
const EnumNode *enume = static_cast<const EnumNode *>(node);
QSet<QString> definedItems;
- QList<EnumItem>::ConstIterator it = enume->items().constBegin();
- while (it != enume->items().constEnd()) {
- definedItems.insert((*it).name());
- ++it;
- }
+ const QVector<EnumItem> &items = enume->items();
+ for (const auto &item : items)
+ definedItems.insert(item.name());
const auto &documentedItemList = enume->doc().enumItemNames();
QSet<QString> documentedItems(documentedItemList.cbegin(), documentedItemList.cend());
- QSet<QString> allItems = definedItems + documentedItems;
+ const QSet<QString> allItems = definedItems + documentedItems;
if (allItems.count() > definedItems.count() ||
allItems.count() > documentedItems.count()) {
- QSet<QString>::ConstIterator a = allItems.constBegin();
- while (a != allItems.constEnd()) {
- if (!definedItems.contains(*a)) {
+ for (const auto &it : allItems) {
+ if (!definedItems.contains(it)) {
QString details;
- QString best = nearestName(*a, definedItems);
+ QString best = nearestName(it, definedItems);
if (!best.isEmpty() && !documentedItems.contains(best))
details = tr("Maybe you meant '%1'?").arg(best);
node->doc().location().warning(tr("No such enum item '%1' in %2")
- .arg(*a).arg(node->plainFullName()), details);
- }
- else if (!documentedItems.contains(*a)) {
+ .arg(it).arg(node->plainFullName()), details);
+ } else if (!documentedItems.contains(it)) {
node->doc().location().warning(tr("Undocumented enum item '%1' in %2")
- .arg(*a).arg(node->plainFullName()));
+ .arg(it).arg(node->plainFullName()));
}
- ++a;
}
}
} else if (node->isFunction()) {
const FunctionNode *fn = static_cast<const FunctionNode *>(node);
- QSet<QString> declaredNames;
- fn->parameters().getNames(declaredNames);
- QSet<QString> documentedNames = fn->doc().parameterNames();
+ const QSet<QString> declaredNames = fn->parameters().getNames();
+ const QSet<QString> documentedNames = fn->doc().parameterNames();
if (declaredNames != documentedNames) {
- QSet<QString>::const_iterator i = declaredNames.constBegin();
- while (i != declaredNames.constEnd()) {
- if (!documentedNames.contains(*i)) {
+ for (const auto &name : declaredNames) {
+ if (!documentedNames.contains(name)) {
if (fn->isActive() || fn->isPreliminary()) {
if (!fn->isMarkedReimp() && !fn->isOverload()) {
fn->doc().location().warning(
tr("Undocumented parameter '%1' in %2")
- .arg(*i).arg(node->plainFullName()));
+ .arg(name).arg(node->plainFullName()));
}
}
}
- ++i;
}
- i = documentedNames.constBegin();
- while (i != documentedNames.constEnd()) {
- if (!declaredNames.contains(*i)) {
- QString best = nearestName(*i, declaredNames);
+ for (const auto &name : documentedNames) {
+ if (!declaredNames.contains(name)) {
+ QString best = nearestName(name, declaredNames);
QString details;
if (!best.isEmpty())
details = tr("Maybe you meant '%1'?").arg(best);
fn->doc().location().warning(tr("No such parameter '%1' in %2")
- .arg(*i).arg(fn->plainFullName()),
+ .arg(name).arg(fn->plainFullName()),
details);
}
- ++i;
}
}
/*
@@ -1014,6 +1016,25 @@ void Generator::generateLinkToExample(const ExampleNode *en,
generateText(text, nullptr, marker);
}
+void Generator::addImageToCopy(const ExampleNode *en, const QString &file)
+{
+ QDir dirInfo;
+ QString userFriendlyFilePath;
+ const QString prefix("/images/used-in-examples/");
+ QString srcPath = Config::findFile(en->location(),
+ QStringList(),
+ exampleDirs,
+ file,
+ exampleImgExts,
+ &userFriendlyFilePath);
+ outFileNames_ << prefix.mid(1) + userFriendlyFilePath;
+ userFriendlyFilePath.truncate(userFriendlyFilePath.lastIndexOf('/'));
+ QString imgOutDir = outDir_ + prefix + userFriendlyFilePath;
+ if (!dirInfo.mkpath(imgOutDir))
+ en->location().fatal(tr("Cannot create output directory '%1'").arg(imgOutDir));
+ Config::copyFile(en->location(), srcPath, file, imgOutDir);
+}
+
/*!
This function is called when the documentation for an example is
being formatted. It outputs a list of files for the example, which
@@ -1045,26 +1066,9 @@ void Generator::generateFileList(const ExampleNode *en, CodeMarker *marker, bool
QString path;
for (const auto &file : qAsConst(paths)) {
if (images) {
- if (!file.isEmpty()) {
- QDir dirInfo;
- QString userFriendlyFilePath;
- const QString prefix("/images/used-in-examples/");
- QString srcPath = Config::findFile(en->location(),
- QStringList(),
- exampleDirs,
- file,
- exampleImgExts,
- &userFriendlyFilePath);
- outFileNames_ << prefix.mid(1) + userFriendlyFilePath;
- userFriendlyFilePath.truncate(userFriendlyFilePath.lastIndexOf('/'));
- QString imgOutDir = outDir_ + prefix + userFriendlyFilePath;
- if (!dirInfo.mkpath(imgOutDir))
- en->location().fatal(tr("Cannot create output directory '%1'").arg(imgOutDir));
- Config::copyFile(en->location(), srcPath, file, imgOutDir);
- }
-
- }
- else {
+ if (!file.isEmpty())
+ addImageToCopy(en, file);
+ } else {
generateExampleFilePage(en, file, marker);
}
@@ -1102,9 +1106,6 @@ void Generator::generateInheritedBy(const ClassNode *classe, CodeMarker *marker)
void Generator::generateInherits(const ClassNode *classe, CodeMarker *marker)
{
- QList<RelatedClass>::ConstIterator r;
- int index;
-
if (!classe->baseClasses().isEmpty()) {
Text text;
text << Atom::ParaLeft
@@ -1112,21 +1113,20 @@ void Generator::generateInherits(const ClassNode *classe, CodeMarker *marker)
<< "Inherits: "
<< Atom(Atom::FormattingRight,ATOM_FORMATTING_BOLD);
- r = classe->baseClasses().constBegin();
- index = 0;
- while (r != classe->baseClasses().constEnd()) {
- if ((*r).node_) {
- appendFullName(text, (*r).node_, classe);
+ int index = 0;
+ const QVector<RelatedClass> &baseClasses = classe->baseClasses();
+ for (const auto &cls : baseClasses) {
+ if (cls.node_) {
+ appendFullName(text, cls.node_, classe);
- if ((*r).access_ == Node::Protected) {
+ if (cls.access_ == Node::Protected) {
text << " (protected)";
}
- else if ((*r).access_ == Node::Private) {
+ else if (cls.access_ == Node::Private) {
text << " (private)";
}
text << separator(index++, classe->baseClasses().count());
}
- ++r;
}
text << Atom::ParaRight;
generateText(text, classe, marker);
@@ -1476,15 +1476,15 @@ bool Generator::generateText(const Text &text,
nonreentrant, and true is returned. If there are no exceptions,
the three node lists remain empty and false is returned.
*/
-static bool hasExceptions(const Node *node,
- NodeList &reentrant,
- NodeList &threadsafe,
- NodeList &nonreentrant)
+bool Generator::hasExceptions(const Node *node,
+ NodeList &reentrant,
+ NodeList &threadsafe,
+ NodeList &nonreentrant)
{
bool result = false;
Node::ThreadSafeness ts = node->threadSafeness();
const NodeList &children = static_cast<const Aggregate *>(node)->childNodes();
- for (auto *child : children) {
+ for (auto child : children) {
if (!child->isObsolete()){
switch (child->threadSafeness()) {
case Node::Reentrant:
@@ -1632,19 +1632,16 @@ void Generator::generateThreadSafeness(const Node *node, CodeMarker *marker)
}
/*!
- If the node is an overloaded signal, and a node with an example on how to connect to it
-
- Someone didn't finish writing this comment, and I don't know what this
- function is supposed to do, so I have not tried to complete the comment
- yet.
+ Returns the string containing an example code of the input node,
+ if it is an overloaded signal. Otherwise, returns an empty string.
*/
-void Generator::generateOverloadedSignal(const Node *node, CodeMarker *marker)
+QString Generator::getOverloadedSignalCode(const Node *node)
{
if (!node->isFunction())
- return;
- const FunctionNode *func = static_cast<const FunctionNode *>(node);
+ return QString();
+ const auto func = static_cast<const FunctionNode *>(node);
if (!func->isSignal() || !func->hasOverloads())
- return;
+ return QString();
// Compute a friendly name for the object of that instance.
// e.g: "QAbstractSocket" -> "abstractSocket"
@@ -1656,16 +1653,31 @@ void Generator::generateOverloadedSignal(const Node *node, CodeMarker *marker)
}
// We have an overloaded signal, show an example. Note, for const
- // overloaded signals one should use Q{Const,NonConst}Overload, but
+ // overloaded signals, one should use Q{Const,NonConst}Overload, but
// it is very unlikely that we will ever have public API overloading
// signals by const.
QString code = "connect(" + objectName + ", QOverload<";
- func->parameters().getTypeList(code);
+ code += func->parameters().generateTypeList();
code += ">::of(&" + func->parent()->name() + "::" + func->name() + "),\n [=](";
- func->parameters().getTypeAndNameList(code);
-
+ code += func->parameters().generateTypeAndNameList();
code += "){ /* ... */ });";
+ return code;
+}
+
+/*!
+ If the node is an overloaded signal, and a node with an example on how to connect to it
+
+ Someone didn't finish writing this comment, and I don't know what this
+ function is supposed to do, so I have not tried to complete the comment
+ yet.
+ */
+void Generator::generateOverloadedSignal(const Node *node, CodeMarker *marker)
+{
+ QString code = getOverloadedSignalCode(node);
+ if (code.isEmpty())
+ return;
+
Text text;
text << Atom::ParaLeft
<< Atom(Atom::FormattingLeft, ATOM_FORMATTING_BOLD)
@@ -1679,12 +1691,11 @@ void Generator::generateOverloadedSignal(const Node *node, CodeMarker *marker)
"To connect to this signal by using the function pointer syntax, Qt "
"provides a convenient helper for obtaining the function pointer as "
"shown in this example:"
- << Atom(Atom::Code, marker->markedUpCode(code, node, func->location()));
+ << Atom(Atom::Code, marker->markedUpCode(code, node, node->location()));
generateText(text, node, marker);
}
-
/*!
Traverses the database recursively to generate all the documentation.
*/
@@ -1696,32 +1707,29 @@ void Generator::generateDocs()
Generator *Generator::generatorForFormat(const QString &format)
{
- QList<Generator *>::ConstIterator g = generators.constBegin();
- while (g != generators.constEnd()) {
- if ((*g)->format() == format)
- return *g;
- ++g;
+ for (const auto &generator : qAsConst(generators)) {
+ if (generator->format() == format)
+ return generator;
}
return nullptr;
}
/*!
- Looks up the tag \a t in the map of metadata values for the
+ Looks up the tag \a tag in the map of metadata values for the
current topic in \a inner. If a value for the tag is found,
the value is returned.
- \note If \a t is found in the metadata map, it is erased.
- i.e. Once you call this function for a particular \a t,
- you consume \a t.
+ \note If \a tag is found in the metadata map, it is erased.
+ i.e. Once you call this function for a particular \a tag,
+ you consume \a tag.
*/
-QString Generator::getMetadataElement(const Aggregate *inner, const QString &t)
+QString Generator::getMetadataElement(const Aggregate *inner, const QString &tag)
{
QString s;
- QStringMultiMap& metaTagMap = const_cast<QStringMultiMap&>(inner->doc().metaTagMap());
- QStringMultiMap::iterator i = metaTagMap.find(t);
- if (i != metaTagMap.end()) {
- s = i.value();
- metaTagMap.erase(i);
+ QStringMultiMap &metaTagMap = const_cast<QStringMultiMap &>(inner->doc().metaTagMap());
+ for (auto it = metaTagMap.find(tag); it != metaTagMap.end();) {
+ s = it.value();
+ metaTagMap.erase(it);
}
return s;
}
@@ -1954,11 +1962,8 @@ void Generator::augmentImageDirs(QSet<QString> &moreImageDirs)
{
if (moreImageDirs.isEmpty())
return;
- QSet<QString>::const_iterator i = moreImageDirs.begin();
- while (i != moreImageDirs.end()) {
- imageDirs.append(*i);
- ++i;
- }
+ for (const auto &it : moreImageDirs)
+ imageDirs.append(it);
}
/*!
@@ -2158,7 +2163,7 @@ void Generator::initializeTextOutput()
sectionNumber_.clear();
}
-void Generator::supplementAlsoList(const Node *node, QList<Text> &alsoList)
+void Generator::supplementAlsoList(const Node *node, QVector<Text> &alsoList)
{
if (node->isFunction() && !node->isMacro()) {
const auto fn = static_cast<const FunctionNode *>(node);
@@ -2211,11 +2216,9 @@ void Generator::supplementAlsoList(const Node *node, QList<Text> &alsoList)
void Generator::terminate()
{
- QList<Generator *>::ConstIterator g = generators.constBegin();
- while (g != generators.constEnd()) {
- if (outputFormats.contains((*g)->format()))
- (*g)->terminateGenerator();
- ++g;
+ for (const auto &generator : qAsConst(generators)) {
+ if (outputFormats.contains(generator->format()))
+ generator->terminateGenerator();
}
fmtLeftMaps.clear();
@@ -2267,7 +2270,7 @@ QString Generator::typeString(const Node *node)
case Node::Typedef:
return "typedef";
case Node::Function: {
- const FunctionNode *fn = static_cast<const FunctionNode *>(node);
+ const auto fn = static_cast<const FunctionNode *>(node);
switch (fn->metaness()) {
case FunctionNode::JsSignal:
case FunctionNode::QmlSignal:
diff --git a/src/qdoc/generator.h b/src/qdoc/generator.h
index f90c82315..2ed902ec6 100644
--- a/src/qdoc/generator.h
+++ b/src/qdoc/generator.h
@@ -29,7 +29,6 @@
#ifndef GENERATOR_H
#define GENERATOR_H
-#include "node.h"
#include "text.h"
#include <QtCore/qlist.h>
@@ -46,6 +45,7 @@ typedef QMap<Node *, NodeMultiMap> ParentMaps;
class Config;
class CodeMarker;
class Location;
+class Node;
class QDocDatabase;
class Generator
@@ -103,6 +103,7 @@ public:
static bool useTimestamps() { return useTimestamps_; }
protected:
+ static QFile *openSubPageFile(const Node *node, const QString &fileName);
void beginFilePage(const Node *node, const QString &fileName);
void endFilePage() { endSubPage(); } // for symmetry
void beginSubPage(const Node *node, const QString &fileName);
@@ -140,7 +141,7 @@ protected:
static QString outputPrefix(const Node *node);
static QString outputSuffix(const Node *node);
static void singularPlural(Text &text, const NodeList &nodes);
- static void supplementAlsoList(const Node *node, QList<Text> &alsoList);
+ static void supplementAlsoList(const Node *node, QVector<Text> &alsoList);
static QString trimmedTrailing(const QString &string,
const QString &prefix,
const QString &suffix);
@@ -164,6 +165,7 @@ protected:
QString getMetadataElement(const Aggregate *inner, const QString &t);
QStringList getMetadataElements(const Aggregate *inner, const QString &t);
void generateOverloadedSignal(const Node *node, CodeMarker *marker);
+ static QString getOverloadedSignalCode(const Node *node);
QString indent(int level, const QString &markedCode);
QTextStream& out();
QString outFileName();
@@ -178,6 +180,11 @@ protected:
void unknownAtom(const Atom *atom);
int appendSortedQmlNames(Text &text, const Node *base, const NodeList &subs);
+ static bool hasExceptions(const Node *node,
+ NodeList &reentrant,
+ NodeList &threadsafe,
+ NodeList &nonreentrant);
+
QMap<QString, QStringList> editionGroupMap;
QMap<QString, QStringList> editionModuleMap;
QString naturalLanguage;
@@ -197,17 +204,20 @@ protected:
const QString &fullName,
const Node *actualNode);
void appendFullNames(Text &text, const NodeList &nodes, const Node *relative);
- int appendSortedNames(Text &text, const ClassNode *classe, const QList<RelatedClass> &classes);
+ int appendSortedNames(Text &text, const ClassNode *classe,
+ const QVector<RelatedClass> &classes);
void appendSignature(Text &text, const Node *node);
void signatureList(const NodeList &nodes, const Node *relative, CodeMarker *marker);
+ void addImageToCopy(const ExampleNode *en, const QString &file);
+
private:
static Generator *currentGenerator_;
static QStringList exampleDirs;
static QStringList exampleImgExts;
static QMap<QString, QMap<QString, QString> > fmtLeftMaps;
static QMap<QString, QMap<QString, QString> > fmtRightMaps;
- static QList<Generator *> generators;
+ static QVector<Generator *> generators;
static QStringList imageDirs;
static QStringList imageFiles;
static QMap<QString, QStringList> imgFileExts;
diff --git a/src/qdoc/helpprojectwriter.cpp b/src/qdoc/helpprojectwriter.cpp
index 3d45b60a4..4ef77f06a 100644
--- a/src/qdoc/helpprojectwriter.cpp
+++ b/src/qdoc/helpprojectwriter.cpp
@@ -157,7 +157,7 @@ void HelpProjectWriter::readSelectors(SubProject &subproject, const QStringList
NodeTypeSet fullSubset;
- for (auto it = pageTypeHash.cbegin(), end = pageTypeHash.cend(); it != end; ++it)
+ for (auto it = pageTypeHash.constBegin(); it != pageTypeHash.constEnd(); ++it)
fullSubset.insert(it.value());
for (const QString &selector : selectors) {
@@ -689,8 +689,7 @@ void HelpProjectWriter::generateProject(HelpProject &project)
writer.writeEndElement();
// Write customFilter elements.
- QHash<QString, QSet<QString> >::ConstIterator it;
- for (it = project.customFilters.constBegin(); it != project.customFilters.constEnd(); ++it) {
+ for (auto it = project.customFilters.constBegin(); it != project.customFilters.constEnd(); ++it) {
writer.writeStartElement("customFilter");
writer.writeAttribute("name", it.key());
QStringList sortedAttributes = it.value().values();
diff --git a/src/qdoc/helpprojectwriter.h b/src/qdoc/helpprojectwriter.h
index 64ad3aaec..222a5f097 100644
--- a/src/qdoc/helpprojectwriter.h
+++ b/src/qdoc/helpprojectwriter.h
@@ -67,13 +67,13 @@ struct HelpProject
QString fileName;
QString indexRoot;
QString indexTitle;
- QList<QStringList> keywords;
+ QVector<QStringList> keywords;
QSet<QString> files;
QSet<QString> extraFiles;
QSet<QString> filterAttributes;
QHash<QString, QSet<QString>> customFilters;
QSet<QString> excluded;
- QList<SubProject> subprojects;
+ QVector<SubProject> subprojects;
QHash<const Node *, NodeStatusSet> memberStatus;
bool includeIndexNodes;
};
@@ -112,7 +112,7 @@ private:
Generator *gen_;
QString outputDir;
- QList<HelpProject> projects;
+ QVector<HelpProject> projects;
};
QT_END_NAMESPACE
diff --git a/src/qdoc/htmlgenerator.cpp b/src/qdoc/htmlgenerator.cpp
index 97222ef13..a336467ba 100644
--- a/src/qdoc/htmlgenerator.cpp
+++ b/src/qdoc/htmlgenerator.cpp
@@ -199,10 +199,8 @@ void HtmlGenerator::initializeGenerator(const Config &config)
if (naturalLanguage.isEmpty())
naturalLanguage = QLatin1String("en");
- QSet<QString> editionNames = config.subVars(CONFIG_EDITION);
- QSet<QString>::ConstIterator edition = editionNames.constBegin();
- while (edition != editionNames.constEnd()) {
- QString editionName = *edition;
+ const QSet<QString> editionNames = config.subVars(CONFIG_EDITION);
+ for (const auto &editionName : editionNames) {
QStringList editionModules = config.getStringList(CONFIG_EDITION +
Config::dot +
editionName +
@@ -218,8 +216,6 @@ void HtmlGenerator::initializeGenerator(const Config &config)
editionModuleMap[editionName] = editionModules;
if (!editionGroups.isEmpty())
editionGroupMap[editionName] = editionGroups;
-
- ++edition;
}
codeIndent = config.getInt(CONFIG_CODEINDENT); // QTBUG-27798
@@ -569,25 +565,7 @@ int HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMark
break;
}
out() << "<p>";
- if (relative->isProperty() || relative->isVariable()) {
- atom = atom->next();
- if (atom != nullptr && atom->type() == Atom::String) {
- QString firstWord = atom->string().toLower().section(' ', 0, 0, QString::SectionSkipEmpty);
- if (firstWord == QLatin1String("the")
- || firstWord == QLatin1String("a")
- || firstWord == QLatin1String("an")
- || firstWord == QLatin1String("whether")
- || firstWord == QLatin1String("which")) {
- QString str = "This ";
- if (relative->isProperty())
- str += "property holds ";
- else
- str += "variable holds ";
- str += atom->string().left(1).toLower() + atom->string().mid(1);
- const_cast<Atom *>(atom)->setString(str);
- }
- }
- }
+ rewritePropertyBrief(atom, relative);
break;
case Atom::BriefRight:
if (hasBrief(relative))
@@ -598,12 +576,7 @@ int HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMark
// now widely used to write teletype text. As a result, text marked
// with the \c command is not passed to a code marker.
out() << formattingLeftMap()[ATOM_FORMATTING_TELETYPE];
- if (inLink_) {
- out() << protectEnc(plainCode(atom->string()));
- }
- else {
- out() << protectEnc(plainCode(atom->string()));
- }
+ out() << protectEnc(plainCode(atom->string()));
out() << formattingRightMap()[ATOM_FORMATTING_TELETYPE];
break;
case Atom::CaptionLeft:
@@ -728,13 +701,7 @@ int HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMark
}
else if ((idx = atom->string().indexOf(QStringLiteral("bymodule"))) != -1) {
QString moduleName = atom->string().mid(idx + 8).trimmed();
- Node::NodeType type = Node::Module;
- if (atom->string().startsWith(QLatin1String("qml")))
- type = Node::QmlModule;
- else if (atom->string().startsWith(QLatin1String("js")))
- type = Node::JsModule;
- else if (atom->string().startsWith(QLatin1String("groups")))
- type = Node::Group;
+ Node::NodeType type = typeFromString(atom);
QDocDatabase *qdb = QDocDatabase::qdocDB();
const CollectionNode *cn = qdb->getCollectionNode(moduleName, type);
if (cn) {
@@ -816,28 +783,26 @@ int HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMark
Sections sections(nsmap);
out() << "<ul>\n";
- QVector<Section>::ConstIterator s = sections.sinceSections().constBegin();
- while (s != sections.sinceSections().constEnd()) {
- if (!s->members().isEmpty()) {
+ const QVector<Section> sinceSections = sections.sinceSections();
+ for (const auto &section : sinceSections) {
+ if (!section.members().isEmpty()) {
out() << "<li>"
<< "<a href=\"#"
- << Doc::canonicalTitle(s->title())
+ << Doc::canonicalTitle(section.title())
<< "\">"
- << s->title()
+ << section.title()
<< "</a></li>\n";
}
- ++s;
}
out() << "</ul>\n";
int idx = 0;
- s = sections.sinceSections().constBegin();
- while (s != sections.sinceSections().constEnd()) {
- if (!s->members().isEmpty()) {
+ for (const auto &section : sinceSections) {
+ if (!section.members().isEmpty()) {
out() << "<a name=\""
- << Doc::canonicalTitle(s->title())
+ << Doc::canonicalTitle(section.title())
<< "\"></a>\n";
- out() << "<h3>" << protectEnc(s->title()) << "</h3>\n";
+ out() << "<h3>" << protectEnc(section.title()) << "</h3>\n";
if (idx == Sections::SinceClasses)
generateCompactList(Generic, nullptr, ncmap, false, QStringLiteral("Q"));
else if (idx == Sections::SinceQmlTypes)
@@ -845,37 +810,33 @@ int HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMark
else if (idx == Sections::SinceMemberFunctions) {
ParentMaps parentmaps;
ParentMaps::iterator pmap;
- NodeVector::const_iterator i = s->members().constBegin();
- while (i != s->members().constEnd()) {
- Node *p = (*i)->parent();
- pmap = parentmaps.find(p);
+ const QVector<Node *> members = section.members();
+ for (const auto &member : members) {
+ Node *parent = (*member).parent();
+ pmap = parentmaps.find(parent);
if (pmap == parentmaps.end())
- pmap = parentmaps.insert(p,NodeMultiMap());
- pmap->insert((*i)->name(),(*i));
- ++i;
+ pmap = parentmaps.insert(parent, NodeMultiMap());
+ pmap->insert(member->name(), member);
}
- pmap = parentmaps.begin();
- while (pmap != parentmaps.end()) {
- NodeVector nv = pmap->values().toVector();
+ for (auto map = parentmaps.begin(); map != parentmaps.end(); ++map) {
+ NodeVector nv = map->values().toVector();
out() << "<p>Class ";
out() << "<a href=\""
- << linkForNode(pmap.key(), nullptr)
+ << linkForNode(map.key(), nullptr)
<< "\">";
- QStringList pieces = pmap.key()->fullName().split("::");
+ QStringList pieces = map.key()->fullName().split("::");
out() << protectEnc(pieces.last());
out() << "</a>" << ":</p>\n";
generateSection(nv, nullptr, marker);
out() << "<br/>";
- ++pmap;
}
+ } else {
+ generateSection(section.members(), nullptr, marker);
}
- else
- generateSection(s->members(), nullptr, marker);
}
++idx;
- ++s;
}
}
break;
@@ -908,13 +869,7 @@ int HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMark
out() << " alt=\"\"";
out() << " />";
helpProjectWriter->addExtraFile(fileName);
- if (relative->isExample()) {
- const ExampleNode *cen = static_cast<const ExampleNode *>(relative);
- if (cen->imageFileName().isEmpty()) {
- ExampleNode *en = const_cast<ExampleNode *>(cen);
- en->setImageFileName(fileName);
- }
- }
+ setImageFileName(relative, fileName);
}
if (atom->type() == Atom::Image)
out() << "</p>";
@@ -969,23 +924,7 @@ int HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMark
QString target = qdb_->getNewLinkTarget(relative, node, outFileName(), text);
out() << "<a id=\"" << Doc::canonicalTitle(target) << "\" class=\"qa-mark\"></a>";
}
- /*
- mws saw this on 17/10/2014.
- Is this correct? Setting node to 0 means the
- following test always fails. Did we decide to
- no longer warn about linking to obsolete things?
- */
node = nullptr;
- if (node && node->isObsolete()) {
- if ((relative->parent() != node) && !relative->isObsolete()) {
- inObsoleteLink = true;
- if (obsoleteLinks) {
- relative->doc().location().warning(tr("Link to obsolete item '%1' in %2")
- .arg(atom->string())
- .arg(relative->plainFullName()));
- }
- }
- }
}
beginLink(link, node, relative);
skipAhead = 1;
@@ -1082,24 +1021,9 @@ int HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMark
out() << "<dt>";
}
else { // (atom->string() == ATOM_LIST_VALUE)
- const Atom *lookAhead = atom->next();
- QString t = lookAhead->string();
- lookAhead = lookAhead->next();
- Q_ASSERT(lookAhead->type() == Atom::ListTagRight);
- lookAhead = lookAhead->next();
- if (lookAhead && lookAhead->type() == Atom::SinceTagLeft) {
- lookAhead = lookAhead->next();
- Q_ASSERT(lookAhead && lookAhead->type() == Atom::String);
- t = t + QLatin1String(" (since ");
- if (lookAhead->string().at(0).isDigit())
- t = t + QLatin1String("Qt ");
- t = t + lookAhead->string() + QLatin1String(")");
- skipAhead = 4;
- }
- else {
- skipAhead = 1;
- }
- t = protectEnc(plainCode(marker->markedUpEnumValue(t, relative)));
+ QPair<QString, int> pair = getAtomListValue(atom);
+ skipAhead = pair.second;
+ QString t = protectEnc(plainCode(marker->markedUpEnumValue(pair.first, relative)));
out() << "<tr><td class=\"topAlign\"><code>" << t << "</code>";
if (relative->isEnumType()) {
@@ -1215,30 +1139,15 @@ int HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMark
break;
case Atom::TableLeft:
{
- QString p1, p2;
- QString attr = "generic";
- QString width;
+ QPair<QString, QString> pair = getTableWidthAttr(atom);
+ QString attr = pair.second;
+ QString width = pair.first;
+
if (in_para) {
out() << "</p>\n";
in_para = false;
}
- if (atom->count() > 0) {
- p1 = atom->string(0);
- if (atom->count() > 1)
- p2 = atom->string(1);
- }
- if (!p1.isEmpty()) {
- if (p1 == QLatin1String("borderless"))
- attr = p1;
- else if (p1.contains(QLatin1Char('%')))
- width = p1;
- }
- if (!p2.isEmpty()) {
- if (p2 == QLatin1String("borderless"))
- attr = p2;
- else if (p2.contains(QLatin1Char('%')))
- width = p2;
- }
+
out() << "<div class=\"table\"><table class=\"" << attr << '"';
if (!width.isEmpty())
out() << " width=\"" << width << '"';
@@ -1303,7 +1212,6 @@ int HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMark
out() << '>';
else {
out() << '>';
- //out() << "><p>";
}
if (matchAhead(atom, Atom::ParaLeft))
skipAhead = 1;
@@ -1314,7 +1222,6 @@ int HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMark
out() << "</th>";
else {
out() << "</td>";
- //out() << "</p></td>";
}
if (matchAhead(atom, Atom::ParaLeft))
skipAhead = 1;
@@ -1446,45 +1353,40 @@ void HtmlGenerator::generateCppReferencePage(Aggregate *aggregate, CodeMarker *m
bool needOtherSection = false;
- SectionVector::ConstIterator s = summarySections->constBegin();
- while (s != summarySections->constEnd()) {
- if (s->members().isEmpty() && s->reimplementedMembers().isEmpty()) {
- if (!s->inheritedMembers().isEmpty())
+ for (const auto &section : qAsConst(*summarySections)) {
+ if (section.members().isEmpty() && section.reimplementedMembers().isEmpty()) {
+ if (!section.inheritedMembers().isEmpty())
needOtherSection = true;
- }
- else {
- if (!s->members().isEmpty()) {
- QString ref = registerRef(s->title().toLower());
+ } else {
+ if (!section.members().isEmpty()) {
+ QString ref = registerRef(section.title().toLower());
out() << "<a name=\"" << ref << "\"></a>" << divNavTop << "\n";
- out() << "<h2 id=\"" << ref << "\">" << protectEnc(s->title()) << "</h2>\n";
- generateSection(s->members(), aggregate, marker);
+ out() << "<h2 id=\"" << ref << "\">" << protectEnc(section.title()) << "</h2>\n";
+ generateSection(section.members(), aggregate, marker);
}
- if (!s->reimplementedMembers().isEmpty()) {
- QString name = QString("Reimplemented ") + s->title();
+ if (!section.reimplementedMembers().isEmpty()) {
+ QString name = QString("Reimplemented ") + section.title();
QString ref = registerRef(name.toLower());
out() << "<a name=\"" << ref << "\"></a>" << divNavTop << "\n";
out() << "<h2 id=\"" << ref << "\">" << protectEnc(name) << "</h2>\n";
- generateSection(s->reimplementedMembers(), aggregate, marker);
+ generateSection(section.reimplementedMembers(), aggregate, marker);
}
- if (!s->inheritedMembers().isEmpty()) {
+ if (!section.inheritedMembers().isEmpty()) {
out() << "<ul>\n";
- generateSectionInheritedList(*s, aggregate);
+ generateSectionInheritedList(section, aggregate);
out() << "</ul>\n";
}
}
- ++s;
}
if (needOtherSection) {
out() << "<h3>Additional Inherited Members</h3>\n"
"<ul>\n";
- s = summarySections->constBegin();
- while (s != summarySections->constEnd()) {
- if (s->members().isEmpty() && !s->inheritedMembers().isEmpty())
- generateSectionInheritedList(*s, aggregate);
- ++s;
+ for (const auto &section : qAsConst(*summarySections)) {
+ if (section.members().isEmpty() && !section.inheritedMembers().isEmpty())
+ generateSectionInheritedList(section, aggregate);
}
out() << "</ul>\n";
}
@@ -1508,42 +1410,38 @@ void HtmlGenerator::generateCppReferencePage(Aggregate *aggregate, CodeMarker *m
generateExtractionMark(aggregate, EndMark);
}
- s = detailsSections->constBegin();
- while (s != detailsSections->constEnd()) {
+ for (const auto &section :qAsConst(*detailsSections)) {
bool headerGenerated = false;
- if (s->isEmpty()) {
- ++s;
+ if (section.isEmpty())
continue;
- }
- NodeVector::ConstIterator m = s->members().constBegin();
- while (m != s->members().constEnd()) {
- if ((*m)->access() == Node::Private) { // ### check necessary?
- ++m;
+
+ const QVector<Node *> members = section.members();
+ for (const auto &member : members) {
+ if (member->access() == Node::Private) // ### check necessary?
continue;
- }
if (!headerGenerated) {
- if (!s->divClass().isEmpty())
- out() << "<div class=\"" << s->divClass() << "\">\n"; // QTBUG-9504
- out() << "<h2>" << protectEnc(s->title()) << "</h2>\n";
+ if (!section.divClass().isEmpty())
+ out() << "<div class=\"" << section.divClass() << "\">\n"; // QTBUG-9504
+ out() << "<h2>" << protectEnc(section.title()) << "</h2>\n";
headerGenerated = true;
}
- if (!(*m)->isClassNode())
- generateDetailedMember(*m, aggregate, marker);
+ if (!member->isClassNode())
+ generateDetailedMember(member, aggregate, marker);
else {
out() << "<h3> class ";
- generateFullName(*m, aggregate);
+ generateFullName(member, aggregate);
out() << "</h3>";
- generateBrief(*m, marker, aggregate);
+ generateBrief(member, marker, aggregate);
}
QStringList names;
- names << (*m)->name();
- if ((*m)->isFunction()) {
- const FunctionNode *func = reinterpret_cast<const FunctionNode *>(*m);
+ names << member->name();
+ if (member->isFunction()) {
+ const FunctionNode *func = reinterpret_cast<const FunctionNode *>(member);
if (func->isSomeCtor() || func->isDtor() || func->overloadNumber() != 0)
names.clear();
- } else if ((*m)->isProperty()) {
- const PropertyNode *prop = reinterpret_cast<const PropertyNode *>(*m);
+ } else if (member->isProperty()) {
+ const PropertyNode *prop = reinterpret_cast<const PropertyNode *>(member);
if (!prop->getters().isEmpty() &&
!names.contains(prop->getters().first()->name()))
names << prop->getters().first()->name();
@@ -1553,8 +1451,8 @@ void HtmlGenerator::generateCppReferencePage(Aggregate *aggregate, CodeMarker *m
names << prop->resetters().first()->name();
if (!prop->notifiers().isEmpty())
names << prop->notifiers().first()->name();
- } else if ((*m)->isEnumType()) {
- const EnumNode *enume = reinterpret_cast<const EnumNode *>(*m);
+ } else if (member->isEnumType()) {
+ const EnumNode *enume = reinterpret_cast<const EnumNode *>(member);
if (enume->flagsType())
names << enume->flagsType()->name();
const auto &enumItemNameList = enume->doc().enumItemNames();
@@ -1566,11 +1464,9 @@ void HtmlGenerator::generateCppReferencePage(Aggregate *aggregate, CodeMarker *m
enume));
}
}
- ++m;
}
- if (headerGenerated && !s->divClass().isEmpty())
+ if (headerGenerated && !section.divClass().isEmpty())
out() << "</div>\n"; // QTBUG-9504
- ++s;
}
generateFooter(aggregate);
}
@@ -1595,16 +1491,13 @@ void HtmlGenerator::generateProxyPage(Aggregate *aggregate, CodeMarker *marker)
generateHeader(title, aggregate, marker);
generateTitle(title, subtitleText, SmallSubTitle, aggregate, marker);
generateBrief(aggregate, marker);
- SectionVector::ConstIterator s = summarySections->constBegin();
- while (s != summarySections->constEnd()) {
- if (!s->members().isEmpty()) {
- // out() << "<hr />\n";
- QString ref = registerRef(s->title().toLower());
+ for (auto it = summarySections->constBegin(); it != summarySections->constEnd(); ++it) {
+ if (!it->members().isEmpty()) {
+ QString ref = registerRef(it->title().toLower());
out() << "<a name=\"" << ref << "\"></a>" << divNavTop << "\n";
- out() << "<h2 id=\"" << ref << "\">" << protectEnc(s->title()) << "</h2>\n";
- generateSection(s->members(), aggregate, marker);
+ out() << "<h2 id=\"" << ref << "\">" << protectEnc(it->title()) << "</h2>\n";
+ generateSection(it->members(), aggregate, marker);
}
- ++s;
}
QString detailsRef = registerRef("details");
@@ -1612,7 +1505,6 @@ void HtmlGenerator::generateProxyPage(Aggregate *aggregate, CodeMarker *marker)
if (!aggregate->doc().isEmpty()) {
generateExtractionMark(aggregate, DetailedDescriptionMark);
- //out() << "<hr />\n"
out() << "<div class=\"descr\">\n" // QTBUG-9504
<< "<h2 id=\"" << detailsRef << "\">" << "Detailed Description" << "</h2>\n";
generateBody(aggregate, marker);
@@ -1622,54 +1514,47 @@ void HtmlGenerator::generateProxyPage(Aggregate *aggregate, CodeMarker *marker)
generateExtractionMark(aggregate, EndMark);
}
- s = detailsSections->constBegin();
- while (s != detailsSections->constEnd()) {
- if (s->isEmpty()) {
- ++s;
+ for (const auto &section : qAsConst(*detailsSections)) {
+ if (section.isEmpty())
continue;
- }
- //out() << "<hr />\n";
- if (!s->divClass().isEmpty())
- out() << "<div class=\"" << s->divClass() << "\">\n"; // QTBUG-9504
- out() << "<h2>" << protectEnc(s->title()) << "</h2>\n";
- NodeVector::ConstIterator m = s->members().constBegin();
- while (m != s->members().constEnd()) {
- if (!(*m)->isPrivate()) { // ### check necessary?
- if (!(*m)->isClassNode())
- generateDetailedMember(*m, aggregate, marker);
+ if (!section.divClass().isEmpty())
+ out() << "<div class=\"" << section.divClass() << "\">\n"; // QTBUG-9504
+ out() << "<h2>" << protectEnc(section.title()) << "</h2>\n";
+
+ const QVector<Node *> &members = section.members();
+ for (const auto &member : members) {
+ if (!member->isPrivate()) { // ### check necessary?
+ if (!member->isClassNode())
+ generateDetailedMember(member, aggregate, marker);
else {
out() << "<h3> class ";
- generateFullName(*m, aggregate);
+ generateFullName(member, aggregate);
out() << "</h3>";
- generateBrief(*m, marker, aggregate);
+ generateBrief(member, marker, aggregate);
}
QStringList names;
- names << (*m)->name();
- if ((*m)->isFunction()) {
- const FunctionNode *func = reinterpret_cast<const FunctionNode *>(*m);
+ names << member->name();
+ if (member->isFunction()) {
+ const FunctionNode *func = reinterpret_cast<const FunctionNode *>(member);
if (func->isSomeCtor() || func->isDtor() || func->overloadNumber() != 0)
names.clear();
- } else if ((*m)->isEnumType()) {
- const EnumNode *enume = reinterpret_cast<const EnumNode *>(*m);
+ } else if (member->isEnumType()) {
+ const EnumNode *enume = reinterpret_cast<const EnumNode *>(member);
if (enume->flagsType())
names << enume->flagsType()->name();
const auto &enumItemNameList = enume->doc().enumItemNames();
const auto &omitEnumItemNameList = enume->doc().omitEnumItemNames();
const auto items = QSet<QString>(enumItemNameList.cbegin(), enumItemNameList.cend())
- QSet<QString>(omitEnumItemNameList.cbegin(), omitEnumItemNameList.cend());
- for (const QString &enumName : items) {
- names << plainCode(marker->markedUpEnumValue(enumName,
- enume));
- }
+ for (const QString &enumName : items)
+ names << plainCode(marker->markedUpEnumValue(enumName, enume));
}
}
- ++m;
}
- if (!s->divClass().isEmpty())
+ if (!section.divClass().isEmpty())
out() << "</div>\n"; // QTBUG-9504
- ++s;
}
generateFooter(aggregate);
}
@@ -1712,16 +1597,15 @@ void HtmlGenerator::generateQmlTypePage(QmlTypeNode *qcn, CodeMarker *marker)
out() << "</ul>\n";
}
- SectionVector::ConstIterator s = sections.stdQmlTypeSummarySections().constBegin();
- while (s != sections.stdQmlTypeSummarySections().constEnd()) {
- if (!s->isEmpty()) {
- QString ref = registerRef(s->title().toLower());
+ const QVector<Section> &stdQmlTypeSummarySections = sections.stdQmlTypeSummarySections();
+ for (const auto &section : stdQmlTypeSummarySections) {
+ if (!section.isEmpty()) {
+ QString ref = registerRef(section.title().toLower());
out() << "<a name=\"" << ref
<< "\"></a>" << divNavTop << '\n';
- out() << "<h2 id=\"" << ref << "\">" << protectEnc(s->title()) << "</h2>\n";
- generateQmlSummary(s->members(), qcn, marker);
+ out() << "<h2 id=\"" << ref << "\">" << protectEnc(section.title()) << "</h2>\n";
+ generateQmlSummary(section.members(), qcn, marker);
}
- ++s;
}
generateExtractionMark(qcn, DetailedDescriptionMark);
@@ -1734,20 +1618,17 @@ void HtmlGenerator::generateQmlTypePage(QmlTypeNode *qcn, CodeMarker *marker)
generateQmlText(cn->doc().body(), cn, marker, qcn->name());
generateAlsoList(qcn, marker);
generateExtractionMark(qcn, EndMark);
- //out() << "<hr />\n";
-
- s = sections.stdQmlTypeDetailsSections().constBegin();
- while (s != sections.stdQmlTypeDetailsSections().constEnd()) {
- if (!s->isEmpty()) {
- out() << "<h2>" << protectEnc(s->title()) << "</h2>\n";
- NodeVector::ConstIterator m = s->members().constBegin();
- while (m != s->members().constEnd()) {
- generateDetailedQmlMember(*m, qcn, marker);
+
+ const QVector<Section> &stdQmlTypeDetailsSections = sections.stdQmlTypeDetailsSections();
+ for (const auto &section : stdQmlTypeDetailsSections) {
+ if (!section.isEmpty()) {
+ out() << "<h2>" << protectEnc(section.title()) << "</h2>\n";
+ const QVector<Node *> members = section.members();
+ for (const auto member : members) {
+ generateDetailedQmlMember(member, qcn, marker);
out() << "<br/>\n";
- ++m;
}
}
- ++s;
}
generateFooter(qcn);
Generator::setQmlTypeContext(nullptr);
@@ -1778,16 +1659,15 @@ void HtmlGenerator::generateQmlBasicTypePage(QmlBasicTypeNode *qbtn, CodeMarker
qbtn,
marker);
- SectionVector::const_iterator s = sections.stdQmlTypeSummarySections().constBegin();
- while (s != sections.stdQmlTypeSummarySections().constEnd()) {
- if (!s->isEmpty()) {
- QString ref = registerRef(s->title().toLower());
+ const QVector<Section> &stdQmlTypeSummarySections = sections.stdQmlTypeSummarySections();
+ for (const auto &section : stdQmlTypeSummarySections) {
+ if (!section.isEmpty()) {
+ QString ref = registerRef(section.title().toLower());
out() << "<a name=\"" << ref
<< "\"></a>" << divNavTop << '\n';
- out() << "<h2 id=\"" << ref << "\">" << protectEnc(s->title()) << "</h2>\n";
- generateQmlSummary(s->members(), qbtn, marker);
+ out() << "<h2 id=\"" << ref << "\">" << protectEnc(section.title()) << "</h2>\n";
+ generateQmlSummary(section.members(), qbtn, marker);
}
- ++s;
}
generateExtractionMark(qbtn, DetailedDescriptionMark);
@@ -1798,18 +1678,16 @@ void HtmlGenerator::generateQmlBasicTypePage(QmlBasicTypeNode *qbtn, CodeMarker
generateAlsoList(qbtn, marker);
generateExtractionMark(qbtn, EndMark);
- s = sections.stdQmlTypeDetailsSections().constBegin();
- while (s != sections.stdQmlTypeDetailsSections().constEnd()) {
- if (!s->isEmpty()) {
- out() << "<h2>" << protectEnc(s->title()) << "</h2>\n";
- NodeVector::ConstIterator m = s->members().constBegin();
- while (m != s->members().constEnd()) {
- generateDetailedQmlMember(*m, qbtn, marker);
+ const QVector<Section> &stdQmlTypeDetailsSections = sections.stdQmlTypeDetailsSections();
+ for (const auto &section : stdQmlTypeDetailsSections) {
+ if (!section.isEmpty()) {
+ out() << "<h2>" << protectEnc(section.title()) << "</h2>\n";
+ const QVector<Node *> members = section.members();
+ for (const auto member : members) {
+ generateDetailedQmlMember(member, qbtn, marker);
out() << "<br/>\n";
- ++m;
}
}
- ++s;
}
generateFooter(qbtn);
}
@@ -1942,13 +1820,10 @@ void HtmlGenerator::generateGenericCollectionPage(CollectionNode *cn, CodeMarker
generateText(brief, cn, marker);
out() << "</p>\n";
- NodeList::ConstIterator m = cn->members().constBegin();
- while (m != cn->members().constEnd()) {
- generateDetailedMember(*m, cn, marker);
- ++m;
- }
+ const QList<Node *> members = cn->members();
+ for (const auto &member : members)
+ generateDetailedMember(member, cn, marker);
- // generateAnnotatedList(cn, marker, cn->members());
generateFooter(cn);
}
@@ -1969,7 +1844,7 @@ void HtmlGenerator::generateNavigationBar(const QString &title,
const QString &buildversion,
bool tableItems)
{
- if (noNavigationBar)
+ if (noNavigationBar || node == nullptr)
return;
Text navigationbar;
@@ -2335,25 +2210,22 @@ void HtmlGenerator::generateRequisites(Aggregate *aggregate, CodeMarker *marker)
}
//add the inherits to the map
- QList<RelatedClass>::ConstIterator r;
- int index;
if (!classe->baseClasses().isEmpty()) {
+ int index = 0;
text.clear();
- r = classe->baseClasses().constBegin();
- index = 0;
- while (r != classe->baseClasses().constEnd()) {
- if ((*r).node_) {
- appendFullName(text, (*r).node_, classe);
+ const auto baseClasses = classe->baseClasses();
+ for (const auto &cls : baseClasses) {
+ if (cls.node_) {
+ appendFullName(text, cls.node_, classe);
- if ((*r).access_ == Node::Protected) {
+ if (cls.access_ == Node::Protected) {
text << " (protected)";
}
- else if ((*r).access_ == Node::Private) {
+ else if (cls.access_ == Node::Private) {
text << " (private)";
}
text << comma(index++, classe->baseClasses().count());
}
- ++r;
}
text << Atom::ParaRight;
if (index > 0)
@@ -2375,19 +2247,18 @@ void HtmlGenerator::generateRequisites(Aggregate *aggregate, CodeMarker *marker)
//generate the table
out() << "<div class=\"table\"><table class=\"alignedsummary\">\n";
- QStringList::ConstIterator i;
- for (i = requisiteorder.constBegin(); i != requisiteorder.constEnd(); ++i) {
+ for (auto it = requisiteorder.constBegin(); it != requisiteorder.constEnd(); ++it) {
- if (requisites.contains(*i)) {
+ if (requisites.contains(*it)) {
out() << "<tr>"
<< "<td class=\"memItemLeft rightAlign topAlign\"> "
- << *i << ":"
+ << *it << ":"
"</td><td class=\"memItemRight bottomAlign\"> ";
- if (*i == headerText)
- out() << requisites.value(*i).toString();
+ if (*it == headerText)
+ out() << requisites.value(*it).toString();
else
- generateText(requisites.value(*i), aggregate, marker);
+ generateText(requisites.value(*it), aggregate, marker);
out() << "</td></tr>";
}
}
@@ -2412,14 +2283,6 @@ void HtmlGenerator::generateQmlRequisites(QmlTypeNode *qcn, CodeMarker *marker)
const QString inheritsText = "Inherits:";
const QString instantiatesText = "Instantiates:";
- //The order of the requisites matter
- QStringList requisiteorder;
- requisiteorder << importText
- << sinceText
- << instantiatesText
- << inheritsText
- << inheritedBytext;
-
//add the module name and version to the map
QString logicalModuleVersion;
const CollectionNode *collection = qdb_->getCollectionNode(qcn->logicalModuleName(), qcn->nodeType());
@@ -2495,23 +2358,29 @@ void HtmlGenerator::generateQmlRequisites(QmlTypeNode *qcn, CodeMarker *marker)
requisites.insert(inheritedBytext, text);
}
+ //The order of the requisites matter
+ const QStringList requisiteorder {
+ importText,
+ sinceText,
+ instantiatesText,
+ inheritsText,
+ inheritedBytext };
+
if (!requisites.isEmpty()) {
//generate the table
out() << "<div class=\"table\"><table class=\"alignedsummary\">\n";
+ for (const auto &requisite : requisiteorder) {
- QStringList::ConstIterator i;
- for (i = requisiteorder.constBegin(); i != requisiteorder.constEnd(); ++i) {
-
- if (requisites.contains(*i)) {
+ if (requisites.contains(requisite)) {
out() << "<tr>"
<< "<td class=\"memItemLeft rightAlign topAlign\"> "
- << *i
+ << requisite
<< "</td><td class=\"memItemRight bottomAlign\"> ";
- if (*i == importText)
- out()<<requisites.value(*i).toString();
+ if (requisite == importText)
+ out()<<requisites.value(requisite).toString();
else
- generateText(requisites.value(*i), qcn, marker);
+ generateText(requisites.value(requisite), qcn, marker);
out() << "</td></tr>";
}
}
@@ -2554,7 +2423,7 @@ void HtmlGenerator::generateTableOfContents(const Node *node,
CodeMarker *marker,
QVector<Section> *sections)
{
- QList<Atom *> toc;
+ QVector<Atom *> toc;
if (node->doc().hasTableOfContents())
toc = node->doc().tableOfContents();
if (tocDepth == 0 || (toc.isEmpty() && !sections && !node->isModule())) {
@@ -2605,26 +2474,24 @@ void HtmlGenerator::generateTableOfContents(const Node *node,
node->isNamespace() ||
node->isQmlType() ||
node->isJsType())) {
- SectionVector::ConstIterator s = sections->constBegin();
- while (s != sections->constEnd()) {
- if (!s->members().isEmpty()) {
+ for (const auto &section : qAsConst(*sections)) {
+ if (!section.members().isEmpty()) {
out() << "<li class=\"level"
<< sectionNumber
<< "\"><a href=\"#"
- << registerRef(s->plural())
- << "\">" << s->title()
+ << registerRef(section.plural())
+ << "\">" << section.title()
<< "</a></li>\n";
}
- if (!s->reimplementedMembers().isEmpty()) {
- QString ref = QString("Reimplemented ") + s->plural();
+ if (!section.reimplementedMembers().isEmpty()) {
+ QString ref = QString("Reimplemented ") + section.plural();
out() << "<li class=\"level"
<< sectionNumber
<< "\"><a href=\"#"
<< registerRef(ref.toLower())
- << "\">" << QString("Reimplemented ") + s->title()
+ << "\">" << QString("Reimplemented ") + section.title()
<< "</a></li>\n";
}
- ++s;
}
if (!node->isNamespace() || node->hasDoc()) {
out() << "<li class=\"level"
@@ -2641,8 +2508,7 @@ void HtmlGenerator::generateTableOfContents(const Node *node,
}
}
- for (int i = 0; i < toc.size(); ++i) {
- const Atom *atom = toc.at(i);
+ for (const auto &atom : toc) {
sectionNumber = atom->string().toInt() + detailsBase;
//restrict the ToC depth to the one set by the HTML.tocdepth variable or
//print all levels if tocDepth is not set.
@@ -2803,22 +2669,18 @@ QString HtmlGenerator::generateObsoleteMembersFile(const Sections &sections, Cod
<< "They are provided to keep old source code working. "
<< "We strongly advise against using them in new code.</p>\n";
- for (int i = 0; i < summary_spv.size(); ++i) {
- out() << "<h2>" << protectEnc(summary_spv.at(i)->title()) << "</h2>\n";
- const Section &section = *summary_spv.at(i);
- generateSectionList(section, aggregate, marker, Section::Obsolete);
+ for (const auto &section : summary_spv) {
+ out() << "<h2>" << protectEnc(section->title()) << "</h2>\n";
+ generateSectionList(*section, aggregate, marker, Section::Obsolete);
}
- for (int i = 0; i < details_spv.size(); ++i) {
- //out() << "<hr />\n";
- out() << "<h2>" << protectEnc(details_spv.at(i)->title()) << "</h2>\n";
+ for (const auto &section : details_spv) {
+ out() << "<h2>" << protectEnc(section->title()) << "</h2>\n";
- const NodeVector &members = details_spv.at(i)->obsoleteMembers();
- NodeVector::ConstIterator m = members.constBegin();
- while (m != members.constEnd()) {
- if ((*m)->access() != Node::Private)
- generateDetailedMember(*m, aggregate, marker);
- ++m;
+ const NodeVector &members = section->obsoleteMembers();
+ for (const auto &member : members) {
+ if (member->access() != Node::Private)
+ generateDetailedMember(member, aggregate, marker);
}
}
@@ -2863,22 +2725,20 @@ QString HtmlGenerator::generateObsoleteQmlMembersFile(const Sections &sections,
<< "They are provided to keep old source code working. "
<< "We strongly advise against using them in new code.</p>\n";
- for (int i = 0; i < summary_spv.size(); ++i) {
- QString ref = registerRef(summary_spv.at(i)->title().toLower());
+ for (const auto &section : summary_spv) {
+ QString ref = registerRef(section->title().toLower());
out() << "<a name=\"" << ref
<< "\"></a>" << divNavTop << '\n';
- out() << "<h2 id=\"" << ref << "\">" << protectEnc(summary_spv.at(i)->title()) << "</h2>\n";
- generateQmlSummary(summary_spv.at(i)->obsoleteMembers(), aggregate, marker);
+ out() << "<h2 id=\"" << ref << "\">" << protectEnc(section->title()) << "</h2>\n";
+ generateQmlSummary(section->obsoleteMembers(), aggregate, marker);
}
- for (int i = 0; i < details_spv.size(); ++i) {
- out() << "<h2>" << protectEnc(details_spv.at(i)->title()) << "</h2>\n";
- const NodeVector &members = details_spv.at(i)->obsoleteMembers();
- NodeVector::ConstIterator m = members.constBegin();
- while (m != members.constEnd()) {
- generateDetailedQmlMember(*m, aggregate, marker);
+ for (const auto &section : details_spv) {
+ out() << "<h2>" << protectEnc(section->title()) << "</h2>\n";
+ const NodeVector &members = section->obsoleteMembers();
+ for (const auto &member : members) {
+ generateDetailedQmlMember(member, aggregate, marker);
out() << "<br/>\n";
- ++m;
}
}
@@ -2893,12 +2753,10 @@ void HtmlGenerator::generateClassHierarchy(const Node *relative, NodeMap &classM
return;
NodeMap topLevel;
- NodeMap::Iterator c = classMap.begin();
- while (c != classMap.end()) {
- ClassNode *classe = static_cast<ClassNode *>(*c);
+ for (auto it = classMap.begin(); it != classMap.end(); ++it) {
+ ClassNode *classe = static_cast<ClassNode *>(*it);
if (classe->baseClasses().isEmpty())
topLevel.insert(classe->name(), classe);
- ++c;
}
QStack<NodeMap > stack;
@@ -2939,7 +2797,7 @@ void HtmlGenerator::generateAnnotatedList(const Node *relative,
CodeMarker *marker,
const NodeMultiMap &nmm)
{
- if (nmm.isEmpty())
+ if (nmm.isEmpty() || relative == nullptr)
return;
generateAnnotatedList(relative, marker, nmm.values());
}
@@ -3051,8 +2909,7 @@ void HtmlGenerator::generateCompactList(ListType listType,
QString paragraphName[NumParagraphs+1];
QSet<char> usedParagraphNames;
- NodeMultiMap::ConstIterator c = nmm.constBegin();
- while (c != nmm.constEnd()) {
+ for (auto c = nmm.constBegin(); c != nmm.constEnd(); ++c) {
QStringList pieces = c.key().split("::");
int idx = commonPrefixLen;
if (idx > 0 && !pieces.last().startsWith(commonPrefix, Qt::CaseInsensitive))
@@ -3072,7 +2929,6 @@ void HtmlGenerator::generateCompactList(ListType listType,
paragraphName[paragraphNr] = key[0].toUpper();
usedParagraphNames.insert(key[0].toLower().cell());
paragraph[paragraphNr].insert(last, c.value());
- ++c;
}
/*
@@ -3217,26 +3073,22 @@ void HtmlGenerator::generateFunctionIndex(const Node *relative)
out() << "<ul>\n";
NodeMapMap &funcIndex = qdb_->getFunctionIndex();
- QMap<QString, NodeMap >::ConstIterator f = funcIndex.constBegin();
- while (f != funcIndex.constEnd()) {
+ for (auto fnMap = funcIndex.constBegin(); fnMap != funcIndex.constEnd(); ++fnMap) {
out() << "<li>";
- out() << protectEnc(f.key()) << ':';
+ out() << protectEnc(fnMap.key()) << ':';
- currentLetter = f.key()[0].unicode();
+ currentLetter = fnMap.key()[0].unicode();
while (islower(currentLetter) && currentLetter >= nextLetter) {
out() << QString("<a name=\"%1\"></a>").arg(nextLetter);
nextLetter++;
}
- NodeMap::ConstIterator s = (*f).constBegin();
- while (s != (*f).constEnd()) {
+ for (auto it = (*fnMap).constBegin(); it != (*fnMap).constEnd(); ++it) {
out() << ' ';
- generateFullName((*s)->parent(), relative, *s);
- ++s;
+ generateFullName((*it)->parent(), relative, *it);
}
out() << "</li>";
out() << '\n';
- ++f;
}
out() << "</ul>\n";
}
@@ -3247,7 +3099,6 @@ void HtmlGenerator::generateLegaleseList(const Node *relative, CodeMarker *marke
QMap<Text, const Node *>::ConstIterator it = legaleseTexts.constBegin();
while (it != legaleseTexts.constEnd()) {
Text text = it.key();
- //out() << "<hr />\n";
generateText(text, relative, marker);
out() << "<ul>\n";
do {
@@ -3331,7 +3182,7 @@ void HtmlGenerator::generateList(const Node *relative, CodeMarker *marker, const
if (type != Node::NoType) {
NodeList nodeList;
qdb_->mergeCollections(type, cnm, relative);
- const CollectionList collectionList = cnm.values();
+ const auto collectionList = cnm.values();
nodeList.reserve(collectionList.size());
for (auto *collectionNode : collectionList)
nodeList.append(collectionNode);
@@ -3375,29 +3226,25 @@ void HtmlGenerator::generateSection(const NodeVector &nv, const Node *relative,
}
int i = 0;
- NodeVector::ConstIterator m = nv.constBegin();
- while (m != nv.constEnd()) {
- if ((*m)->access() == Node::Private) {
- ++m;
+ for (const auto &member : nv) {
+ if (member->access() == Node::Private)
continue;
- }
if (alignNames) {
out() << "<tr><td class=\"memItemLeft rightAlign topAlign\"> ";
}
else {
- if (twoColumn && i == (int) (nv.count() + 1) / 2)
+ if (twoColumn && i == (nv.count() + 1) / 2)
out() << "</ul></td><td class=\"topAlign\"><ul>\n";
out() << "<li class=\"fn\">";
}
- generateSynopsis(*m, relative, marker, Section::Summary, alignNames);
+ generateSynopsis(member, relative, marker, Section::Summary, alignNames);
if (alignNames)
out() << "</td></tr>\n";
else
out() << "</li>\n";
i++;
- ++m;
}
if (alignNames)
out() << "</table></div>\n";
@@ -3438,18 +3285,15 @@ void HtmlGenerator::generateSectionList(const Section& section,
}
int i = 0;
- NodeVector::ConstIterator m = members.constBegin();
- while (m != members.constEnd()) {
- if ((*m)->access() == Node::Private) {
- ++m;
+ for (const auto &member : members) {
+ if (member->access() == Node::Private)
continue;
- }
if (alignNames) {
out() << "<tr><td class=\"memItemLeft topAlign rightAlign\"> ";
}
else {
- if (twoColumn && i == (int) (members.count() + 1) / 2)
+ if (twoColumn && i == (members.count() + 1) / 2)
out() << "</ul></td><td class=\"topAlign\"><ul>\n";
out() << "<li class=\"fn\">";
}
@@ -3460,9 +3304,9 @@ void HtmlGenerator::generateSectionList(const Section& section,
prefix = keys.at(i).mid(1);
prefix = prefix.left(keys.at(i).indexOf("::") + 1);
}
- generateSynopsis(*m, relative, marker, section.style(), alignNames, &prefix);
- if ((*m)->isFunction()) {
- const FunctionNode *fn = static_cast<const FunctionNode *>(*m);
+ generateSynopsis(member, relative, marker, section.style(), alignNames, &prefix);
+ if (member->isFunction()) {
+ const FunctionNode *fn = static_cast<const FunctionNode *>(member);
if (fn->isPrivateSignal()) {
hasPrivateSignals = true;
if (alignNames)
@@ -3479,7 +3323,6 @@ void HtmlGenerator::generateSectionList(const Section& section,
else
out() << "</li>\n";
i++;
- ++m;
}
if (alignNames)
out() << "</table></div>\n";
@@ -3503,25 +3346,23 @@ void HtmlGenerator::generateSectionList(const Section& section,
void HtmlGenerator::generateSectionInheritedList(const Section& section, const Node *relative)
{
- QList<QPair<Aggregate *, int> >::ConstIterator p = section.inheritedMembers().constBegin();
- while (p != section.inheritedMembers().constEnd()) {
+ const QVector<QPair<Aggregate *, int>> &inheritedMembers = section.inheritedMembers();
+ for (const auto &member : inheritedMembers) {
out() << "<li class=\"fn\">";
- out() << (*p).second << ' ';
- if ((*p).second == 1) {
+ out() << member.second << ' ';
+ if (member.second == 1) {
out() << section.singular();
}
else {
out() << section.plural();
}
- out() << " inherited from <a href=\"" << fileName((*p).first)
+ out() << " inherited from <a href=\"" << fileName(member.first)
<< '#' << Generator::cleanRef(section.title().toLower()) << "\">"
- << protectEnc((*p).first->plainFullName(relative))
+ << protectEnc(member.first->plainFullName(relative))
<< "</a></li>\n";
- ++p;
}
}
-// generateSynopsis(*m, relative, marker, Section::Summary, alignNames);
void HtmlGenerator::generateSynopsis(const Node *node,
const Node *relative,
CodeMarker *marker,
@@ -3745,23 +3586,6 @@ void HtmlGenerator::generateLink(const Atom *atom, CodeMarker *marker)
}
}
-QString HtmlGenerator::registerRef(const QString &ref)
-{
- QString clean = Generator::cleanRef(ref);
-
- for (;;) {
- QString &prevRef = refMap[clean.toLower()];
- if (prevRef.isEmpty()) {
- prevRef = ref;
- break;
- } else if (prevRef == ref) {
- break;
- }
- clean += QLatin1Char('x');
- }
- return clean;
-}
-
QString HtmlGenerator::protectEnc(const QString &string)
{
#ifndef QT_NO_TEXTCODEC
@@ -3829,199 +3653,6 @@ QString HtmlGenerator::fileName(const Node *node)
return Generator::fileName(node);
}
-QString HtmlGenerator::refForNode(const Node *node)
-{
- QString ref;
- switch (node->nodeType()) {
- case Node::Enum:
- ref = node->name() + "-enum";
- break;
- case Node::Typedef:
- {
- const TypedefNode *tdn = static_cast<const TypedefNode *>(node);
- if (tdn->associatedEnum())
- return refForNode(tdn->associatedEnum());
- else
- ref = node->name() + "-typedef";
- }
- break;
- case Node::Function:
- {
- const FunctionNode *fn = static_cast<const FunctionNode *>(node);
- switch (fn->metaness()) {
- case FunctionNode::JsSignal:
- case FunctionNode::QmlSignal:
- ref = fn->name() + "-signal";
- break;
- case FunctionNode::JsSignalHandler:
- case FunctionNode::QmlSignalHandler:
- ref = fn->name() + "-signal-handler";
- break;
- case FunctionNode::JsMethod:
- case FunctionNode::QmlMethod:
- ref = fn->name() + "-method";
- if (fn->overloadNumber() != 0)
- ref += QLatin1Char('-') + QString::number(fn->overloadNumber());
- break;
- default:
- if (fn->hasOneAssociatedProperty() && fn->doc().isEmpty()) {
- return refForNode(fn->firstAssociatedProperty());
- } else {
- ref = fn->name();
- if (fn->overloadNumber() != 0)
- ref += QLatin1Char('-') + QString::number(fn->overloadNumber());
- }
- break;
- }
- }
- break;
- case Node::JsProperty:
- case Node::QmlProperty:
- if (node->isAttached())
- ref = node->name() + "-attached-prop";
- else
- ref = node->name() + "-prop";
- break;
- case Node::Property:
- ref = node->name() + "-prop";
- break;
- case Node::Variable:
- ref = node->name() + "-var";
- break;
- case Node::SharedComment:
- if (node->isPropertyGroup())
- ref = node->name() + "-prop";
- break;
- default:
- break;
- }
- return registerRef(ref);
-}
-
-/*!
- This function is called for links, i.e. for words that
- are marked with the qdoc link command. For autolinks
- that are not marked with the qdoc link command, the
- getAutoLink() function is called
-
- It returns the string for a link found by using the data
- in the \a atom to search the database. It also sets \a node
- to point to the target node for that link. \a relative points
- to the node holding the qdoc comment where the link command
- was found.
- */
-QString HtmlGenerator::getLink(const Atom *atom, const Node *relative, const Node** node)
-{
- const QString &t = atom->string();
- if (t.at(0) == QChar('h')) {
- if (t.startsWith("http:") || t.startsWith("https:"))
- return t;
- }
- else if (t.at(0) == QChar('f')) {
- if (t.startsWith("file:") || t.startsWith("ftp:"))
- return t;
- }
- else if (t.at(0) == QChar('m')) {
- if (t.startsWith("mailto:"))
- return t;
- }
- return getAutoLink(atom, relative, node);
-}
-
-/*!
- This function is called for autolinks, i.e. for words that
- are not marked with the qdoc link command that qdoc has
- reason to believe should be links. For links marked with
- the qdoc link command, the getLink() function is called.
-
- It returns the string for a link found by using the data
- in the \a atom to search the database. It also sets \a node
- to point to the target node for that link. \a relative points
- to the node holding the qdoc comment where the link command
- was found.
- */
-QString HtmlGenerator::getAutoLink(const Atom *atom, const Node *relative, const Node** node)
-{
- QString ref;
-
- *node = qdb_->findNodeForAtom(atom, relative, ref);
- if (!(*node)) {
- return QString();
- }
-
- QString link = (*node)->url();
- if (link.isEmpty())
- link = linkForNode(*node, relative);
- if (!ref.isEmpty()) {
- int hashtag = link.lastIndexOf(QChar('#'));
- if (hashtag != -1)
- link.truncate(hashtag);
- link += QLatin1Char('#') + ref;
- }
- return link;
-}
-
-/*!
- Construct the link string for the \a node and return it.
- The \a relative node is use to decide the link we are
- generating is in the same file as the target. Note the
- relative node can be 0, which pretty much guarantees
- that the link and the target aren't in the same file.
- */
-QString HtmlGenerator::linkForNode(const Node *node, const Node *relative)
-{
- if (node == nullptr)
- return QString();
- if (!node->url().isEmpty())
- return node->url();
- if (fileBase(node).isEmpty())
- return QString();
- if (node->isPrivate())
- return QString();
- QString fn = fileName(node);
- if (node && node->parent() &&
- (node->parent()->isQmlType() || node->parent()->isJsType())
- && node->parent()->isAbstract()) {
- if (Generator::qmlTypeContext()) {
- if (Generator::qmlTypeContext()->inherits(node->parent())) {
- fn = fileName(Generator::qmlTypeContext());
- }
- else if (node->parent()->isInternal()) {
- node->doc().location().warning(tr("Cannot link to property in internal type '%1'").arg(node->parent()->name()));
- return QString();
- }
- }
- }
- QString link = fn;
-
- if (!node->isPageNode() || node->isPropertyGroup()) {
- QString ref = refForNode(node);
- if (relative && fn == fileName(relative) && ref == refForNode(relative))
- return QString();
-
- link += QLatin1Char('#');
- link += ref;
- }
- /*
- If the output is going to subdirectories, then if the
- two nodes will be output to different directories, then
- the link must go up to the parent directory and then
- back down into the other subdirectory.
- */
- if (node && relative && (node != relative)) {
- if (useOutputSubdirs() && !node->isExternalPage() &&
- node->outputSubdirectory() != relative->outputSubdirectory()) {
- if (link.startsWith(QString(node->outputSubdirectory() + QLatin1Char('/')))) {
- link.prepend(QString("../"));
- }
- else {
- link.prepend(QString("../" + node->outputSubdirectory() + QLatin1Char('/')));
- }
- }
- }
- return link;
-}
-
void HtmlGenerator::generateFullName(const Node *apparentNode, const Node *relative, const Node *actualNode)
{
if (actualNode == nullptr)
@@ -4089,7 +3720,7 @@ void HtmlGenerator::generateDetailedMember(const Node *node,
generateSince(node, marker);
if (node->isProperty()) {
- const PropertyNode *property = static_cast<const PropertyNode *>(node);
+ const auto property = static_cast<const PropertyNode *>(node);
Section section(Section::Accessors, Section::Active);
section.appendMembers(property->getters().toVector());
@@ -4106,7 +3737,6 @@ void HtmlGenerator::generateDetailedMember(const Node *node,
if (!notifiers.members().isEmpty()) {
out() << "<p><b>Notifier signal:</b></p>\n";
- //out() << "<p>This signal is emitted when the property value is changed.</p>\n";
generateSectionList(notifiers, node, marker);
}
}
@@ -4134,53 +3764,6 @@ void HtmlGenerator::generateDetailedMember(const Node *node,
generateExtractionMark(node, EndMark);
}
-int HtmlGenerator::hOffset(const Node *node)
-{
- switch (node->nodeType()) {
- case Node::Namespace:
- case Node::Class:
- case Node::Struct:
- case Node::Union:
- case Node::Module:
- return 2;
- case Node::QmlModule:
- case Node::QmlBasicType:
- case Node::QmlType:
- case Node::Page:
- return 1;
- case Node::Enum:
- case Node::Typedef:
- case Node::Function:
- case Node::Property:
- default:
- return 3;
- }
-}
-
-bool HtmlGenerator::isThreeColumnEnumValueTable(const Atom *atom)
-{
- while (atom != nullptr && !(atom->type() == Atom::ListRight && atom->string() == ATOM_LIST_VALUE)) {
- if (atom->type() == Atom::ListItemLeft && !matchAhead(atom, Atom::ListItemRight))
- return true;
- atom = atom->next();
- }
- return false;
-}
-
-
-const QPair<QString,QString> HtmlGenerator::anchorForNode(const Node *node)
-{
- QPair<QString,QString> anchorPair;
-
- anchorPair.first = Generator::fileName(node);
- if (node->isPageNode()) {
- const PageNode *pn = static_cast<const PageNode *>(node);
- anchorPair.second = pn->title();
- }
-
- return anchorPair;
-}
-
#ifdef GENERATE_MAC_REFS
/*
No longer valid.
@@ -4256,28 +3839,25 @@ void HtmlGenerator::generateQmlSummary(const NodeVector &members,
{
if (!members.isEmpty()) {
out() << "<ul>\n";
- NodeVector::const_iterator m = members.constBegin();
- while (m != members.constEnd()) {
+ for (const auto &member : members) {
out() << "<li class=\"fn\">";
- generateQmlItem(*m, relative, marker, true);
- if ((*m)->isPropertyGroup()) {
- const SharedCommentNode *scn = static_cast<const SharedCommentNode *>(*m);
+ generateQmlItem(member, relative, marker, true);
+ if (member->isPropertyGroup()) {
+ const SharedCommentNode *scn = static_cast<const SharedCommentNode *>(member);
if (scn->count() > 0) {
- QVector<Node *>::ConstIterator p = scn->collective().constBegin();
out() << "<ul>\n";
- while (p != scn->collective().constEnd()) {
- if ((*p)->isQmlProperty() || (*p)->isJsProperty()) {
+ const QVector<Node *> sharedNodes = scn->collective();
+ for (const auto &node : sharedNodes) {
+ if (node->isQmlProperty() || node->isJsProperty()) {
out() << "<li class=\"fn\">";
- generateQmlItem(*p, relative, marker, true);
+ generateQmlItem(node, relative, marker, true);
out() << "</li>\n";
}
- ++p;
}
out() << "</ul>\n";
}
}
out() << "</li>\n";
- ++m;
}
out() << "</ul>\n";
}
@@ -4311,7 +3891,6 @@ void HtmlGenerator::generateDetailedQmlMember(Node *node,
QString nodeRef;
if (node->isPropertyGroup()) {
const SharedCommentNode *scn = static_cast<const SharedCommentNode*>(node);
- QVector<Node *>::ConstIterator p = scn->collective().constBegin();
out() << "<div class=\"qmlproto\">";
out() << "<div class=\"table\"><table class=\"qmlname\">";
if (!scn->name().isEmpty()) {
@@ -4323,9 +3902,10 @@ void HtmlGenerator::generateDetailedQmlMember(Node *node,
out() << "<b>" << heading << "</b>";
out() << "</p></th></tr>";
}
- while (p != scn->collective().constEnd()) {
- if ((*p)->isQmlProperty() || (*p)->isJsProperty()) {
- qpn = static_cast<QmlPropertyNode *>(*p);
+ const QVector<Node *> sharedNodes = scn->collective();
+ for (const auto &node : sharedNodes) {
+ if (node->isQmlProperty() || node->isJsProperty()) {
+ qpn = static_cast<QmlPropertyNode *>(node);
nodeRef = refForNode(qpn);
out() << "<tr valign=\"top\" class=\"odd\" id=\"" << nodeRef << "\">";
out() << "<td class=\"tblQmlPropNode\"><p>";
@@ -4338,7 +3918,6 @@ void HtmlGenerator::generateDetailedQmlMember(Node *node,
generateQmlItem(qpn, relative, marker, false);
out() << "</p></td></tr>";
}
- ++p;
}
out() << "</table></div>";
out() << "</div>";
@@ -4361,19 +3940,19 @@ void HtmlGenerator::generateDetailedQmlMember(Node *node,
out() << qmlItemFooter;
} else if (node->isSharedCommentNode()) {
const SharedCommentNode *scn = reinterpret_cast<const SharedCommentNode *>(node);
- const QVector<Node *> &collective = scn->collective();
- if (collective.size() > 1)
+ const QVector<Node *> &sharedNodes = scn->collective();
+ if (sharedNodes.size() > 1)
out() << "<div class=\"fngroup\">\n";
out() << qmlItemHeader;
- for (const auto m : collective) {
- if (m->isFunction(Node::QML) || m->isFunction(Node::JS)) {
- out() << qmlItemStart.arg(nodeRef, "tblQmlFuncNode", refForNode(m));
- generateSynopsis(m, relative, marker, Section::Details, false);
+ for (const auto &node : sharedNodes) {
+ if (node->isFunction(Node::QML) || node->isFunction(Node::JS)) {
+ out() << qmlItemStart.arg(nodeRef, "tblQmlFuncNode", refForNode(node));
+ generateSynopsis(node, relative, marker, Section::Details, false);
out() << qmlItemEnd;
}
}
out() << qmlItemFooter;
- if (collective.size() > 1)
+ if (sharedNodes.size() > 1)
out() << "</div>";
} else { // assume the node is a method/signal handler
out() << qmlItemHeader;
@@ -4550,9 +4129,8 @@ void HtmlGenerator::generateManifestFile(const QString &manifest, const QString
demos = true;
bool proceed = false;
- ExampleNodeMap::Iterator i = exampleNodeMap.begin();
- while (i != exampleNodeMap.end()) {
- const ExampleNode *en = i.value();
+ for (auto map = exampleNodeMap.begin(); map != exampleNodeMap.end(); ++map) {
+ const ExampleNode *en = map.value();
if (demos) {
if (en->name().startsWith("demos")) {
proceed = true;
@@ -4563,7 +4141,6 @@ void HtmlGenerator::generateManifestFile(const QString &manifest, const QString
proceed = true;
break;
}
- ++i;
}
if (!proceed || !file.open(QFile::WriteOnly | QFile::Text))
return;
@@ -4576,17 +4153,12 @@ void HtmlGenerator::generateManifestFile(const QString &manifest, const QString
writer.writeStartElement(manifest);
QStringList usedAttributes;
- i = exampleNodeMap.begin();
- while (i != exampleNodeMap.end()) {
- const ExampleNode *en = i.value();
+ for (auto map = exampleNodeMap.begin(); map != exampleNodeMap.end(); ++map) {
+ const ExampleNode *en = map.value();
if (demos) {
- if (!en->name().startsWith("demos")) {
- ++i;
+ if (!en->name().startsWith("demos"))
continue;
- }
- }
- else if (en->name().startsWith("demos")) {
- ++i;
+ } else if (en->name().startsWith("demos")) {
continue;
}
// attributes that are always written for the element
@@ -4761,8 +4333,7 @@ void HtmlGenerator::generateManifestFile(const QString &manifest, const QString
}
}
- QMap<int, QString>::const_iterator it = filesToOpen.constEnd();
- while (it != filesToOpen.constBegin()) {
+ for (auto it = filesToOpen.constEnd(); it != filesToOpen.constBegin(); ) {
writer.writeStartElement("fileToOpen");
if (--it == filesToOpen.constBegin()) {
writer.writeAttribute(QStringLiteral("mainFile"), QStringLiteral("true"));
@@ -4772,7 +4343,6 @@ void HtmlGenerator::generateManifestFile(const QString &manifest, const QString
}
writer.writeEndElement(); // example
- ++i;
}
writer.writeEndElement(); // examples
diff --git a/src/qdoc/htmlgenerator.h b/src/qdoc/htmlgenerator.h
index c1564c5b0..86801e0af 100644
--- a/src/qdoc/htmlgenerator.h
+++ b/src/qdoc/htmlgenerator.h
@@ -35,7 +35,7 @@
#include "codemarker.h"
#include "config.h"
-#include "generator.h"
+#include "xmlgenerator.h"
#include <QtCore/qhash.h>
#include <QtCore/qregexp.h>
@@ -45,7 +45,7 @@ QT_BEGIN_NAMESPACE
class HelpProjectWriter;
-class HtmlGenerator : public Generator
+class HtmlGenerator : public XmlGenerator
{
Q_DECLARE_TR_FUNCTIONS(QDoc::HtmlGenerator)
@@ -80,17 +80,12 @@ protected:
void generateCollectionNode(CollectionNode *cn, CodeMarker *marker) override;
void generateGenericCollectionPage(CollectionNode *cn, CodeMarker *marker) override;
QString fileExtension() const override;
- virtual QString refForNode(const Node *node);
- virtual QString linkForNode(const Node *node, const Node *relative);
void generateManifestFile(const QString &manifest, const QString &element);
void readManifestMetaContent(const Config &config);
void generateKeywordAnchors(const Node *node);
void generateAssociatedPropertyNotes(FunctionNode *fn);
- QString getLink(const Atom *atom, const Node *relative, const Node **node);
- QString getAutoLink(const Atom *atom, const Node *relative, const Node **node);
-
private:
enum SubTitleSize { SmallSubTitle, LargeSubTitle };
enum ExtractionMarkType {
@@ -107,7 +102,6 @@ private:
QSet<QString> tags;
};
- const QPair<QString,QString> anchorForNode(const Node *node);
void generateNavigationBar(const QString &title,
const Node *node,
CodeMarker *marker,
@@ -185,12 +179,8 @@ private:
void generateDetailedMember(const Node *node, const PageNode *relative, CodeMarker *marker);
void generateLink(const Atom *atom, CodeMarker *marker);
- inline bool hasBrief(const Node *node);
- QString registerRef(const QString &ref);
QString fileBase(const Node *node) const override;
QString fileName(const Node *node);
- static int hOffset(const Node *node);
- static bool isThreeColumnEnumValueTable(const Atom *atom);
#ifdef GENERATE_MAC_REFS
void generateMacRef(const Node *node, CodeMarker *marker);
#endif
@@ -202,7 +192,6 @@ private:
QXmlStreamWriter &xmlWriter();
- QHash<QString, QString> refMap;
int codeIndent;
QString codePrefix;
QString codeSuffix;
@@ -232,7 +221,7 @@ private:
bool obsoleteLinks;
QStack<QXmlStreamWriter *> xmlWriterStack;
static int id;
- QList<ManifestMetaFilter> manifestMetaContent;
+ QVector<ManifestMetaFilter> manifestMetaContent;
QString homepage;
QString hometitle;
QString landingpage;
@@ -250,15 +239,6 @@ public:
static QString divNavTop;
};
-// Do not display \brief for QML/JS types, document and collection nodes
-inline bool HtmlGenerator::hasBrief(const Node *node)
-{
- return !(node->isQmlType()
- || node->isPageNode()
- || node->isCollectionNode()
- || node->isJsType());
-}
-
#define HTMLGENERATOR_ADDRESS "address"
#define HTMLGENERATOR_FOOTER "footer"
#define HTMLGENERATOR_GENERATEMACREFS "generatemacrefs" // ### document me
diff --git a/src/qdoc/jscodemarker.cpp b/src/qdoc/jscodemarker.cpp
index 6a26fce2e..cc1a234fb 100644
--- a/src/qdoc/jscodemarker.cpp
+++ b/src/qdoc/jscodemarker.cpp
@@ -67,7 +67,7 @@ bool JsCodeMarker::recognizeCode(const QString &code)
QQmlJS::Parser parser(&engine);
QString newCode = code;
- QList<QQmlJS::AST::SourceLocation> pragmas = extractPragmas(newCode);
+ QVector<QQmlJS::AST::SourceLocation> pragmas = extractPragmas(newCode);
lexer.setCode(newCode, 1);
return parser.parseProgram();
@@ -118,7 +118,7 @@ QString JsCodeMarker::addMarkUp(const QString &code,
QQmlJS::Lexer lexer(&engine);
QString newCode = code;
- QList<QQmlJS::AST::SourceLocation> pragmas = extractPragmas(newCode);
+ QVector<QQmlJS::AST::SourceLocation> pragmas = extractPragmas(newCode);
lexer.setCode(newCode, 1);
QQmlJS::Parser parser(&engine);
diff --git a/src/qdoc/location.cpp b/src/qdoc/location.cpp
index f10f53b65..2c088a5b5 100644
--- a/src/qdoc/location.cpp
+++ b/src/qdoc/location.cpp
@@ -215,8 +215,8 @@ void Location::pop()
*/
QString Location::fileName() const
{
- QString fp = filePath();
- return (fp.isEmpty() ? fp : fp.mid(fp.lastIndexOf('/') + 1));
+ QFileInfo fi(filePath());
+ return fi.fileName();
}
diff --git a/src/qdoc/main.cpp b/src/qdoc/main.cpp
index a681231b5..1accb6449 100644
--- a/src/qdoc/main.cpp
+++ b/src/qdoc/main.cpp
@@ -73,7 +73,7 @@ bool creationTimeBefore(const QFileInfo &fi1, const QFileInfo &fi2)
#ifndef QT_NO_TRANSLATION
typedef QPair<QString, QTranslator *> Translator;
-static QList<Translator> translators;
+static QVector<Translator> translators;
#endif
static ClangCodeParser* clangParser_ = nullptr;
@@ -108,9 +108,8 @@ static void loadIndexFiles(Config &config, const QSet<QString> &formats)
for (const auto &format : formats) {
if (config.getBool(format + Config::dot + "nosubdirs")) {
useNoSubDirs = true;
- QString singleOutputSubdir = config.getString(format
- + Config::dot
- + "outputsubdir");
+ QString singleOutputSubdir =
+ config.getString(format + Config::dot + "outputsubdir");
if (singleOutputSubdir.isEmpty())
singleOutputSubdir = "html";
subDirs << singleOutputSubdir;
@@ -119,11 +118,11 @@ static void loadIndexFiles(Config &config, const QSet<QString> &formats)
if (config.dependModules().size() > 0) {
if (config.indexDirs().size() > 0) {
- for (int i = 0; i < config.indexDirs().size(); i++) {
- if (config.indexDirs()[i].startsWith("..")) {
+ for (auto &dir : config.indexDirs()){
+ if (dir.startsWith("..")) {
const QString prefix(QDir(config.currentDir()).relativeFilePath(config.previousCurrentDir()));
if (!prefix.isEmpty())
- config.indexDirs()[i].prepend(prefix + QLatin1Char('/'));
+ dir.prepend(prefix + QLatin1Char('/'));
}
}
/*
@@ -149,13 +148,12 @@ static void loadIndexFiles(Config &config, const QSet<QString> &formats)
config.dependModules() << foundModules;
});
} else {
- for (int i = 0; i < config.indexDirs().size(); i++) {
- QDir scanDir = QDir(config.indexDirs()[i]);
+ for (const auto &indexDir : config.indexDirs()) {
+ QDir scanDir = QDir(indexDir);
scanDir.setFilter(QDir::Dirs | QDir::NoDotAndDotDot);
QFileInfoList dirList = scanDir.entryInfoList();
- for (int j = 0; j < dirList.size(); j++) {
- config.dependModules().append(dirList[j].fileName());
- }
+ for (const auto &dir : dirList)
+ config.dependModules().append(dir.fileName());
}
}
// Remove self-dependencies and possible duplicates
@@ -164,19 +162,16 @@ static void loadIndexFiles(Config &config, const QSet<QString> &formats)
Location::logToStdErrAlways(QString("qdocconf file has depends = *;"
" loading all %1 index files found").arg(config.dependModules().count()));
}
- for (int i = 0; i < config.dependModules().size(); i++) {
- QString indexToAdd;
- QString dependModule = config.dependModules()[i];
- QList<QFileInfo> foundIndices;
+ for (const auto &module : config.dependModules()) {
+ QVector<QFileInfo> foundIndices;
// Always look in module-specific subdir, even with *.nosubdirs config
- bool useModuleSubDir = !subDirs.contains(dependModule);
- subDirs << dependModule;
+ bool useModuleSubDir = !subDirs.contains(module);
+ subDirs << module;
- for (int j = 0; j < config.indexDirs().size(); j++) {
+ for (const auto &dir : config.indexDirs()) {
for (const auto &subDir : subDirs) {
- QString fileToLookFor = config.indexDirs()[j]
- + QLatin1Char('/') + subDir
- + QLatin1Char('/') + dependModule + ".index";
+ QString fileToLookFor = dir + QLatin1Char('/') + subDir
+ + QLatin1Char('/') + module + ".index";
if (QFile::exists(fileToLookFor)) {
QFileInfo tempFileInfo(fileToLookFor);
if (!foundIndices.contains(tempFileInfo))
@@ -186,8 +181,9 @@ static void loadIndexFiles(Config &config, const QSet<QString> &formats)
}
// Clear the temporary module-specific subdir
if (useModuleSubDir)
- subDirs.remove(dependModule);
+ subDirs.remove(module);
std::sort(foundIndices.begin(), foundIndices.end(), creationTimeBefore);
+ QString indexToAdd;
if (foundIndices.size() > 1) {
/*
QDoc should always use the last entry in the multimap when there are
@@ -199,10 +195,10 @@ static void loadIndexFiles(Config &config, const QSet<QString> &formats)
for (const auto &found : qAsConst(foundIndices))
indexPaths << found.absoluteFilePath();
Location::null.warning(QString("Multiple index files found for dependency \"%1\":\n%2").arg(
- dependModule, indexPaths.join('\n')));
+ module, indexPaths.join('\n')));
Location::null.warning(QString("Using %1 as index file for dependency \"%2\"").arg(
foundIndices[foundIndices.size() - 1].absoluteFilePath(),
- dependModule));
+ module));
indexToAdd = foundIndices[foundIndices.size() - 1].absoluteFilePath();
}
else if (foundIndices.size() == 1) {
@@ -214,7 +210,7 @@ static void loadIndexFiles(Config &config, const QSet<QString> &formats)
}
else if (!asteriskUsed) {
Location::null.warning(QString("\"%1\" Cannot locate index file for dependency \"%2\"").arg(
- config.getString(CONFIG_PROJECT), config.dependModules()[i]));
+ config.getString(CONFIG_PROJECT), module));
}
}
}
@@ -292,13 +288,12 @@ static void processQdocconfFile(const QString &fileName, Config &config)
but only if they haven't already been loaded. This works in both
-prepare/-generate mode and -singleexec mode.
*/
- QStringList fileNames = config.getStringList(CONFIG_TRANSLATORS);
- QStringList::ConstIterator fn = fileNames.constBegin();
- while (fn != fileNames.constEnd()) {
+ const QStringList fileNames = config.getStringList(CONFIG_TRANSLATORS);
+ for (const auto &fileName : fileNames) {
bool found = false;
if (!translators.isEmpty()) {
- for (int i=0; i<translators.size(); ++i) {
- if (translators.at(i).first == *fn) {
+ for (const auto &translator : translators) {
+ if (translator.first == fileName) {
found = true;
break;
}
@@ -306,15 +301,14 @@ static void processQdocconfFile(const QString &fileName, Config &config)
}
if (!found) {
QTranslator *translator = new QTranslator(nullptr);
- if (!translator->load(*fn)) {
- config.lastLocation().error(QCoreApplication::translate("QDoc", "Cannot load translator '%1'").arg(*fn));
+ if (!translator->load(fileName)) {
+ config.lastLocation().error(QCoreApplication::translate("QDoc", "Cannot load translator '%1'").arg(fileName));
}
else {
QCoreApplication::instance()->installTranslator(translator);
- translators.append(Translator(*fn, translator));
+ translators.append(Translator(fileName, translator));
}
}
- ++fn;
}
#endif
@@ -391,12 +385,11 @@ static void processQdocconfFile(const QString &fileName, Config &config)
qCDebug(lcQdoc, "Adding doc/image dirs found in exampledirs to imagedirs");
QSet<QString> exampleImageDirs;
QStringList exampleImageList = config.getExampleImageFiles(excludedDirs, excludedFiles);
- for (int i = 0; i < exampleImageList.size(); ++i) {
- if (exampleImageList[i].contains("doc/images")) {
- QString t = exampleImageList[i].left(exampleImageList[i].lastIndexOf("doc/images") + 10);
- if (!exampleImageDirs.contains(t)) {
+ for (const auto &image : exampleImageList) {
+ if (image.contains("doc/images")) {
+ QString t = image.left(image.lastIndexOf("doc/images") + 10);
+ if (!exampleImageDirs.contains(t))
exampleImageDirs.insert(t);
- }
}
}
Generator::augmentImageDirs(exampleImageDirs);
@@ -406,31 +399,31 @@ static void processQdocconfFile(const QString &fileName, Config &config)
QStringList sourceList;
qCDebug(lcQdoc, "Reading headerdirs");
- headerList = config.getAllFiles(CONFIG_HEADERS,CONFIG_HEADERDIRS,excludedDirs,excludedFiles);
- QMap<QString,QString> headers;
- QMultiMap<QString,QString> headerFileNames;
- for (int i=0; i<headerList.size(); ++i) {
- if (headerList[i].contains(QString("doc/snippets")))
+ headerList = config.getAllFiles(CONFIG_HEADERS,CONFIG_HEADERDIRS, excludedDirs, excludedFiles);
+ QMap<QString, QString> headers;
+ QMultiMap<QString, QString> headerFileNames;
+ for (const auto &header : headerList) {
+ if (header.contains(QLatin1String("doc/snippets")))
continue;
- if (headers.contains(headerList[i]))
+ if (headers.contains(header))
continue;
- headers.insert(headerList[i],headerList[i]);
- QString t = headerList[i].mid(headerList[i].lastIndexOf('/')+1);
- headerFileNames.insert(t,t);
+ headers.insert(header, header);
+ QString t = header.mid(header.lastIndexOf('/') + 1);
+ headerFileNames.insert(t, t);
}
qCDebug(lcQdoc, "Reading sourcedirs");
- sourceList = config.getAllFiles(CONFIG_SOURCES,CONFIG_SOURCEDIRS,excludedDirs,excludedFiles);
- QMap<QString,QString> sources;
- QMultiMap<QString,QString> sourceFileNames;
- for (int i=0; i<sourceList.size(); ++i) {
- if (sourceList[i].contains(QString("doc/snippets")))
+ sourceList = config.getAllFiles(CONFIG_SOURCES,CONFIG_SOURCEDIRS, excludedDirs, excludedFiles);
+ QMap<QString, QString> sources;
+ QMultiMap<QString, QString> sourceFileNames;
+ for (const auto &source : sourceList) {
+ if (source.contains(QLatin1String("doc/snippets")))
continue;
- if (sources.contains(sourceList[i]))
+ if (sources.contains(source))
continue;
- sources.insert(sourceList[i],sourceList[i]);
- QString t = sourceList[i].mid(sourceList[i].lastIndexOf('/')+1);
- sourceFileNames.insert(t,t);
+ sources.insert(source, source);
+ QString t = source.mid(source.lastIndexOf('/') + 1);
+ sourceFileNames.insert(t, t);
}
/*
Find all the qdoc files in the example dirs, and add
@@ -438,11 +431,11 @@ static void processQdocconfFile(const QString &fileName, Config &config)
*/
qCDebug(lcQdoc, "Reading exampledirs");
QStringList exampleQdocList = config.getExampleQdocFiles(excludedDirs, excludedFiles);
- for (int i=0; i<exampleQdocList.size(); ++i) {
- if (!sources.contains(exampleQdocList[i])) {
- sources.insert(exampleQdocList[i],exampleQdocList[i]);
- QString t = exampleQdocList[i].mid(exampleQdocList[i].lastIndexOf('/')+1);
- sourceFileNames.insert(t,t);
+ for (const auto &example : exampleQdocList) {
+ if (!sources.contains(example)) {
+ sources.insert(example, example);
+ QString t = example.mid(example.lastIndexOf('/') + 1);
+ sourceFileNames.insert(t, t);
}
}
/*
@@ -452,15 +445,13 @@ static void processQdocconfFile(const QString &fileName, Config &config)
qCDebug(lcQdoc, "Parsing header files");
int parsed = 0;
- QMap<QString,QString>::ConstIterator h = headers.constBegin();
- while (h != headers.constEnd()) {
- CodeParser *codeParser = CodeParser::parserForHeaderFile(h.key());
+ for (auto it = headers.constBegin(); it != headers.constEnd(); ++it) {
+ CodeParser *codeParser = CodeParser::parserForHeaderFile(it.key());
if (codeParser) {
++parsed;
- qCDebug(lcQdoc, "Parsing %s", qPrintable(h.key()));
- codeParser->parseHeaderFile(config.location(), h.key());
+ qCDebug(lcQdoc, "Parsing %s", qPrintable(it.key()));
+ codeParser->parseHeaderFile(config.location(), it.key());
}
- ++h;
}
clangParser_->precompileHeaders();
@@ -471,15 +462,13 @@ static void processQdocconfFile(const QString &fileName, Config &config)
*/
parsed = 0;
Location::logToStdErrAlways("Parse source files for " + project);
- QMap<QString,QString>::ConstIterator s = sources.constBegin();
- while (s != sources.constEnd()) {
- CodeParser *codeParser = CodeParser::parserForSourceFile(s.key());
+ for (const auto &key : sources.keys()) {
+ auto *codeParser = CodeParser::parserForSourceFile(key);
if (codeParser) {
++parsed;
- qCDebug(lcQdoc, "Parsing %s", qPrintable(s.key()));
- codeParser->parseSourceFile(config.location(), s.key());
+ qCDebug(lcQdoc, "Parsing %s", qPrintable(key));
+ codeParser->parseSourceFile(config.location(), key);
}
- ++s;
}
Location::logToStdErrAlways("Source files parsed for " + project);
}
@@ -499,15 +488,13 @@ static void processQdocconfFile(const QString &fileName, Config &config)
one.
*/
qCDebug(lcQdoc, "Generating docs");
- QSet<QString>::ConstIterator of = outputFormats.constBegin();
- while (of != outputFormats.constEnd()) {
- Generator *generator = Generator::generatorForFormat(*of);
+ for (const auto &format : outputFormats) {
+ auto *generator = Generator::generatorForFormat(format);
if (generator == nullptr)
outputFormatsLocation.fatal(QCoreApplication::translate("QDoc",
- "Unknown output format '%1'").arg(*of));
+ "Unknown output format '%1'").arg(format));
generator->initializeFormat(config);
generator->generateDocs();
- ++of;
}
qdb->clearLinkCounts();
@@ -604,9 +591,8 @@ int main(int argc, char **argv)
// Tidy everything away:
#ifndef QT_NO_TRANSLATION
if (!translators.isEmpty()) {
- for (int i=0; i<translators.size(); ++i) {
- delete translators.at(i).second;
- }
+ for (const auto &translator : translators)
+ delete translator.second;
}
translators.clear();
#endif
diff --git a/src/qdoc/node.cpp b/src/qdoc/node.cpp
index 839dd1336..a1df93cb8 100644
--- a/src/qdoc/node.cpp
+++ b/src/qdoc/node.cpp
@@ -158,49 +158,27 @@ bool Node::changeType(NodeType from, NodeType to)
*/
bool Node::nodeNameLessThan(const Node *n1, const Node *n2)
{
+#define LT_RETURN_IF_NOT_EQUAL(a, b) \
+ if ((a) != (b)) \
+ return (a) < (b);
+
if (n1->isPageNode() && n2->isPageNode()) {
- const PageNode *f1 = static_cast<const PageNode *>(n1);
- const PageNode *f2 = static_cast<const PageNode *>(n2);
- if (f1->fullTitle() < f2->fullTitle())
- return true;
- else if (f1->fullTitle() > f2->fullTitle())
- return false;
+ LT_RETURN_IF_NOT_EQUAL(n1->fullName(), n2->fullName());
+ LT_RETURN_IF_NOT_EQUAL(n1->fullTitle(), n2->fullTitle());
}
if (n1->isFunction() && n2->isFunction()) {
const FunctionNode *f1 = static_cast<const FunctionNode *>(n1);
const FunctionNode *f2 = static_cast<const FunctionNode *>(n2);
- if (f1->isConst() < f2->isConst())
- return true;
- else if (f1->isConst() > f2->isConst())
- return false;
-
- if (f1->signature(false, false) < f2->signature(false, false))
- return true;
- else if (f1->signature(false, false) > f2->signature(false, false))
- return false;
+ LT_RETURN_IF_NOT_EQUAL(f1->isConst(), f2->isConst());
+ LT_RETURN_IF_NOT_EQUAL(f1->signature(false, false), f2->signature(false, false));
}
- if (n1->location().filePath() < n2->location().filePath())
- return true;
- else if (n1->location().filePath() > n2->location().filePath())
- return false;
-
- if (n1->nodeType() < n2->nodeType())
- return true;
- else if (n1->nodeType() > n2->nodeType())
- return false;
-
- if (n1->name() < n2->name())
- return true;
- else if (n1->name() > n2->name())
- return false;
-
- if (n1->access() < n2->access())
- return true;
- else if (n1->access() > n2->access())
- return false;
+ LT_RETURN_IF_NOT_EQUAL(n1->location().filePath(), n2->location().filePath());
+ LT_RETURN_IF_NOT_EQUAL(n1->nodeType(), n2->nodeType());
+ LT_RETURN_IF_NOT_EQUAL(n1->name(), n2->name());
+ LT_RETURN_IF_NOT_EQUAL(n1->access(), n2->access());
return false;
}
@@ -681,7 +659,7 @@ QString Node::fullName(const Node *relative) const
If a match is found, return true. If no match is found,
return false.
*/
-bool Node::match(const QList<int> &types) const
+bool Node::match(const QVector<int> &types) const
{
for (int i=0; i<types.size(); ++i) {
if (nodeType() == types.at(i))
@@ -1381,7 +1359,7 @@ QString Node::cleanId(const QString &str)
clean += QLatin1Char('a');
}
- for (int i = 1; i < (int) name.length(); i++) {
+ for (int i = 1; i < name.length(); i++) {
const QChar c = name[i];
const uint u = c.unicode();
if ((u >= 'a' && u <= 'z') ||
@@ -2057,16 +2035,16 @@ void Aggregate::findChildren(const QString &name, NodeVector &nodes) const
{
nodes.clear();
int nonfunctionCount = nonfunctionMap_.count(name);
- FunctionMap::const_iterator i = functionMap_.find(name);
- if (i != functionMap_.end()) {
+ auto it = functionMap_.find(name);
+ if (it != functionMap_.end()) {
int functionCount = 0;
- FunctionNode *fn = i.value();
+ FunctionNode *fn = it.value();
while (fn != nullptr) {
++functionCount;
fn = fn->nextOverload();
}
nodes.reserve(nonfunctionCount + functionCount);
- fn = i.value();
+ fn = it.value();
while (fn != nullptr) {
nodes.append(fn);
fn = fn->nextOverload();
@@ -2075,10 +2053,9 @@ void Aggregate::findChildren(const QString &name, NodeVector &nodes) const
nodes.reserve(nonfunctionCount);
}
if (nonfunctionCount > 0) {
- NodeMap::const_iterator i = nonfunctionMap_.find(name);
- while (i != nonfunctionMap_.end() && i.key() == name) {
- nodes.append(i.value());
- ++i;
+ for (auto it = nonfunctionMap_.find(name);
+ it != nonfunctionMap_.end() && it.key() == name; ++it) {
+ nodes.append(it.value());
}
}
}
@@ -2110,10 +2087,10 @@ Node *Aggregate::findNonfunctionChild(const QString &name, bool (Node::*isMatch)
*/
FunctionNode *Aggregate::findFunctionChild(const QString &name, const Parameters &parameters)
{
- FunctionMap::iterator i = functionMap_.find(name);
- if (i == functionMap_.end())
+ auto it = functionMap_.find(name);
+ if (it == functionMap_.end())
return nullptr;
- FunctionNode *fn = i.value();
+ FunctionNode *fn = it.value();
if (parameters.isEmpty() && fn->parameters().isEmpty() && !fn->isInternal())
return fn;
@@ -2136,10 +2113,10 @@ FunctionNode *Aggregate::findFunctionChild(const QString &name, const Parameters
}
if (parameters.isEmpty()) {
- for (fn = i.value(); fn != nullptr; fn = fn->nextOverload())
+ for (fn = it.value(); fn != nullptr; fn = fn->nextOverload())
if (!fn->isInternal())
return fn;
- return i.value();
+ return it.value();
}
return nullptr;
}
@@ -2206,14 +2183,13 @@ void Aggregate::normalizeOverloads()
Ensure that none of the primary functions is inactive, private,
or marked \e {overload}.
*/
- FunctionMap::Iterator i = functionMap_.begin();
- while (i != functionMap_.end()) {
- FunctionNode *fn = i.value();
+ for (auto it = functionMap_.begin(); it != functionMap_.end(); ++it) {
+ FunctionNode *fn = it.value();
if (fn->isOverload()) {
FunctionNode *primary = fn->findPrimaryFunction();
if (primary) {
primary->setNextOverload(fn);
- i.value() = primary;
+ it.value() = primary;
fn = primary;
} else {
fn->clearOverloadFlag();
@@ -2244,7 +2220,7 @@ void Aggregate::normalizeOverloads()
internalFn->setOverloadNumber(++count);
internalFn = internalFn->nextOverload();
}
- ++i; // process next function in function map.
+ // process next function in function map.
}
/*
Recursive part.
@@ -2384,11 +2360,11 @@ bool Aggregate::isSameSignature(const FunctionNode *f1, const FunctionNode *f2)
*/
void Aggregate::addFunction(FunctionNode *fn)
{
- FunctionMap::iterator i = functionMap_.find(fn->name());
- if (i == functionMap_.end())
+ auto it = functionMap_.find(fn->name());
+ if (it == functionMap_.end())
functionMap_.insert(fn->name(), fn);
else
- i.value()->appendOverload(fn);
+ it.value()->appendOverload(fn);
functionCount_++;
}
@@ -2404,10 +2380,10 @@ void Aggregate::addFunction(FunctionNode *fn)
*/
void Aggregate::adoptFunction(FunctionNode *fn)
{
- FunctionMap::iterator i = functionMap_.find(fn->name());
- if (i == functionMap_.end())
+ auto it = functionMap_.find(fn->name());
+ if (it == functionMap_.end())
functionMap_.insert(fn->name(), fn);
- functionCount_++;
+ ++functionCount_;
}
/*!
@@ -2552,8 +2528,8 @@ QmlPropertyNode *Aggregate::hasQmlProperty(const QString &n, bool attached) cons
*/
bool Aggregate::hasOverloads(const FunctionNode *fn) const
{
- FunctionMap::const_iterator i = functionMap_.find(fn->name());
- return (i == functionMap_.end() ? false : (i.value()->nextOverload() != nullptr));
+ auto it = functionMap_.find(fn->name());
+ return (it == functionMap_.end() ? false : (it.value()->nextOverload() != nullptr));
}
/*!
@@ -2587,19 +2563,19 @@ void Aggregate::printChildren(const QString &title)
*/
void Aggregate::removeFunctionNode(FunctionNode *fn)
{
- FunctionMap::Iterator i = functionMap_.find(fn->name());
- if (i != functionMap_.end()) {
- if (i.value() == fn) {
+ auto it = functionMap_.find(fn->name());
+ if (it != functionMap_.end()) {
+ if (it.value() == fn) {
if (fn->nextOverload() != nullptr) {
- i.value() = fn->nextOverload();
+ it.value() = fn->nextOverload();
fn->setNextOverload(nullptr);
fn->setOverloadNumber(0);
}
else {
- functionMap_.erase(i);
+ functionMap_.erase(it);
}
} else {
- FunctionNode *current = i.value();
+ FunctionNode *current = it.value();
while (current != nullptr) {
if (current->nextOverload() == fn) {
current->setNextOverload(fn->nextOverload());
@@ -2642,9 +2618,8 @@ static bool keep(FunctionNode *fn)
*/
void Aggregate::findAllFunctions(NodeMapMap &functionIndex)
{
- FunctionMap::const_iterator i;
- for (i = functionMap_.constBegin(); i != functionMap_.constEnd(); ++i) {
- FunctionNode *fn = i.value();
+ for (auto it = functionMap_.constBegin(); it != functionMap_.constEnd(); ++it) {
+ FunctionNode *fn = it.value();
if (keep(fn))
functionIndex[fn->name()].insert(fn->parent()->fullDocumentName(), fn);
fn = fn->nextOverload();
@@ -2793,15 +2768,15 @@ void Aggregate::findAllSince()
QString sinceString = node->since();
// Insert a new entry into each map for each new since string found.
if (!node->isPrivate() && !sinceString.isEmpty()) {
- NodeMultiMapMap::iterator nsmap = QDocDatabase::newSinceMaps().find(sinceString);
+ auto nsmap = QDocDatabase::newSinceMaps().find(sinceString);
if (nsmap == QDocDatabase::newSinceMaps().end())
nsmap = QDocDatabase::newSinceMaps().insert(sinceString, NodeMultiMap());
- NodeMapMap::iterator ncmap = QDocDatabase::newClassMaps().find(sinceString);
+ auto ncmap = QDocDatabase::newClassMaps().find(sinceString);
if (ncmap == QDocDatabase::newClassMaps().end())
ncmap = QDocDatabase::newClassMaps().insert(sinceString, NodeMap());
- NodeMapMap::iterator nqcmap = QDocDatabase::newQmlTypeMaps().find(sinceString);
+ auto nqcmap = QDocDatabase::newQmlTypeMaps().find(sinceString);
if (nqcmap == QDocDatabase::newQmlTypeMaps().end())
nqcmap = QDocDatabase::newQmlTypeMaps().insert(sinceString, NodeMap());
@@ -2953,7 +2928,7 @@ QString Aggregate::typeWord(bool cap) const
is called recursively with the list of base classes from
that private or internal class node.
*/
-void ClassNode::promotePublicBases(const QList<RelatedClass> &bases)
+void ClassNode::promotePublicBases(const QVector<RelatedClass> &bases)
{
if (!bases.isEmpty()) {
for (int i = bases.size() - 1; i >= 0; --i) {
@@ -3003,7 +2978,7 @@ void ClassNode::removePrivateAndInternalBases()
ClassNode *dc = derived_.at(i).node_;
if (dc != nullptr && (dc->isPrivate() || dc->isInternal())) {
derived_.removeAt(i);
- const QList<RelatedClass> &dd = dc->derivedClasses();
+ const QVector<RelatedClass> &dd = dc->derivedClasses();
for (int j = dd.size() - 1; j >= 0; --j)
derived_.insert(i, dd.at(j));
}
@@ -3017,9 +2992,8 @@ void ClassNode::removePrivateAndInternalBases()
*/
void ClassNode::resolvePropertyOverriddenFromPtrs(PropertyNode *pn)
{
- QList<RelatedClass>::const_iterator bc = baseClasses().constBegin();
- while (bc != baseClasses().constEnd()) {
- ClassNode *cn = bc->node_;
+ for (const auto &baseClass : qAsConst(baseClasses())) {
+ ClassNode *cn = baseClass.node_;
if (cn) {
Node *n = cn->findNonfunctionChild(pn->name(), &Node::isProperty);
if (n) {
@@ -3030,7 +3004,6 @@ void ClassNode::resolvePropertyOverriddenFromPtrs(PropertyNode *pn)
else
cn->resolvePropertyOverriddenFromPtrs(pn);
}
- ++bc;
}
}
@@ -3404,7 +3377,7 @@ PropertyNode *ClassNode::findPropertyNode(const QString &name)
PropertyNode *pn = nullptr;
- const QList<RelatedClass> &bases = baseClasses();
+ const QVector<RelatedClass> &bases = baseClasses();
if (!bases.isEmpty()) {
for (int i = 0; i < bases.size(); ++i) {
ClassNode *cn = bases[i].node_;
@@ -3415,7 +3388,7 @@ PropertyNode *ClassNode::findPropertyNode(const QString &name)
}
}
}
- const QList<RelatedClass> &ignoredBases = ignoredBaseClasses();
+ const QVector<RelatedClass> &ignoredBases = ignoredBaseClasses();
if (!ignoredBases.isEmpty()) {
for (int i = 0; i < ignoredBases.size(); ++i) {
ClassNode *cn = ignoredBases[i].node_;
@@ -3439,7 +3412,7 @@ PropertyNode *ClassNode::findPropertyNode(const QString &name)
QmlTypeNode *ClassNode::findQmlBaseNode()
{
QmlTypeNode *result = nullptr;
- const QList<RelatedClass> &bases = baseClasses();
+ const QVector<RelatedClass> &bases = baseClasses();
if (!bases.isEmpty()) {
for (int i = 0; i < bases.size(); ++i) {
@@ -3473,12 +3446,11 @@ QmlTypeNode *ClassNode::findQmlBaseNode()
*/
FunctionNode *ClassNode::findOverriddenFunction(const FunctionNode *fn)
{
- QList<RelatedClass>::Iterator bc = bases_.begin();
- while (bc != bases_.end()) {
- ClassNode *cn = bc->node_;
+ for (auto &bc : bases_) {
+ ClassNode *cn = bc.node_;
if (cn == nullptr) {
- cn = QDocDatabase::qdocDB()->findClassNode(bc->path_);
- bc->node_ = cn;
+ cn = QDocDatabase::qdocDB()->findClassNode(bc.path_);
+ bc.node_ = cn;
}
if (cn != nullptr) {
FunctionNode *result = cn->findFunctionChild(fn);
@@ -3488,7 +3460,6 @@ FunctionNode *ClassNode::findOverriddenFunction(const FunctionNode *fn)
if (result != nullptr && !result->isNonvirtual())
return result;
}
- ++bc;
}
return nullptr;
}
@@ -3502,31 +3473,27 @@ FunctionNode *ClassNode::findOverriddenFunction(const FunctionNode *fn)
*/
PropertyNode *ClassNode::findOverriddenProperty(const FunctionNode *fn)
{
- QList<RelatedClass>::Iterator bc = bases_.begin();
- while (bc != bases_.end()) {
- ClassNode *cn = bc->node_;
+ for (auto &baseClass : bases_) {
+ ClassNode *cn = baseClass.node_;
if (cn == nullptr) {
- cn = QDocDatabase::qdocDB()->findClassNode(bc->path_);
- bc->node_ = cn;
+ cn = QDocDatabase::qdocDB()->findClassNode(baseClass.path_);
+ baseClass.node_ = cn;
}
if (cn != nullptr) {
const NodeList &children = cn->childNodes();
- NodeList::const_iterator i = children.begin();
- while (i != children.end()) {
- if ((*i)->isProperty()) {
- PropertyNode *pn = static_cast<PropertyNode *>(*i);
+ for (const auto &child : children) {
+ if (child->isProperty()) {
+ PropertyNode *pn = static_cast<PropertyNode *>(child);
if (pn->name() == fn->name() || pn->hasAccessFunction(fn->name())) {
if (pn->hasDoc())
return pn;
}
}
- i++;
}
PropertyNode *result = cn->findOverriddenProperty(fn);
if (result != nullptr)
return result;
}
- ++bc;
}
return nullptr;
}
@@ -3611,17 +3578,7 @@ bool HeaderNode::hasDocumentedChildren() const
*/
/*!
- Returns the node's full title, which is usually whatever
- title() returns, but for some cases the full title migth
- be different from title(), so this might require changing,
- because currently it just returns the title().
-
- mws 13/07/2018. This function used to test the node subtype
- for File or Image and append text to the title(), but there
- are no node subtypes now, so it can't do that. There are no
- node type values for File and Image either. Files and images
- are used in examples, but the ExampleNode's example files
- and example images are stored as lists of path strings.
+ Returns the node's full title.
*/
QString PageNode::fullTitle() const
{
@@ -4263,7 +4220,6 @@ QString FunctionNode::metanessString() const
default:
return "plain";
}
- return QString();
}
/*!
@@ -4521,29 +4477,21 @@ QString PropertyNode::qualifiedDataType() const
*/
bool PropertyNode::hasAccessFunction(const QString &name) const
{
- NodeList::const_iterator i = getters().begin();
- while (i != getters().end()) {
- if ((*i)->name() == name)
+ for (const auto &getter : getters()) {
+ if (getter->name() == name)
return true;
- ++i;
}
- i = setters().begin();
- while (i != setters().end()) {
- if ((*i)->name() == name)
+ for (const auto &setter : setters()) {
+ if (setter->name() == name)
return true;
- ++i;
}
- i = resetters().begin();
- while (i != resetters().end()) {
- if ((*i)->name() == name)
+ for (const auto &resetter : resetters()) {
+ if (resetter->name() == name)
return true;
- ++i;
}
- i = notifiers().begin();
- while (i != notifiers().end()) {
- if ((*i)->name() == name)
+ for (const auto &notifier : notifiers()) {
+ if (notifier->name() == name)
return true;
- ++i;
}
return false;
}
@@ -4866,11 +4814,9 @@ void CollectionNode::addMember(Node *node)
bool CollectionNode::hasNamespaces() const
{
if (!members_.isEmpty()) {
- NodeList::const_iterator i = members_.begin();
- while (i != members_.end()) {
- if ((*i)->isNamespace())
+ for (const auto &member : qAsConst(members_)) {
+ if (member->isNamespace())
return true;
- ++i;
}
}
return false;
@@ -4883,11 +4829,9 @@ bool CollectionNode::hasNamespaces() const
bool CollectionNode::hasClasses() const
{
if (!members_.isEmpty()) {
- NodeList::const_iterator i = members_.cbegin();
- while (i != members_.cend()) {
- if ((*i)->isClassNode())
+ for (const auto &member : qAsConst(members_)) {
+ if (member->isClassNode())
return true;
- ++i;
}
}
return false;
@@ -4900,11 +4844,9 @@ bool CollectionNode::hasClasses() const
void CollectionNode::getMemberNamespaces(NodeMap& out)
{
out.clear();
- NodeList::const_iterator i = members_.cbegin();
- while (i != members_.cend()) {
- if ((*i)->isNamespace())
- out.insert((*i)->name(), (*i));
- ++i;
+ for (const auto &member : qAsConst(members_)) {
+ if (member->isNamespace())
+ out.insert(member->name(), member);
}
}
@@ -4915,11 +4857,9 @@ void CollectionNode::getMemberNamespaces(NodeMap& out)
void CollectionNode::getMemberClasses(NodeMap& out) const
{
out.clear();
- NodeList::const_iterator i = members_.cbegin();
- while (i != members_.cend()) {
- if ((*i)->isClassNode())
- out.insert((*i)->name(), (*i));
- ++i;
+ for (const auto &i : qAsConst(members_)) {
+ if (i->isClassNode())
+ out.insert(i->name(), i);
}
}
@@ -4931,10 +4871,8 @@ void CollectionNode::printMembers(const QString &title)
{
qDebug() << title << name() << members_.size();
if (members_.size() > 0) {
- for (int i=0; i<members_.size(); ++i) {
- Node *n = members_.at(i);
- qDebug() << " MEMBER:" << n->name() << n->nodeTypeString();
- }
+ for (const auto &member : qAsConst(members_))
+ qDebug() << " MEMBER:" << member->name() << member->nodeTypeString();
}
}
diff --git a/src/qdoc/node.h b/src/qdoc/node.h
index baec4d9f2..6594df921 100644
--- a/src/qdoc/node.h
+++ b/src/qdoc/node.h
@@ -58,7 +58,7 @@ class SharedCommentNode;
typedef QMap<QString, FunctionNode *> FunctionMap;
typedef QList<Node *> NodeList;
-typedef QList<ClassNode *> ClassList;
+typedef QVector<ClassNode *> ClassList;
typedef QVector<Node *> NodeVector;
typedef QMap<QString, Node *> NodeMap;
typedef QMap<QString, NodeMap> NodeMapMap;
@@ -66,7 +66,7 @@ typedef QMultiMap<QString, Node *> NodeMultiMap;
typedef QMap<QString, NodeMultiMap> NodeMultiMapMap;
typedef QMap<QString, CollectionNode *> CNMap;
typedef QMultiMap<QString, CollectionNode *> CNMultiMap;
-typedef QList<CollectionNode *> CollectionList;
+typedef QVector<CollectionNode *> CollectionList;
class Node
{
@@ -287,7 +287,7 @@ public:
virtual void markDefault() { }
virtual void markReadOnly(bool ) { }
- bool match(const QList<int> &types) const;
+ bool match(const QVector<int> &types) const;
Aggregate *parent() const { return parent_; }
const QString &name() const { return name_; }
QString physicalModuleName() const;
@@ -441,9 +441,10 @@ protected:
class ExternalPageNode : public PageNode
{
public:
- ExternalPageNode(Aggregate *parent, const QString &name)
- : PageNode(Node::ExternalPage, parent, name) {
+ ExternalPageNode(Aggregate *parent, const QString &url)
+ : PageNode(Node::ExternalPage, parent, url) {
setPageType(Node::ArticlePage);
+ setUrl(url);
}
};
@@ -614,15 +615,15 @@ public:
void removePrivateAndInternalBases();
void resolvePropertyOverriddenFromPtrs(PropertyNode *pn);
- QList<RelatedClass> &baseClasses() { return bases_; }
- QList<RelatedClass> &derivedClasses() { return derived_; }
- QList<RelatedClass> &ignoredBaseClasses() { return ignoredBases_; }
- QList<UsingClause> &usingClauses() { return usingClauses_; }
+ QVector<RelatedClass> &baseClasses() { return bases_; }
+ QVector<RelatedClass> &derivedClasses() { return derived_; }
+ QVector<RelatedClass> &ignoredBaseClasses() { return ignoredBases_; }
+ QVector<UsingClause> &usingClauses() { return usingClauses_; }
- const QList<RelatedClass> &baseClasses() const { return bases_; }
- const QList<RelatedClass> &derivedClasses() const { return derived_; }
- const QList<RelatedClass> &ignoredBaseClasses() const { return ignoredBases_; }
- const QList<UsingClause> &usingClauses() const { return usingClauses_; }
+ const QVector<RelatedClass> &baseClasses() const { return bases_; }
+ const QVector<RelatedClass> &derivedClasses() const { return derived_; }
+ const QVector<RelatedClass> &ignoredBaseClasses() const { return ignoredBases_; }
+ const QVector<UsingClause> &usingClauses() const { return usingClauses_; }
QmlTypeNode *qmlElement() { return qmlelement; }
void setQmlElement(QmlTypeNode *qcn) { qmlelement = qcn; }
@@ -635,13 +636,13 @@ public:
bool docMustBeGenerated() const override;
private:
- void promotePublicBases(const QList<RelatedClass> &bases);
+ void promotePublicBases(const QVector<RelatedClass> &bases);
private:
- QList<RelatedClass> bases_;
- QList<RelatedClass> derived_;
- QList<RelatedClass> ignoredBases_;
- QList<UsingClause> usingClauses_;
+ QVector<RelatedClass> bases_;
+ QVector<RelatedClass> derived_;
+ QVector<RelatedClass> ignoredBases_;
+ QVector<UsingClause> usingClauses_;
bool abstract_;
bool wrapper_;
QString obsoleteLink_;
@@ -706,7 +707,7 @@ struct ImportRec {
bool isEmpty() const { return name_.isEmpty(); }
};
-typedef QList<ImportRec> ImportList;
+typedef QVector<ImportRec> ImportList;
class QmlTypeNode : public Aggregate
{
@@ -846,14 +847,14 @@ public:
void setFlagsType(TypedefNode *typedeff);
bool hasItem(const QString &name) const { return names_.contains(name); }
- const QList<EnumItem> &items() const { return items_; }
+ const QVector<EnumItem> &items() const { return items_; }
Access itemAccess(const QString &name) const;
const TypedefNode *flagsType() const { return flagsType_; }
QString itemValue(const QString &name) const;
Node *clone(Aggregate *parent) override;
private:
- QList<EnumItem> items_;
+ QVector<EnumItem> items_;
QSet<QString> names_;
const TypedefNode *flagsType_;
};
diff --git a/src/qdoc/openedlist.cpp b/src/qdoc/openedlist.cpp
index ce9efb06e..a36e3b545 100644
--- a/src/qdoc/openedlist.cpp
+++ b/src/qdoc/openedlist.cpp
@@ -135,7 +135,7 @@ int OpenedList::fromAlpha(const QString &str)
int n = 0;
int u;
- for (int i = 0; i < (int) str.length(); i++) {
+ for (int i = 0; i < str.length(); i++) {
u = str[i].toLower().unicode();
if (u >= 'a' && u <= 'z') {
n *= 26;
diff --git a/src/qdoc/parameters.cpp b/src/qdoc/parameters.cpp
index 44178c9d9..96a591a2a 100644
--- a/src/qdoc/parameters.cpp
+++ b/src/qdoc/parameters.cpp
@@ -507,21 +507,23 @@ void Parameters::set(const QString &signature)
/*!
Insert all the parameter names into names.
*/
-void Parameters::getNames(QSet<QString> &names) const
+QSet<QString> Parameters::getNames() const
{
+ QSet<QString> names;
const auto params = parameters_;
for (const auto &parameter : params) {
if (!parameter.name().isEmpty())
names.insert(parameter.name());
}
+ return names;
}
/*!
- Construct a list of the parameter types and append it to
- \a out. \a out is not cleared first.
+ Construct a list of the parameter types and return it.
*/
-void Parameters::getTypeList(QString &out) const
+QString Parameters::generateTypeList() const
{
+ QString out;
if (count() > 0) {
for (int i = 0; i < count(); ++i) {
if (i > 0)
@@ -529,14 +531,16 @@ void Parameters::getTypeList(QString &out) const
out += parameters_.at(i).type();
}
}
+ return out;
}
/*!
Construct a list of the parameter type/name pairs and
- append it to \a out. \a out is not cleared first.
+ return it.
*/
-void Parameters::getTypeAndNameList(QString &out) const
+QString Parameters::generateTypeAndNameList() const
{
+ QString out;
if (count() > 0) {
for (int i = 0; i < count(); ++i) {
if (i != 0)
@@ -548,6 +552,7 @@ void Parameters::getTypeAndNameList(QString &out) const
out += p.name();
}
}
+ return out;
}
/*!
diff --git a/src/qdoc/parameters.h b/src/qdoc/parameters.h
index dcd4517eb..7e72d1689 100644
--- a/src/qdoc/parameters.h
+++ b/src/qdoc/parameters.h
@@ -97,9 +97,9 @@ public:
QString signature(bool includeValues = false) const;
QString rawSignature(bool names = false, bool values = false) const;
void set(const QString &signature);
- void getNames(QSet<QString> &names) const;
- void getTypeList(QString &out) const;
- void getTypeAndNameList(QString &out) const;
+ QSet<QString> getNames() const;
+ QString generateTypeList() const;
+ QString generateTypeAndNameList() const;
bool match(const Parameters &parameters) const;
private:
diff --git a/src/qdoc/qdoc.pro b/src/qdoc/qdoc.pro
index df9123b09..c38c50b16 100644
--- a/src/qdoc/qdoc.pro
+++ b/src/qdoc/qdoc.pro
@@ -58,6 +58,7 @@ HEADERS += atom.h \
text.h \
tokenizer.h \
tree.h \
+ xmlgenerator.h \
webxmlgenerator.h \
qdoccommandlineparser.h \
utilities.h
@@ -90,6 +91,7 @@ SOURCES += atom.cpp \
text.cpp \
tokenizer.cpp \
tree.cpp \
+ xmlgenerator.cpp \
yyindent.cpp \
webxmlgenerator.cpp \
qdoccommandlineparser.cpp \
diff --git a/src/qdoc/qdocdatabase.cpp b/src/qdoc/qdocdatabase.cpp
index 311b19db7..5c4acdbf1 100644
--- a/src/qdoc/qdocdatabase.cpp
+++ b/src/qdoc/qdocdatabase.cpp
@@ -175,9 +175,9 @@ void QDocForest::setSearchOrder(const QStringList &t)
return;
/* Allocate space for the search order. */
- searchOrder_.reserve(forest_.size()+1);
+ searchOrder_.reserve(forest_.size() + 1);
searchOrder_.clear();
- moduleNames_.reserve(forest_.size()+1);
+ moduleNames_.reserve(forest_.size() + 1);
moduleNames_.clear();
/* The primary tree is always first in the search order. */
@@ -186,12 +186,11 @@ void QDocForest::setSearchOrder(const QStringList &t)
moduleNames_.append(primaryName);
forest_.remove(primaryName);
- QMap<QString, Tree *>::iterator i;
for (const QString &m : t) {
if (primaryName != m) {
- i = forest_.find(m);
- if (i != forest_.end()) {
- searchOrder_.append(i.value());
+ auto it = forest_.find(m);
+ if (it != forest_.end()) {
+ searchOrder_.append(it.value());
moduleNames_.append(m);
forest_.remove(m);
}
@@ -203,11 +202,9 @@ void QDocForest::setSearchOrder(const QStringList &t)
know any better at this point.
*/
if (!forest_.isEmpty()) {
- i = forest_.begin();
- while (i != forest_.end()) {
- searchOrder_.append(i.value());
- moduleNames_.append(i.key());
- ++i;
+ for (auto it = forest_.begin(); it != forest_.end(); ++it) {
+ searchOrder_.append(it.value());
+ moduleNames_.append(it.key());
}
forest_.clear();
}
@@ -349,17 +346,15 @@ void QDocForest::printLinkCounts(const QString &project)
}
QString depends = "depends +=";
QString module = project.toLower();
- QMultiMap<int, QString>::iterator i = m.begin();
- while (i != m.end()) {
- QString line = " " + i.value();
- if (i.value() != module)
- depends += QLatin1Char(' ') + i.value();
+ for (auto it = m.begin(); it != m.end(); ++it) {
+ QString line = " " + it.value();
+ if (it.value() != module)
+ depends += QLatin1Char(' ') + it.value();
int pad = 30 - line.length();
for (int k=0; k<pad; ++k)
line += QLatin1Char(' ');
line += "%1";
- Location::null.report(line.arg(-(i.key())));
- ++i;
+ Location::null.report(line.arg(-(it.key())));
}
Location::null.report("Optimal depends variable:");
Location::null.report(depends);
@@ -378,14 +373,12 @@ QString QDocForest::getLinkCounts(QStringList &strings, QVector<int> &counts)
}
QString depends = "depends +=";
QString module = Generator::defaultModuleName().toLower();
- QMultiMap<int, QString>::iterator i = m.begin();
- while (i != m.end()) {
- if (i.value() != module) {
- counts.append(-(i.key()));
- strings.append(i.value());
- depends += QLatin1Char(' ') + i.value();
+ for (auto it = m.begin(); it != m.end(); ++it) {
+ if (it.value() != module) {
+ counts.append(-(it.key()));
+ strings.append(it.value());
+ depends += QLatin1Char(' ') + it.value();
}
- ++i;
}
return depends;
}
@@ -1032,15 +1025,13 @@ NodeMapMap &QDocDatabase::getFunctionIndex()
*/
void QDocDatabase::findAllLegaleseTexts(Aggregate *node)
{
- NodeList::ConstIterator c = node->constBegin();
- while (c != node->constEnd()) {
- if (!(*c)->isPrivate()) {
- if (!(*c)->doc().legaleseText().isEmpty())
- legaleseTexts_.insertMulti((*c)->doc().legaleseText(), *c);
- if ((*c)->isAggregate())
- findAllLegaleseTexts(static_cast<Aggregate *>(*c));
+ for (auto it = node->constBegin(); it != node->constEnd(); ++it) {
+ if (!(*it)->isPrivate()) {
+ if (!(*it)->doc().legaleseText().isEmpty())
+ legaleseTexts_.insertMulti((*it)->doc().legaleseText(), *it);
+ if ((*it)->isAggregate())
+ findAllLegaleseTexts(static_cast<Aggregate *>(*it));
}
- ++c;
}
}
@@ -1072,9 +1063,9 @@ const NodeMap &QDocDatabase::getClassMap(const QString &key)
{
if (newSinceMaps_.isEmpty() && newClassMaps_.isEmpty() && newQmlTypeMaps_.isEmpty())
processForest(&QDocDatabase::findAllSince);
- NodeMapMap::const_iterator i = newClassMaps_.constFind(key);
- if (i != newClassMaps_.constEnd())
- return i.value();
+ auto it = newClassMaps_.constFind(key);
+ if (it != newClassMaps_.constEnd())
+ return it.value();
return emptyNodeMap_;
}
@@ -1087,9 +1078,9 @@ const NodeMap &QDocDatabase::getQmlTypeMap(const QString &key)
{
if (newSinceMaps_.isEmpty() && newClassMaps_.isEmpty() && newQmlTypeMaps_.isEmpty())
processForest(&QDocDatabase::findAllSince);
- NodeMapMap::const_iterator i = newQmlTypeMaps_.constFind(key);
- if (i != newQmlTypeMaps_.constEnd())
- return i.value();
+ auto it = newQmlTypeMaps_.constFind(key);
+ if (it != newQmlTypeMaps_.constEnd())
+ return it.value();
return emptyNodeMap_;
}
@@ -1102,9 +1093,9 @@ const NodeMap &QDocDatabase::getSinceMap(const QString &key)
{
if (newSinceMaps_.isEmpty() && newClassMaps_.isEmpty() && newQmlTypeMaps_.isEmpty())
processForest(&QDocDatabase::findAllSince);
- NodeMultiMapMap::const_iterator i = newSinceMaps_.constFind(key);
- if (i != newSinceMaps_.constEnd())
- return i.value();
+ auto it = newSinceMaps_.constFind(key);
+ if (it != newSinceMaps_.constEnd())
+ return it.value();
return emptyNodeMultiMap_;
}
@@ -1232,12 +1223,11 @@ void QDocDatabase::resolveNamespaces()
for (auto *node : namespaces) {
auto *nameSpaceNode = static_cast<NamespaceNode *>(node);
if (nameSpaceNode != ns) {
- NodeList::ConstIterator c = nameSpaceNode->constBegin();
- while (c != nameSpaceNode->constEnd()) {
- Node *N = *c;
+ for (auto it = nameSpaceNode->constBegin();
+ it != nameSpaceNode->constEnd(); ++it) {
+ Node *N = *it;
if (N && N->isPublic() && !N->isInternal())
ns->includeChild(N);
- ++c;
}
}
}
@@ -1326,9 +1316,9 @@ const Node *QDocDatabase::findTypeNode(const QString &type, const Node *relative
{
QStringList path = type.split("::");
if ((path.size() == 1) && (path.at(0)[0].isLower() || path.at(0) == QString("T"))) {
- NodeMap::iterator i = typeNodeMap_.find(path.at(0));
- if (i != typeNodeMap_.end())
- return i.value();
+ auto it = typeNodeMap_.find(path.at(0));
+ if (it != typeNodeMap_.end())
+ return it.value();
}
return forest_.findTypeNode(path, relative, genus);
}
@@ -1445,11 +1435,9 @@ void QDocDatabase::mergeCollections(Node::NodeType type, CNMap &cnm, const Node
for (auto *tree : searchOrder()) {
CNMap *m = tree->getCollectionMap(type);
if (m && !m->isEmpty()) {
- CNMap::const_iterator i = m->cbegin();
- while (i != m->cend()) {
- if (!i.value()->isInternal())
- cnmm.insert(i.key(), i.value());
- ++i;
+ for (auto it = m->cbegin(); it != m->cend(); ++it) {
+ if (!it.value()->isInternal())
+ cnmm.insert(it.key(), it.value());
}
}
}
diff --git a/src/qdoc/qdocindexfiles.cpp b/src/qdoc/qdocindexfiles.cpp
index 9ea7d9f86..022d658b1 100644
--- a/src/qdoc/qdocindexfiles.cpp
+++ b/src/qdoc/qdocindexfiles.cpp
@@ -157,6 +157,11 @@ void QDocIndexFiles::readIndexFile(const QString &path)
basesList_.clear();
NamespaceNode *root = qdb_->newIndexTree(project_);
+ if (!root) {
+ qWarning() << "Issue parsing index tree" << path;
+ return;
+ }
+
root->tree()->setIndexTitle(indexTitle);
// Scan all elements in the XML file, constructing a map that contains
@@ -387,7 +392,7 @@ void QDocIndexFiles::readIndexSection(QXmlStreamReader& reader,
} else
goto done;
- if (current && current->isExample()) {
+ if (current->isExample()) {
ExampleNode *en = static_cast<ExampleNode *>(current);
if (subtype == QDocAttrFile) {
en->appendFile(name);
@@ -950,7 +955,7 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter &writer, Node *node,
{
// Classes contain information about their base classes.
const ClassNode *classNode = static_cast<const ClassNode *>(node);
- const QList<RelatedClass> bases = classNode->baseClasses();
+ const QVector<RelatedClass> bases = classNode->baseClasses();
QSet<QString> baseStrings;
for (const auto &related : bases) {
ClassNode *n = related.node_;
@@ -1445,14 +1450,12 @@ void QDocIndexFiles::generateFunctionSections(QXmlStreamWriter &writer, Aggregat
{
FunctionMap &functionMap = aggregate->functionMap();
if (!functionMap.isEmpty()) {
- FunctionMap::iterator i = functionMap.begin();
- while (i != functionMap.end()) {
- FunctionNode *fn = i.value();
+ for (auto it = functionMap.begin(); it != functionMap.end(); ++it) {
+ FunctionNode *fn = it.value();
while (fn != nullptr) {
generateFunctionSection(writer, fn);
fn = fn->nextOverload();
}
- i++;
}
}
}
@@ -1492,41 +1495,33 @@ void QDocIndexFiles::generateIndexSections(QXmlStreamWriter &writer, Node *node,
*/
const CNMap &groups = qdb_->groups();
if (!groups.isEmpty()) {
- CNMap::ConstIterator g = groups.constBegin();
- while (g != groups.constEnd()) {
- if (generateIndexSection(writer, g.value(), post))
+ for (auto it = groups.constBegin(); it != groups.constEnd(); ++it) {
+ if (generateIndexSection(writer, it.value(), post))
writer.writeEndElement();
- ++g;
}
}
const CNMap &modules = qdb_->modules();
if (!modules.isEmpty()) {
- CNMap::ConstIterator g = modules.constBegin();
- while (g != modules.constEnd()) {
- if (generateIndexSection(writer, g.value(), post))
+ for (auto it = modules.constBegin(); it != modules.constEnd(); ++it) {
+ if (generateIndexSection(writer, it.value(), post))
writer.writeEndElement();
- ++g;
}
}
const CNMap &qmlModules = qdb_->qmlModules();
if (!qmlModules.isEmpty()) {
- CNMap::ConstIterator g = qmlModules.constBegin();
- while (g != qmlModules.constEnd()) {
- if (generateIndexSection(writer, g.value(), post))
+ for (auto it = qmlModules.constBegin(); it != qmlModules.constEnd(); ++it) {
+ if (generateIndexSection(writer, it.value(), post))
writer.writeEndElement();
- ++g;
}
}
const CNMap &jsModules = qdb_->jsModules();
if (!jsModules.isEmpty()) {
- CNMap::ConstIterator g = jsModules.constBegin();
- while (g != jsModules.constEnd()) {
- if (generateIndexSection(writer, g.value(), post))
+ for (auto it = jsModules.constBegin(); it != jsModules.constEnd(); ++it) {
+ if (generateIndexSection(writer, it.value(), post))
writer.writeEndElement();
- ++g;
}
}
}
diff --git a/src/qdoc/qdoctagfiles.cpp b/src/qdoc/qdoctagfiles.cpp
index bdf001469..cd4e9e0e5 100644
--- a/src/qdoc/qdoctagfiles.cpp
+++ b/src/qdoc/qdoctagfiles.cpp
@@ -138,7 +138,7 @@ void QDocTagFiles::generateTagFileCompounds(QXmlStreamWriter &writer, const Aggr
// Classes contain information about their base classes.
const ClassNode *classNode = static_cast<const ClassNode *>(node);
- const QList<RelatedClass> bases = classNode->baseClasses();
+ const QVector<RelatedClass> bases = classNode->baseClasses();
for (const auto &related : bases) {
ClassNode *n = related.node_;
if (n)
diff --git a/src/qdoc/qmlcodemarker.cpp b/src/qdoc/qmlcodemarker.cpp
index fe39e6e54..719fc710b 100644
--- a/src/qdoc/qmlcodemarker.cpp
+++ b/src/qdoc/qmlcodemarker.cpp
@@ -145,11 +145,9 @@ QString QmlCodeMarker::markedUpIncludes(const QStringList &includes)
{
QString code;
- QStringList::ConstIterator inc = includes.constBegin();
- while (inc != includes.constEnd()) {
- code += "import " + *inc + QLatin1Char('\n');
- ++inc;
- }
+ for (const auto &include : includes)
+ code += "import " + include + QLatin1Char('\n');
+
Location location;
return addMarkUp(code, nullptr, location);
}
@@ -174,7 +172,7 @@ QString QmlCodeMarker::addMarkUp(const QString &code,
QQmlJS::Lexer lexer(&engine);
QString newCode = code;
- QList<QQmlJS::AST::SourceLocation> pragmas = extractPragmas(newCode);
+ QVector<QQmlJS::AST::SourceLocation> pragmas = extractPragmas(newCode);
lexer.setCode(newCode, 1);
QQmlJS::Parser parser(&engine);
@@ -226,11 +224,11 @@ static void replaceWithSpace(QString &str, int idx, int n)
Searches for ".pragma <value>" or ".import <stuff>" declarations
in \a script. Currently supported pragmas are: library
*/
-QList<QQmlJS::AST::SourceLocation> QmlCodeMarker::extractPragmas(QString &script)
+QVector<QQmlJS::AST::SourceLocation> QmlCodeMarker::extractPragmas(QString &script)
{
const QString pragma(QLatin1String("pragma"));
const QString library(QLatin1String("library"));
- QList<QQmlJS::AST::SourceLocation> removed;
+ QVector<QQmlJS::AST::SourceLocation> removed;
QQmlJS::Lexer l(nullptr);
l.setCode(script, 0);
diff --git a/src/qdoc/qmlcodemarker.h b/src/qdoc/qmlcodemarker.h
index e28d46309..81194cb36 100644
--- a/src/qdoc/qmlcodemarker.h
+++ b/src/qdoc/qmlcodemarker.h
@@ -65,7 +65,7 @@ public:
/* Copied from src/declarative/qml/qdeclarativescriptparser.cpp */
#ifndef QT_NO_DECLARATIVE
- QList<QQmlJS::AST::SourceLocation> extractPragmas(QString &script);
+ QVector<QQmlJS::AST::SourceLocation> extractPragmas(QString &script);
#endif
private:
diff --git a/src/qdoc/qmlmarkupvisitor.cpp b/src/qdoc/qmlmarkupvisitor.cpp
index e99bf5fc3..dbcdf8aa5 100644
--- a/src/qdoc/qmlmarkupvisitor.cpp
+++ b/src/qdoc/qmlmarkupvisitor.cpp
@@ -41,7 +41,7 @@ QT_BEGIN_NAMESPACE
#ifndef QT_NO_DECLARATIVE
QmlMarkupVisitor::QmlMarkupVisitor(const QString &source,
- const QList<QQmlJS::AST::SourceLocation> &pragmas,
+ const QVector<QQmlJS::AST::SourceLocation> &pragmas,
QQmlJS::Engine *engine)
{
this->source = source;
diff --git a/src/qdoc/qmlmarkupvisitor.h b/src/qdoc/qmlmarkupvisitor.h
index 1f48722b1..a0e3f870b 100644
--- a/src/qdoc/qmlmarkupvisitor.h
+++ b/src/qdoc/qmlmarkupvisitor.h
@@ -51,7 +51,7 @@ public:
};
QmlMarkupVisitor(const QString &code,
- const QList<QQmlJS::AST::SourceLocation> &pragmas,
+ const QVector<QQmlJS::AST::SourceLocation> &pragmas,
QQmlJS::Engine *engine);
virtual ~QmlMarkupVisitor();
@@ -158,7 +158,7 @@ private:
QQmlJS::Engine *engine;
QVector<ExtraType> extraTypes;
- QList<QQmlJS::AST::SourceLocation> extraLocations;
+ QVector<QQmlJS::AST::SourceLocation> extraLocations;
QString source;
QString output;
quint32 cursor;
diff --git a/src/qdoc/qmlvisitor.cpp b/src/qdoc/qmlvisitor.cpp
index c7be4b1cf..6eb924570 100644
--- a/src/qdoc/qmlvisitor.cpp
+++ b/src/qdoc/qmlvisitor.cpp
@@ -82,7 +82,7 @@ QmlDocVisitor::~QmlDocVisitor()
QQmlJS::AST::SourceLocation QmlDocVisitor::precedingComment(quint32 offset) const
{
const auto comments = engine->comments();
- for (auto it = comments.rbegin(), end = comments.rend(); it != end; ++it) {
+ for (auto it = comments.rbegin(); it != comments.rend(); ++it) {
QQmlJS::AST::SourceLocation loc = *it;
if (loc.begin() <= lastEndOffset) {
@@ -450,10 +450,8 @@ void QmlDocVisitor::applyMetacommands(QQmlJS::AST::SourceLocation,
QSet<QString> metacommands = doc.metaCommandsUsed();
if (metacommands.count() > 0) {
metacommands.subtract(topics_);
- QSet<QString>::iterator i = metacommands.begin();
- while (i != metacommands.end()) {
- QString command = *i;
- ArgList args = doc.metaCommandArgs(command);
+ for (const auto &command : qAsConst(metacommands)) {
+ const ArgList args = doc.metaCommandArgs(command);
if ((command == COMMAND_QMLABSTRACT) || (command == COMMAND_ABSTRACT)) {
if (node->isQmlType() || node->isJsType()) {
node->setAbstract(true);
@@ -480,11 +478,8 @@ void QmlDocVisitor::applyMetacommands(QQmlJS::AST::SourceLocation,
node->markReadOnly(1);
}
else if ((command == COMMAND_INGROUP) && !args.isEmpty()) {
- ArgList::ConstIterator argsIter = args.constBegin();
- while (argsIter != args.constEnd()) {
- QDocDatabase::qdocDB()->addToGroup(argsIter->first, node);
- ++argsIter;
- }
+ for (const auto &argument : args)
+ QDocDatabase::qdocDB()->addToGroup(argument.first, node);
}
else if (command == COMMAND_INTERNAL) {
node->setStatus(Node::Internal);
@@ -508,7 +503,6 @@ void QmlDocVisitor::applyMetacommands(QQmlJS::AST::SourceLocation,
else {
doc.location().warning(tr("The \\%1 command is ignored in QML files").arg(command));
}
- ++i;
}
}
}
diff --git a/src/qdoc/quoter.cpp b/src/qdoc/quoter.cpp
index b54d959e4..7dd13233e 100644
--- a/src/qdoc/quoter.cpp
+++ b/src/qdoc/quoter.cpp
@@ -177,11 +177,8 @@ void Quoter::quoteFromFile(const QString &userFriendlyFilePath,
/*
Squeeze blanks (cat -s).
*/
- QStringList::Iterator m = markedLines.begin();
- while (m != markedLines.end()) {
- replaceMultipleNewlines(*m);
- ++m;
- }
+ for (auto &line : markedLines)
+ replaceMultipleNewlines(line);
codeLocation.start();
}
diff --git a/src/qdoc/sections.cpp b/src/qdoc/sections.cpp
index 44eea84ea..7fd39bc4f 100644
--- a/src/qdoc/sections.cpp
+++ b/src/qdoc/sections.cpp
@@ -348,9 +348,8 @@ Sections::Sections(const NodeMultiMap &nsmap) : aggregate_(nullptr)
if (nsmap.isEmpty())
return;
SectionVector &sections = sinceSections();
- NodeMultiMap::const_iterator n = nsmap.constBegin();
- while (n != nsmap.constEnd()) {
- Node *node = n.value();
+ for (auto it = nsmap.constBegin(); it != nsmap.constEnd(); ++it) {
+ Node *node = it.value();
switch (node->nodeType()) {
case Node::JsType:
case Node::QmlType:
@@ -422,7 +421,6 @@ Sections::Sections(const NodeMultiMap &nsmap) : aggregate_(nullptr)
default:
break;
}
- ++n;
}
}
@@ -682,22 +680,17 @@ void Sections::buildStdRefPageSections()
if (!ns->hasDoc())
documentAll = false; // only document children that have documentation
}
- NodeList::ConstIterator c = aggregate_->constBegin();
- while (c != aggregate_->constEnd()) {
- Node *n = *c;
+ for (auto it = aggregate_->constBegin(); it != aggregate_->constEnd(); ++it) {
+ Node *n = *it;
if (documentAll || n->hasDoc()) {
stdRefPageSwitch(stdSummarySections(), n);
stdRefPageSwitch(stdDetailsSections(), n);
}
- ++c;
}
if (!aggregate_->relatedByProxy().isEmpty()) {
- c = aggregate_->relatedByProxy().constBegin();
- while (c != aggregate_->relatedByProxy().constEnd()) {
- Node *n = *c;
- stdRefPageSwitch(stdSummarySections(), n);
- ++c;
- }
+ const QList<Node *> &relatedBy = aggregate_->relatedByProxy();
+ for (const auto &node : relatedBy)
+ stdRefPageSwitch(stdSummarySections(), node);
}
/*
If we are building the sections for the reference page
@@ -705,12 +698,10 @@ void Sections::buildStdRefPageSections()
included children in the sections.
*/
if (ns && !ns->includedChildren().isEmpty()) {
- NodeList::ConstIterator c = ns->includedChildren().constBegin();
- while (c != ns->includedChildren().constEnd()) {
- Node *n = *c;
- if (documentAll || n->hasDoc())
- stdRefPageSwitch(stdSummarySections(), n);
- ++c;
+ const QList<Node *> &children = ns->includedChildren();
+ for (const auto &child : children) {
+ if (documentAll || child->hasDoc())
+ stdRefPageSwitch(stdSummarySections(), child);
}
}
reduce(stdSummarySections());
@@ -939,7 +930,7 @@ void Sections::distributeQmlNodeInSummaryVector(SectionVector &sv, Node *n, bool
if (scn->isPropertyGroup()) {
sv[QmlProperties].insert(scn);
} else {
- for (auto child : scn->collective())
+ for (const auto &child : scn->collective())
distributeQmlNodeInSummaryVector(sv, child, true);
}
}
@@ -947,11 +938,10 @@ void Sections::distributeQmlNodeInSummaryVector(SectionVector &sv, Node *n, bool
static void pushBaseClasses(QStack<ClassNode *> &stack, ClassNode *cn)
{
- QList<RelatedClass>::ConstIterator r = cn->baseClasses().constBegin();
- while (r != cn->baseClasses().constEnd()) {
- if (r->node_)
- stack.prepend(r->node_);
- ++r;
+ const QVector<RelatedClass> baseClasses = cn->baseClasses();
+ for (const auto &cls : baseClasses) {
+ if (cls.node_)
+ stack.prepend(cls.node_);
}
}
@@ -961,35 +951,29 @@ static void pushBaseClasses(QStack<ClassNode *> &stack, ClassNode *cn)
*/
void Sections::buildStdCppClassRefPageSections()
{
- SectionVector &sv = stdCppClassSummarySections();
- SectionVector &dv = stdCppClassDetailsSections();
+ SectionVector &summarySections = stdCppClassSummarySections();
+ SectionVector &detailsSections = stdCppClassDetailsSections();
Section &allMembers = allMembersSection();
bool documentAll = true;
if (aggregate_->parent() && !aggregate_->name().isEmpty() && !aggregate_->hasDoc())
documentAll = false;
- NodeList::ConstIterator c = aggregate_->constBegin();
- while (c != aggregate_->constEnd()) {
- Node *n = *c;
+ for (auto it = aggregate_->constBegin(); it != aggregate_->constEnd();++it) {
+ Node *n = *it;
if (!n->isPrivate()
&& !n->isProperty()
&& !n->isRelatedNonmember()
&& !n->isSharedCommentNode())
allMembers.insert(n);
- if (!documentAll && !n->hasDoc()) {
- ++c;
+ if (!documentAll && !n->hasDoc())
continue;
- }
- distributeNodeInSummaryVector(sv, n);
- distributeNodeInDetailsVector(dv, n);
- ++c;
+
+ distributeNodeInSummaryVector(summarySections, n);
+ distributeNodeInDetailsVector(detailsSections, n);
}
if (!aggregate_->relatedByProxy().isEmpty()) {
- c = aggregate_->relatedByProxy().constBegin();
- while (c != aggregate_->relatedByProxy().constEnd()) {
- Node *n = *c;
- distributeNodeInSummaryVector(sv, n);
- ++c;
- }
+ const QList<Node *> relatedBy = aggregate_->relatedByProxy();
+ for (const auto &node : relatedBy)
+ distributeNodeInSummaryVector(summarySections, node);
}
QStack<ClassNode *> stack;
@@ -997,25 +981,21 @@ void Sections::buildStdCppClassRefPageSections()
pushBaseClasses(stack, cn);
while (!stack.isEmpty()) {
ClassNode *cn = stack.pop();
- c = cn->constBegin();
- while (c != cn->constEnd()) {
- Node *n = *c;
+ for (auto it = cn->constBegin(); it != cn->constEnd(); ++it) {
+ Node *n = *it;
if (!n->isPrivate()
&& !n->isProperty()
&& !n->isRelatedNonmember()
&& !n->isSharedCommentNode())
allMembers.insert(n);
- if (!documentAll && !n->hasDoc()) {
- ++c;
+ if (!documentAll && !n->hasDoc())
continue;
- }
//distributeNodeInSummaryVector(sv, n); Why was this here? mws 03/07/2019
- ++c;
}
pushBaseClasses(stack, cn);
}
- reduce(sv);
- reduce(dv);
+ reduce(summarySections);
+ reduce(detailsSections);
allMembers.reduce();
}
@@ -1027,27 +1007,24 @@ void Sections::buildStdCppClassRefPageSections()
void Sections::buildStdQmlTypeRefPageSections()
{
ClassMap* classMap = nullptr;
- SectionVector &sv = stdQmlTypeSummarySections();
- SectionVector &dv = stdQmlTypeDetailsSections();
+ SectionVector &summarySections = stdQmlTypeSummarySections();
+ SectionVector &detailsSections = stdQmlTypeDetailsSections();
Section &allMembers = allMembersSection();
const Aggregate *qtn = aggregate_;
while (true) {
if (!qtn->isAbstract() || !classMap)
classMap = allMembers.newClassMap(qtn);
- NodeList::ConstIterator c = qtn->constBegin();
- while (c != qtn->constEnd()) {
- Node *n = *c;
- if (n->isInternal()) {
- ++c;
+ for (auto it = qtn->constBegin(); it !=qtn->constEnd(); ++it) {
+ Node *n = *it;
+ if (n->isInternal())
continue;
- }
+
if (!n->isSharedCommentNode() || n->isPropertyGroup())
allMembers.add(classMap, n);
- distributeQmlNodeInSummaryVector(sv, n);
- distributeQmlNodeInDetailsVector(dv, n);
- ++c;
+ distributeQmlNodeInSummaryVector(summarySections, n);
+ distributeQmlNodeInDetailsVector(detailsSections, n);
}
if (qtn->qmlBaseNode() == qtn) {
qDebug() << "qdoc internal error: circular type definition."
@@ -1066,15 +1043,12 @@ void Sections::buildStdQmlTypeRefPageSections()
while (qtn != nullptr) {
if (!qtn->isAbstract() || !classMap)
classMap = allMembers.newClassMap(qtn);
- NodeList::ConstIterator c = qtn->constBegin();
- while (c != qtn->constEnd()) {
- Node *n = *c;
- if (n->isInternal() || n->isSharedCommentNode()) {
- ++c;
+ for (auto it = qtn->constBegin(); it != qtn->constEnd(); ++it) {
+ Node *n = *it;
+ if (n->isInternal() || n->isSharedCommentNode())
continue;
- }
+
allMembers.add(classMap, n);
- ++c;
}
if (qtn->qmlBaseNode() == qtn) {
qDebug() << "qdoc internal error: circular type definition."
@@ -1085,8 +1059,8 @@ void Sections::buildStdQmlTypeRefPageSections()
}
qtn = static_cast<QmlTypeNode *>(qtn->qmlBaseNode());
}
- reduce(sv);
- reduce(dv);
+ reduce(summarySections);
+ reduce(detailsSections);
allMembers.reduce();
}
@@ -1098,30 +1072,26 @@ void Sections::buildStdQmlTypeRefPageSections()
*/
bool Sections::hasObsoleteMembers(SectionPtrVector *summary_spv, SectionPtrVector *details_spv) const
{
- const SectionVector *sv = nullptr;
+ const SectionVector *sections = nullptr;
if (aggregate_->isClassNode())
- sv = &stdCppClassSummarySections();
+ sections = &stdCppClassSummarySections();
else if (aggregate_->isQmlType() || aggregate_->isQmlBasicType())
- sv = &stdQmlTypeSummarySections();
+ sections = &stdQmlTypeSummarySections();
else
- sv = &stdSummarySections();
- SectionVector::ConstIterator s = sv->constBegin();
- while (s != sv->constEnd()) {
- if (!s->obsoleteMembers().isEmpty())
- summary_spv->append(&(*s));
- ++s;
+ sections = &stdSummarySections();
+ for (const auto &section : *sections) {
+ if (!section.obsoleteMembers().isEmpty())
+ summary_spv->append(&section);
}
if (aggregate_->isClassNode())
- sv = &stdCppClassDetailsSections();
+ sections = &stdCppClassDetailsSections();
else if (aggregate_->isQmlType() || aggregate_->isQmlBasicType())
- sv = &stdQmlTypeDetailsSections();
+ sections = &stdQmlTypeDetailsSections();
else
- sv = &stdDetailsSections();
- s = sv->constBegin();
- while (s != sv->constEnd()) {
- if (!s->obsoleteMembers().isEmpty())
- details_spv->append(&(*s));
- ++s;
+ sections = &stdDetailsSections();
+ for (const auto &it : *sections) {
+ if (!it.obsoleteMembers().isEmpty())
+ details_spv->append(&it);
}
return !summary_spv->isEmpty();
}
diff --git a/src/qdoc/sections.h b/src/qdoc/sections.h
index d9aeeb28f..9c1514c2d 100644
--- a/src/qdoc/sections.h
+++ b/src/qdoc/sections.h
@@ -37,11 +37,11 @@ QT_BEGIN_NAMESPACE
typedef QMultiMap<QString, Node *> MemberMap; // the string is the member signature
typedef QPair<const QmlTypeNode *, MemberMap> ClassMap; // the node is the QML type
-typedef QList<ClassMap *> ClassMapList;
+typedef QVector<ClassMap *> ClassMapList;
typedef QPair<QStringList, NodeVector> KeysAndNodes;
typedef QPair<const QmlTypeNode *, KeysAndNodes> ClassKeysNodes;
-typedef QList<ClassKeysNodes *> ClassKeysNodesList;
+typedef QVector<ClassKeysNodes *> ClassKeysNodesList;
class Section
{
@@ -101,7 +101,7 @@ public:
const QStringList &keys(Status t) const { return (t == Obsolete ? obsoleteKeys_ : keys_); }
const NodeVector &members() const { return members_; }
const NodeVector &reimplementedMembers() const { return reimplementedMembers_; }
- const QList<QPair<Aggregate*, int> > &inheritedMembers() const { return inheritedMembers_; }
+ const QVector<QPair<Aggregate*, int> > &inheritedMembers() const { return inheritedMembers_; }
ClassKeysNodesList &classKeysNodesList() { return classKeysNodesList_; }
const NodeVector &obsoleteMembers() const { return obsoleteMembers_; }
void appendMembers(const NodeVector &nv) { members_.append(nv); }
@@ -125,7 +125,7 @@ private:
NodeVector members_;
NodeVector obsoleteMembers_;
NodeVector reimplementedMembers_;
- QList<QPair<Aggregate *, int> > inheritedMembers_;
+ QVector<QPair<Aggregate *, int> > inheritedMembers_;
ClassKeysNodesList classKeysNodesList_;
QMultiMap<QString, Node *> memberMap_;
diff --git a/src/qdoc/tokenizer.cpp b/src/qdoc/tokenizer.cpp
index 45c33fa7c..af3837c3a 100644
--- a/src/qdoc/tokenizer.cpp
+++ b/src/qdoc/tokenizer.cpp
@@ -735,7 +735,7 @@ bool Tokenizer::isTrue(const QString &condition)
X && Y || Z // the or
(X || Y) && Z // the and
*/
- for (int i = 0; i < (int) condition.length() - 1; i++) {
+ for (int i = 0; i < condition.length() - 1; i++) {
QChar ch = condition[i];
if (ch == QChar('(')) {
parenDepth++;
diff --git a/src/qdoc/tree.cpp b/src/qdoc/tree.cpp
index 1ae07c52b..6ff473bdc 100644
--- a/src/qdoc/tree.cpp
+++ b/src/qdoc/tree.cpp
@@ -100,23 +100,19 @@ Tree::Tree(const QString &camelCaseModuleName, QDocDatabase *qdb)
*/
Tree::~Tree()
{
- TargetMap::iterator i = nodesByTargetRef_.begin();
- while (i != nodesByTargetRef_.end()) {
+ for (auto i = nodesByTargetRef_.begin(); i != nodesByTargetRef_.end(); ++i) {
delete i.value();
- ++i;
}
nodesByTargetRef_.clear();
nodesByTargetTitle_.clear();
if (Generator::writeQaPages() && targetListMap_) {
- TargetListMap::iterator i = targetListMap_->begin();
- while (i != targetListMap_->end()) {
- TargetList *tlist = i.value();
+ for (auto target = targetListMap_->begin(); target != targetListMap_->end(); ++target) {
+ TargetList *tlist = target.value();
if (tlist) {
for (auto *location : qAsConst(*tlist))
delete location;
}
delete tlist;
- ++i;
}
}
}
@@ -238,15 +234,13 @@ void Tree::addPropertyFunction(PropertyNode *property,
*/
void Tree::resolveBaseClasses(Aggregate *n)
{
- 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_);
+ for (auto it = n->constBegin(); it != n->constEnd(); ++it) {
+ if ((*it)->isClassNode()) {
+ ClassNode *cn = static_cast<ClassNode *>(*it);
+ QVector<RelatedClass> &bases = cn->baseClasses();
+ for (auto &base : bases) {
+ if (base.node_ == nullptr) {
+ Node *n = qdb_->findClassNode(base.path_);
/*
If the node for the base class was not found,
the reason might be that the subclass is in a
@@ -262,21 +256,19 @@ void Tree::resolveBaseClasses(Aggregate *n)
if (parent != nullptr)
// Exclude the root namespace
if (parent->isNamespace() && !parent->name().isEmpty())
- n = findClassNode((*b).path_, parent);
+ n = findClassNode(base.path_, parent);
}
if (n != nullptr) {
ClassNode *bcn = static_cast<ClassNode *>(n);
- (*b).node_ = bcn;
- bcn->addDerivedClass((*b).access_, cn);
+ base.node_ = bcn;
+ bcn->addDerivedClass(base.access_, cn);
}
}
- ++b;
}
resolveBaseClasses(cn);
- } else if ((*c)->isNamespace()) {
- resolveBaseClasses(static_cast<NamespaceNode *>(*c));
+ } else if ((*it)->isNamespace()) {
+ resolveBaseClasses(static_cast<NamespaceNode *>(*it));
}
- ++c;
}
}
@@ -284,21 +276,17 @@ void Tree::resolveBaseClasses(Aggregate *n)
*/
void Tree::resolvePropertyOverriddenFromPtrs(Aggregate *n)
{
- 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;
+ for (auto node = n->constBegin(); node != n->constEnd(); ++node) {
+ if ((*node)->isClassNode()) {
+ ClassNode *cn = static_cast<ClassNode *>(*node);
+ for (auto property = cn->constBegin(); property != cn->constEnd(); ++property) {
+ if ((*property)->isProperty())
+ cn->resolvePropertyOverriddenFromPtrs(static_cast<PropertyNode *>(*property));
}
resolvePropertyOverriddenFromPtrs(cn);
- } else if ((*c)->isNamespace()) {
- resolvePropertyOverriddenFromPtrs(static_cast<NamespaceNode *>(*c));
+ } else if ((*node)->isNamespace()) {
+ resolvePropertyOverriddenFromPtrs(static_cast<NamespaceNode *>(*node));
}
- ++c;
}
}
@@ -306,10 +294,8 @@ void Tree::resolvePropertyOverriddenFromPtrs(Aggregate *n)
*/
void Tree::resolveProperties()
{
- PropertyMap::ConstIterator propEntry;
-
- propEntry = unresolvedPropertyMap.constBegin();
- while (propEntry != unresolvedPropertyMap.constEnd()) {
+ for (auto propEntry = unresolvedPropertyMap.constBegin();
+ propEntry != unresolvedPropertyMap.constEnd(); ++propEntry) {
PropertyNode *property = propEntry.key();
Aggregate *parent = property->parent();
QString getterName = (*propEntry)[PropertyNode::Getter];
@@ -317,10 +303,9 @@ void Tree::resolveProperties()
QString resetterName = (*propEntry)[PropertyNode::Resetter];
QString notifierName = (*propEntry)[PropertyNode::Notifier];
- NodeList::ConstIterator c = parent->constBegin();
- while (c != parent->constEnd()) {
- if ((*c)->isFunction()) {
- FunctionNode *function = static_cast<FunctionNode *>(*c);
+ for (auto it = parent->constBegin(); it != parent->constEnd(); ++it) {
+ if ((*it)->isFunction()) {
+ FunctionNode *function = static_cast<FunctionNode *>(*it);
if (function->access() == property->access() &&
(function->status() == property->status() ||
function->doc().isEmpty())) {
@@ -338,18 +323,15 @@ void Tree::resolveProperties()
}
}
}
- ++c;
}
- ++propEntry;
}
- propEntry = unresolvedPropertyMap.constBegin();
- while (propEntry != unresolvedPropertyMap.constEnd()) {
+ for (auto propEntry = unresolvedPropertyMap.constBegin();
+ propEntry != unresolvedPropertyMap.constEnd(); ++propEntry) {
PropertyNode *property = propEntry.key();
// redo it to set the property functions
if (property->overriddenFrom())
property->setOverriddenFrom(property->overriddenFrom());
- ++propEntry;
}
unresolvedPropertyMap.clear();
@@ -384,15 +366,13 @@ void Tree::resolveUsingClauses()
for (auto *child : children) {
if (child->isClassNode()) {
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);
+ QVector<UsingClause> &usingClauses = cn->usingClauses();
+ for (auto &usingClause : usingClauses) {
+ if (usingClause.node() == nullptr) {
+ const Node *n = qdb_->findFunctionNode(usingClause.signature(), cn, Node::CPP);
if (n != nullptr)
- (*uc).setNode(n);
+ usingClause.setNode(n);
}
- ++uc;
}
}
}
@@ -412,13 +392,11 @@ void Tree::removePrivateAndInternalBases(NamespaceNode *rootNode)
if (rootNode == nullptr)
rootNode = root();
- NodeList::ConstIterator c = rootNode->constBegin();
- while (c != rootNode->constEnd()) {
- if ((*c)->isClassNode())
- static_cast<ClassNode *>(*c)->removePrivateAndInternalBases();
- else if ((*c)->isNamespace())
- removePrivateAndInternalBases(static_cast<NamespaceNode *>(*c));
- ++c;
+ for (auto node = rootNode->constBegin(); node != rootNode->constEnd(); ++node) {
+ if ((*node)->isClassNode())
+ static_cast<ClassNode *>(*node)->removePrivateAndInternalBases();
+ else if ((*node)->isNamespace())
+ removePrivateAndInternalBases(static_cast<NamespaceNode *>(*node));
}
}
@@ -748,22 +726,22 @@ const Node *Tree::findNode(const QStringList &path,
*/
QString Tree::getRef(const QString &target, const Node *node) const
{
- TargetMap::const_iterator i = nodesByTargetTitle_.constFind(target);
- if (i != nodesByTargetTitle_.constEnd()) {
+ auto it = nodesByTargetTitle_.constFind(target);
+ if (it != nodesByTargetTitle_.constEnd()) {
do {
- if (i.value()->node_ == node)
- return i.value()->ref_;
- ++i;
- } while (i != nodesByTargetTitle_.constEnd() && i.key() == target);
+ if (it.value()->node_ == node)
+ return it.value()->ref_;
+ ++it;
+ } while (it != nodesByTargetTitle_.constEnd() && it.key() == target);
}
QString key = Doc::canonicalTitle(target);
- i = nodesByTargetRef_.constFind(key);
- if (i != nodesByTargetRef_.constEnd()) {
+ it = nodesByTargetRef_.constFind(key);
+ if (it != nodesByTargetRef_.constEnd()) {
do {
- if (i.value()->node_ == node)
- return i.value()->ref_;
- ++i;
- } while (i != nodesByTargetRef_.constEnd() && i.key() == key);
+ if (it.value()->node_ == node)
+ return it.value()->ref_;
+ ++it;
+ } while (it != nodesByTargetRef_.constEnd() && it.key() == key);
}
return QString();
}
@@ -799,9 +777,9 @@ void Tree::resolveTargets(Aggregate *root)
QList<PageNode *> nodes = pageNodesByTitle_.values(key);
bool alreadyThere = false;
if (!nodes.empty()) {
- for (int i=0; i< nodes.size(); ++i) {
- if (nodes[i]->isExternalPage()) {
- if (node->name() == nodes[i]->name()) {
+ for (const auto &node_ : nodes) {
+ if (node_->isExternalPage()) {
+ if (node->name() == node_->name()) {
alreadyThere = true;
break;
}
@@ -814,7 +792,7 @@ void Tree::resolveTargets(Aggregate *root)
}
if (child->doc().hasTableOfContents()) {
- const QList<Atom *> &toc = child->doc().tableOfContents();
+ const QVector<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();
@@ -827,7 +805,7 @@ void Tree::resolveTargets(Aggregate *root)
}
}
if (child->doc().hasKeywords()) {
- const QList<Atom *> &keywords = child->doc().keywords();
+ const QVector<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();
@@ -839,7 +817,7 @@ void Tree::resolveTargets(Aggregate *root)
}
}
if (child->doc().hasTargets()) {
- const QList<Atom *> &targets = child->doc().targets();
+ const QVector<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();
@@ -865,14 +843,13 @@ Tree::findUnambiguousTarget(const QString &target, Node::Genus genus, QString &r
{
int numBestTargets = 0;
TargetRec *bestTarget = nullptr;
- QList<TargetRec *> bestTargetList;
+ QVector<TargetRec *> bestTargetList;
QString key = target;
- TargetMap::const_iterator i = nodesByTargetTitle_.find(key);
- while (i != nodesByTargetTitle_.constEnd()) {
- if (i.key() != key)
+ for (auto it = nodesByTargetTitle_.find(key); it != nodesByTargetTitle_.constEnd(); ++it) {
+ if (it.key() != key)
break;
- TargetRec *candidate = i.value();
+ TargetRec *candidate = it.value();
if ((genus == Node::DontCare) || (genus == candidate->genus())) {
if (!bestTarget || (candidate->priority_ < bestTarget->priority_)) {
bestTarget = candidate;
@@ -885,7 +862,6 @@ Tree::findUnambiguousTarget(const QString &target, Node::Genus genus, QString &r
++numBestTargets;
}
}
- ++i;
}
if (bestTarget) {
ref = bestTarget->ref_;
@@ -895,11 +871,10 @@ Tree::findUnambiguousTarget(const QString &target, Node::Genus genus, QString &r
numBestTargets = 0;
bestTarget = nullptr;
key = Doc::canonicalTitle(target);
- i = nodesByTargetRef_.find(key);
- while (i != nodesByTargetRef_.constEnd()) {
- if (i.key() != key)
+ for (auto it = nodesByTargetRef_.find(key); it != nodesByTargetRef_.constEnd(); ++it) {
+ if (it.key() != key)
break;
- TargetRec *candidate = i.value();
+ TargetRec *candidate = it.value();
if ((genus == Node::DontCare) || (genus == candidate->genus())) {
if (!bestTarget || (candidate->priority_ < bestTarget->priority_)) {
bestTarget = candidate;
@@ -912,7 +887,6 @@ Tree::findUnambiguousTarget(const QString &target, Node::Genus genus, QString &r
++numBestTargets;
}
}
- ++i;
}
if (bestTarget) {
ref = bestTarget->ref_;
@@ -928,32 +902,32 @@ Tree::findUnambiguousTarget(const QString &target, Node::Genus genus, QString &r
*/
const PageNode *Tree::findPageNodeByTitle(const QString &title) const
{
- PageNodeMultiMap::const_iterator i;
+ PageNodeMultiMap::const_iterator it;
if (title.contains(QChar(' ')))
- i = pageNodesByTitle_.constFind(Doc::canonicalTitle(title));
+ it = pageNodesByTitle_.constFind(Doc::canonicalTitle(title));
else
- i = pageNodesByTitle_.constFind(title);
- if (i != pageNodesByTitle_.constEnd()) {
+ it = pageNodesByTitle_.constFind(title);
+ if (it != pageNodesByTitle_.constEnd()) {
/*
Reporting all these duplicate section titles is probably
overkill. We should report the duplicate file and let
that suffice.
*/
- PageNodeMultiMap::const_iterator j = i;
+ PageNodeMultiMap::const_iterator j = it;
++j;
- if (j != pageNodesByTitle_.constEnd() && j.key() == i.key()) {
+ if (j != pageNodesByTitle_.constEnd() && j.key() == it.key()) {
while (j != pageNodesByTitle_.constEnd()) {
- if (j.key() == i.key() && j.value()->url().isEmpty()) {
+ if (j.key() == it.key() && j.value()->url().isEmpty()) {
break; // Just report one duplicate for now.
}
++j;
}
if (j != pageNodesByTitle_.cend()) {
- i.value()->location().warning("This page title exists in more than one file: " + title);
+ it.value()->location().warning("This page title exists in more than one file: " + title);
j.value()->location().warning("[It also exists here]");
}
}
- return i.value();
+ return it.value();
}
return nullptr;
}
@@ -1020,11 +994,11 @@ CNMap *Tree::getCollectionMap(Node::NodeType type)
*/
CollectionNode *Tree::getCollection(const QString &name, Node::NodeType type)
{
- CNMap *m = getCollectionMap(type);
- if (m) {
- CNMap::const_iterator i = m->constFind(name);
- if (i != m->cend())
- return i.value();
+ CNMap *map = getCollectionMap(type);
+ if (map) {
+ auto it = map->constFind(name);
+ if (it != map->cend())
+ return it.value();
}
return nullptr;
}
@@ -1049,9 +1023,9 @@ CollectionNode *Tree::findCollection(const QString &name, Node::NodeType type)
CNMap *m = getCollectionMap(type);
if (!m) // error
return nullptr;
- CNMap::const_iterator i = m->constFind(name);
- if (i != m->cend())
- return i.value();
+ auto it = m->constFind(name);
+ if (it != m->cend())
+ return it.value();
CollectionNode *cn = new CollectionNode(type, root(), name);
cn->markNotSeen();
m->insert(name, cn);
@@ -1352,13 +1326,13 @@ QString Tree::getNewLinkTarget(const Node *locNode,
QString target = QString("qa-target-%1").arg(-(linkCount()));
TargetLoc *tloc = new TargetLoc(locNode, target, fileName, text, broken);
TargetList *tList = nullptr;
- TargetListMap::iterator i = targetListMap_->find(physicalModuleName);
- if (i == targetListMap_->end()) {
+ auto it = targetListMap_->find(physicalModuleName);
+ if (it == targetListMap_->end()) {
tList = new TargetList;
- i = targetListMap_->insert(physicalModuleName, tList);
+ it = targetListMap_->insert(physicalModuleName, tList);
}
else
- tList = i.value();
+ tList = it.value();
tList->append(tloc);
return target;
}
@@ -1452,12 +1426,10 @@ void Tree::addToDontDocumentMap(QString &arg)
*/
void Tree::markDontDocumentNodes()
{
- NodeMap::iterator i = dontDocumentMap_.begin();
- while (i != dontDocumentMap_.end()) {
- Aggregate *node = findAggregate(i.key());
+ for (auto it = dontDocumentMap_.begin(); it != dontDocumentMap_.end(); ++it) {
+ Aggregate *node = findAggregate(it.key());
if (node != nullptr)
node->setStatus(Node::DontDocument);
- ++i;
}
}
diff --git a/src/qdoc/webxmlgenerator.cpp b/src/qdoc/webxmlgenerator.cpp
index be19eb435..330f3d474 100644
--- a/src/qdoc/webxmlgenerator.cpp
+++ b/src/qdoc/webxmlgenerator.cpp
@@ -222,7 +222,7 @@ void WebXMLGenerator::append(QXmlStreamWriter &writer, Node *node)
while (atom)
atom = addAtomElements(writer, atom, node, marker_);
- QList<Text> alsoList = node->doc().alsoList();
+ QVector<Text> alsoList = node->doc().alsoList();
supplementAlsoList(node, alsoList);
if (!alsoList.isEmpty()) {
@@ -289,6 +289,9 @@ const Atom *WebXMLGenerator::addAtomElements(QXmlStreamWriter &writer,
{
bool keepQuoting = false;
+ if (!atom)
+ return nullptr;
+
switch (atom->type()) {
case Atom::AnnotatedList:
{
@@ -750,11 +753,8 @@ const Atom *WebXMLGenerator::addAtomElements(QXmlStreamWriter &writer,
}
hasQuotingInformation = keepQuoting;
+ return atom->next();
- if (atom)
- return atom->next();
-
- return nullptr;
}
void WebXMLGenerator::startLink(QXmlStreamWriter &writer, const Atom *atom,
@@ -811,47 +811,13 @@ void WebXMLGenerator::endLink(QXmlStreamWriter &writer) {
}
}
-QString WebXMLGenerator::targetType(const Node *node)
-{
- if (!node)
- return "external";
-
- switch (node->nodeType()) {
- case Node::Namespace:
- return "namespace";
- case Node::Class:
- case Node::Struct:
- case Node::Union:
- return "class";
- case Node::Page:
- case Node::Example:
- return "page";
- case Node::Enum:
- return "enum";
- case Node::Typedef:
- return "typedef";
- case Node::Property:
- return "property";
- case Node::Function:
- return "function";
- case Node::Variable:
- return "variable";
- case Node::Module:
- return "module";
- default:
- break;
- }
- return QString();
-}
-
void WebXMLGenerator::generateRelations(QXmlStreamWriter &writer, const Node *node)
{
if (node && !node->links().empty()) {
QPair<QString, QString> anchorPair;
const Node *linkNode;
- for (QMap<Node::LinkType, QPair<QString, QString> >::const_iterator it =
- node->links().cbegin(), end = node->links().cend(); it != end; ++it) {
+ for (auto it = node->links().cbegin(); it != node->links().cend(); ++it) {
linkNode = qdb_->findNodeForTarget(it.value().first, node);
@@ -921,15 +887,4 @@ void WebXMLGenerator::generateAnnotatedList(QXmlStreamWriter &writer,
writer.writeEndElement(); // table
}
-const QPair<QString,QString> WebXMLGenerator::anchorForNode(const Node *node)
-{
- QPair<QString,QString> anchorPair;
-
- anchorPair.first = fullDocumentLocation(node);
- if (node->isTextPageNode())
- anchorPair.second = node->title();
-
- return anchorPair;
-}
-
QT_END_NAMESPACE
diff --git a/src/qdoc/webxmlgenerator.h b/src/qdoc/webxmlgenerator.h
index 320d8169e..565be82c9 100644
--- a/src/qdoc/webxmlgenerator.h
+++ b/src/qdoc/webxmlgenerator.h
@@ -64,14 +64,12 @@ protected:
private:
- const QPair<QString,QString> anchorForNode(const Node *node);
void generateAnnotatedList(QXmlStreamWriter &writer, const Node *relative, const NodeMap &nodeMap);
void generateAnnotatedList(QXmlStreamWriter &writer, const Node *relative, const NodeList &nodeList);
void generateRelations(QXmlStreamWriter &writer, const Node *node);
void startLink(QXmlStreamWriter &writer, const Atom *atom, const Node *node,
const QString &link);
void endLink(QXmlStreamWriter &writer);
- QString targetType(const Node *node);
bool inLink;
bool inContents;
diff --git a/src/qdoc/xmlgenerator.cpp b/src/qdoc/xmlgenerator.cpp
new file mode 100644
index 000000000..05cd1b963
--- /dev/null
+++ b/src/qdoc/xmlgenerator.cpp
@@ -0,0 +1,478 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 Thibaut Cuvelier
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*
+ xmlgenerator.cpp
+*/
+
+#include "xmlgenerator.h"
+#include "qdocdatabase.h"
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ Do not display \brief for QML/JS types, document and collection nodes
+ */
+bool XmlGenerator::hasBrief(const Node *node)
+{
+ return !(node->isQmlType()
+ || node->isPageNode()
+ || node->isCollectionNode()
+ || node->isJsType());
+}
+
+/*!
+ Determines whether the list atom should be shown with three columns
+ (constant-value-description).
+ */
+bool XmlGenerator::isThreeColumnEnumValueTable(const Atom *atom)
+{
+ while (atom && !(atom->type() == Atom::ListRight && atom->string() == ATOM_LIST_VALUE)) {
+ if (atom->type() == Atom::ListItemLeft && !matchAhead(atom, Atom::ListItemRight))
+ return true;
+ atom = atom->next();
+ }
+ return false;
+}
+
+/*!
+ Header offset depending on the type of the node
+ */
+int XmlGenerator::hOffset(const Node *node)
+{
+ switch (node->nodeType()) {
+ case Node::Namespace:
+ case Node::Class:
+ case Node::Struct:
+ case Node::Union:
+ case Node::Module:
+ return 2;
+ case Node::QmlModule:
+ case Node::QmlBasicType:
+ case Node::QmlType:
+ case Node::Page:
+ return 1;
+ case Node::Enum:
+ case Node::Typedef:
+ case Node::Function:
+ case Node::Property:
+ default:
+ return 3;
+ }
+}
+
+/*!
+ Rewrites the brief of this node depending on its first word.
+ Only for properties and variables (does nothing otherwise).
+ */
+void XmlGenerator::rewritePropertyBrief(const Atom *atom, const Node *relative)
+{
+ if (relative->nodeType() == Node::Property ||
+ relative->nodeType() == Node::Variable) {
+ atom = atom->next();
+ if (atom && atom->type() == Atom::String) {
+ QString firstWord =
+ atom->string().toLower().section(' ', 0, 0, QString::SectionSkipEmpty);
+ if (firstWord == QLatin1String("the")
+ || firstWord == QLatin1String("a")
+ || firstWord == QLatin1String("an")
+ || firstWord == QLatin1String("whether")
+ || firstWord == QLatin1String("which")) {
+ QString str = QLatin1String("This ")
+ + QLatin1String(relative->nodeType() == Node::Property ?
+ "property" : "variable")
+ + QLatin1String(" holds ")
+ + atom->string().left(1).toLower()
+ + atom->string().mid(1);
+ const_cast<Atom *>(atom)->setString(str);
+ }
+ }
+ }
+}
+
+/*!
+ Returns the type of this atom as an enumeration.
+ */
+Node::NodeType XmlGenerator::typeFromString(const Atom *atom)
+{
+ const auto &name = atom->string();
+ if (name.startsWith(QLatin1String("qml")))
+ return Node::QmlModule;
+ else if (name.startsWith(QLatin1String("js")))
+ return Node::JsModule;
+ else if (name.startsWith(QLatin1String("groups")))
+ return Node::Group;
+ else
+ return Node::Module;
+}
+
+/*!
+ For images shown in examples, set the image file to the one it
+ will have once the documentation is generated.
+ */
+void XmlGenerator::setImageFileName(const Node *relative, const QString &fileName)
+{
+ if (relative->isExample()) {
+ const auto cen = static_cast<const ExampleNode *>(relative);
+ if (cen->imageFileName().isEmpty()) {
+ auto *en = const_cast<ExampleNode*>(cen);
+ en->setImageFileName(fileName);
+ }
+ }
+}
+
+/*!
+ Handles the differences in lists between list tags and since tags, and
+ returns the content of the list entry \a atom (first member of the pair).
+ It also returns the number of items to skip ahead (second member of the pair).
+ */
+QPair<QString, int> XmlGenerator::getAtomListValue(const Atom *atom)
+{
+ const Atom *lookAhead = atom->next();
+ if (!lookAhead)
+ return QPair<QString, int>(QString(), 1);
+
+ QString t = lookAhead->string();
+ lookAhead = lookAhead->next();
+ if (!lookAhead || lookAhead->type() != Atom::ListTagRight)
+ return QPair<QString, int>(QString(), 1);
+
+ lookAhead = lookAhead->next();
+ int skipAhead;
+ if (lookAhead && lookAhead->type() == Atom::SinceTagLeft) {
+ lookAhead = lookAhead->next();
+ Q_ASSERT(lookAhead && lookAhead->type() == Atom::String);
+ t += QLatin1String(" (since ");
+ if (lookAhead->string().at(0).isDigit())
+ t += QLatin1String("Qt ");
+ t += lookAhead->string() + QLatin1String(")");
+ skipAhead = 4;
+ } else {
+ skipAhead = 1;
+ }
+ return QPair<QString, int>(t, skipAhead);
+}
+
+/*!
+ Parses the table attributes from the given \a atom.
+ This method returns a pair containing the width (%) and
+ the attribute for this table (either "generic" or
+ "borderless").
+ */
+QPair<QString, QString> XmlGenerator::getTableWidthAttr(const Atom *atom)
+{
+ QString p0, p1;
+ QString attr = "generic";
+ QString width;
+ if (atom->count() > 0) {
+ p0 = atom->string(0);
+ if (atom->count() > 1)
+ p1 = atom->string(1);
+ }
+ if (!p0.isEmpty()) {
+ if (p0 == QLatin1String("borderless"))
+ attr = p0;
+ else if (p0.contains(QLatin1Char('%')))
+ width = p0;
+ }
+ if (!p1.isEmpty()) {
+ if (p1 == QLatin1String("borderless"))
+ attr = p1;
+ else if (p1.contains(QLatin1Char('%')))
+ width = p1;
+ }
+ return QPair<QString, QString>(width, attr);
+}
+
+/*!
+ Registers an anchor reference and returns a unique
+ and cleaned copy of the reference (the one that should be
+ used in the output).
+ To ensure unicity throughout the document, this method
+ uses the \a refMap cache.
+ */
+QString XmlGenerator::registerRef(const QString &ref)
+{
+ QString clean = Generator::cleanRef(ref);
+
+ for (;;) {
+ QString &prevRef = refMap[clean.toLower()];
+ if (prevRef.isEmpty()) {
+ prevRef = ref;
+ break;
+ } else if (prevRef == ref) {
+ break;
+ }
+ clean += QLatin1Char('x');
+ }
+ return clean;
+}
+
+/*!
+ Generates a clean and unique reference for the given \a node.
+ This reference may depend on the type of the node (typedef,
+ QML signal, etc.)
+ */
+QString XmlGenerator::refForNode(const Node *node)
+{
+ QString ref;
+ switch (node->nodeType()) {
+ case Node::Enum:
+ ref = node->name() + "-enum";
+ break;
+ case Node::Typedef: {
+ const auto tdn = static_cast<const TypedefNode *>(node);
+ if (tdn->associatedEnum())
+ return refForNode(tdn->associatedEnum());
+ ref = node->name() + "-typedef";
+ }
+ break;
+ case Node::Function: {
+ const auto fn = static_cast<const FunctionNode *>(node);
+ switch (fn->metaness()) {
+ case FunctionNode::JsSignal:
+ case FunctionNode::QmlSignal:
+ ref = fn->name() + "-signal";
+ break;
+ case FunctionNode::JsSignalHandler:
+ case FunctionNode::QmlSignalHandler:
+ ref = fn->name() + "-signal-handler";
+ break;
+ case FunctionNode::JsMethod:
+ case FunctionNode::QmlMethod:
+ ref = fn->name() + "-method";
+ if (fn->overloadNumber() != 0)
+ ref += QLatin1Char('-') + QString::number(fn->overloadNumber());
+ break;
+ default:
+ if (fn->hasOneAssociatedProperty() && fn->doc().isEmpty()) {
+ return refForNode(fn->firstAssociatedProperty());
+ } else {
+ ref = fn->name();
+ if (fn->overloadNumber() != 0)
+ ref += QLatin1Char('-') + QString::number(fn->overloadNumber());
+ }
+ break;
+ }
+ }
+ break;
+ case Node::JsProperty:
+ case Node::QmlProperty:
+ if (node->isAttached())
+ ref = node->name() + "-attached-prop";
+ else
+ ref = node->name() + "-prop";
+ break;
+ case Node::Property:
+ ref = node->name() + "-prop";
+ break;
+ case Node::Variable:
+ ref = node->name() + "-var";
+ break;
+ case Node::SharedComment:
+ if (node->isPropertyGroup())
+ ref = node->name() + "-prop";
+ break;
+ default:
+ break;
+ }
+ return registerRef(ref);
+}
+
+/*!
+ Construct the link string for the \a node and return it.
+ The \a relative node is used to decide whether the link
+ we are generating is in the same file as the target.
+ Note the relative node can be 0, which pretty much
+ guarantees that the link and the target aren't in the
+ same file.
+ */
+QString XmlGenerator::linkForNode(const Node *node, const Node *relative)
+{
+ if (node == nullptr)
+ return QString();
+ if (!node->url().isEmpty())
+ return node->url();
+ if (fileBase(node).isEmpty())
+ return QString();
+ if (node->isPrivate())
+ return QString();
+
+ QString fn = fileName(node);
+ if (node && node->parent()
+ && (node->parent()->isQmlType() || node->parent()->isJsType())
+ && node->parent()->isAbstract()) {
+ if (Generator::qmlTypeContext()) {
+ if (Generator::qmlTypeContext()->inherits(node->parent())) {
+ fn = fileName(Generator::qmlTypeContext());
+ } else if (node->parent()->isInternal()) {
+ node->doc().location().warning(
+ tr("Cannot link to property in internal type '%1'").arg(node->parent()->name()));
+ return QString();
+ }
+ }
+ }
+
+ QString link = fn;
+
+ if (!node->isPageNode() || node->isPropertyGroup()) {
+ QString ref = refForNode(node);
+ if (relative && fn == fileName(relative) && ref == refForNode(relative))
+ return QString();
+
+ link += QLatin1Char('#');
+ link += ref;
+ }
+
+ /*
+ If the output is going to subdirectories, then if the
+ two nodes will be output to different directories, then
+ the link must go up to the parent directory and then
+ back down into the other subdirectory.
+ */
+ if (node && relative && (node != relative)) {
+ if (useOutputSubdirs() && !node->isExternalPage() &&
+ node->outputSubdirectory() != relative->outputSubdirectory()) {
+ if (link.startsWith(QString(node->outputSubdirectory() + QLatin1Char('/')))) {
+ link.prepend(QString("../"));
+ } else {
+ link.prepend(QString("../" + node->outputSubdirectory() + QLatin1Char('/')));
+ }
+ }
+ }
+ return link;
+}
+
+/*!
+ This function is called for links, i.e. for words that
+ are marked with the qdoc link command. For autolinks
+ that are not marked with the qdoc link command, the
+ getAutoLink() function is called
+
+ It returns the string for a link found by using the data
+ in the \a atom to search the database. It also sets \a node
+ to point to the target node for that link. \a relative points
+ to the node holding the qdoc comment where the link command
+ was found.
+ */
+QString XmlGenerator::getLink(const Atom *atom, const Node *relative, const Node **node)
+{
+ const QString &t = atom->string();
+ if (t.at(0) == QChar('h')) {
+ if (t.startsWith("http:") || t.startsWith("https:"))
+ return t;
+ } else if (t.at(0) == QChar('f')) {
+ if (t.startsWith("file:") || t.startsWith("ftp:"))
+ return t;
+ } else if (t.at(0) == QChar('m')) {
+ if (t.startsWith("mailto:"))
+ return t;
+ }
+ return getAutoLink(atom, relative, node);
+}
+
+/*!
+ This function is called for autolinks, i.e. for words that
+ are not marked with the qdoc link command that qdoc has
+ reason to believe should be links. For links marked with
+ the qdoc link command, the getLink() function is called.
+
+ It returns the string for a link found by using the data
+ in the \a atom to search the database. It also sets \a node
+ to point to the target node for that link. \a relative points
+ to the node holding the qdoc comment where the link command
+ was found.
+ */
+QString XmlGenerator::getAutoLink(const Atom *atom, const Node *relative, const Node **node)
+{
+ QString ref;
+
+ *node = qdb_->findNodeForAtom(atom, relative, ref);
+ if (!(*node))
+ return QString();
+
+ QString link = (*node)->url();
+ if (link.isEmpty())
+ link = linkForNode(*node, relative);
+ if (!ref.isEmpty()) {
+ int hashtag = link.lastIndexOf(QChar('#'));
+ if (hashtag != -1)
+ link.truncate(hashtag);
+ link += QLatin1Char('#') + ref;
+ }
+ return link;
+}
+
+const QPair<QString, QString> XmlGenerator::anchorForNode(const Node *node)
+{
+ QPair<QString, QString> anchorPair;
+
+ anchorPair.first = Generator::fileName(node);
+ if (node->isTextPageNode())
+ anchorPair.second = node->title();
+
+ return anchorPair;
+}
+
+/*!
+ Returns a string describing the \a node type.
+ */
+QString XmlGenerator::targetType(const Node *node)
+{
+ if (!node)
+ return QStringLiteral("external");
+
+ switch (node->nodeType()) {
+ case Node::Namespace:
+ return QStringLiteral("namespace");
+ case Node::Class:
+ case Node::Struct:
+ case Node::Union:
+ return QStringLiteral("class");
+ case Node::Page:
+ case Node::Example:
+ return QStringLiteral("page");
+ case Node::Enum:
+ return QStringLiteral("enum");
+ case Node::Typedef:
+ return QStringLiteral("typedef");
+ case Node::Property:
+ return QStringLiteral("property");
+ case Node::Function:
+ return QStringLiteral("function");
+ case Node::Variable:
+ return QStringLiteral("variable");
+ case Node::Module:
+ return QStringLiteral("module");
+ default:
+ break;
+ }
+ return QString();
+}
+
+QT_END_NAMESPACE
diff --git a/src/qdoc/xmlgenerator.h b/src/qdoc/xmlgenerator.h
new file mode 100644
index 000000000..4bf1ca938
--- /dev/null
+++ b/src/qdoc/xmlgenerator.h
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 Thibaut Cuvelier
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef XMLGENERATOR_H
+#define XMLGENERATOR_H
+
+#include "node.h"
+#include "generator.h"
+
+#include <QtCore/qmap.h>
+#include <QtCore/qstring.h>
+
+QT_BEGIN_NAMESPACE
+
+class XmlGenerator : public Generator
+{
+public:
+ explicit XmlGenerator() = default;
+
+protected:
+ QHash<QString, QString> refMap;
+
+ static bool hasBrief(const Node *node);
+ static bool isThreeColumnEnumValueTable(const Atom *atom);
+ static int hOffset(const Node *node);
+
+ static void rewritePropertyBrief(const Atom *atom, const Node *relative);
+ static Node::NodeType typeFromString(const Atom *atom);
+ static void setImageFileName(const Node *relative, const QString &fileName);
+ static QPair<QString, int> getAtomListValue(const Atom *atom);
+ static QPair<QString, QString> getTableWidthAttr(const Atom *atom);
+
+ QString registerRef(const QString &ref);
+ QString refForNode(const Node *node);
+ QString linkForNode(const Node *node, const Node *relative);
+ QString getLink(const Atom *atom, const Node *relative, const Node **node);
+ QString getAutoLink(const Atom *atom, const Node *relative, const Node** node);
+
+ const QPair<QString, QString> anchorForNode(const Node *node);
+
+ static QString targetType(const Node *node);
+};
+
+QT_END_NAMESPACE
+
+#endif //XMLGENERATOR_H
diff --git a/src/qdoc/yyindent.cpp b/src/qdoc/yyindent.cpp
index 6e4b1a6ca..c78e132b6 100644
--- a/src/qdoc/yyindent.cpp
+++ b/src/qdoc/yyindent.cpp
@@ -126,7 +126,7 @@ static QRegExp *iflikeKeyword = nullptr;
static QChar firstNonWhiteSpace(const QString &t)
{
int i = 0;
- while (i < (int) t.length()) {
+ while (i < t.length()) {
if (!t[i].isSpace())
return t[i];
i++;
@@ -151,7 +151,7 @@ static bool isOnlyWhiteSpace(const QString &t)
int columnForIndex(const QString &t, int index)
{
int col = 0;
- if (index > (int) t.length())
+ if (index > t.length())
index = t.length();
for (int i = 0; i < index; i++) {
@@ -230,7 +230,7 @@ static QString trimmedCodeLine(const QString &t)
int pos1 = label->pos(1);
int stop = cap1.length();
- if (pos1 + stop < (int) trimmed.length() && ppIndentSize < stop)
+ if (pos1 + stop < trimmed.length() && ppIndentSize < stop)
stop = ppIndentSize;
int i = 0;
@@ -238,7 +238,7 @@ static QString trimmedCodeLine(const QString &t)
eraseChar(trimmed, pos1 + i, ' ');
i++;
}
- while (i < (int) cap1.length()) {
+ while (i < cap1.length()) {
eraseChar(trimmed, pos1 + i, ';');
i++;
}
diff --git a/src/shared/winutils/utils.cpp b/src/shared/winutils/utils.cpp
index 263efbe18..f32b9b76b 100644
--- a/src/shared/winutils/utils.cpp
+++ b/src/shared/winutils/utils.cpp
@@ -112,7 +112,7 @@ QStringList findSharedLibraries(const QDir &directory, Platform platform,
QString nameFilter = prefix;
if (nameFilter.isEmpty())
nameFilter += QLatin1Char('*');
- if (debugMatchMode == MatchDebug && (platform & WindowsBased))
+ if (debugMatchMode == MatchDebug && platformHasDebugSuffix(platform))
nameFilter += QLatin1Char('d');
nameFilter += sharedLibrarySuffix(platform);
QStringList result;
@@ -794,14 +794,13 @@ static inline MsvcDebugRuntimeResult checkMsvcDebugRuntime(const QStringList &de
for (const QString &lib : dependentLibraries) {
int pos = 0;
if (lib.startsWith(QLatin1String("MSVCR"), Qt::CaseInsensitive)
- || lib.startsWith(QLatin1String("MSVCP"), Qt::CaseInsensitive)) {
- pos = 5;
- } else if (lib.startsWith(QLatin1String("VCRUNTIME"), Qt::CaseInsensitive)) {
- pos = 9;
+ || lib.startsWith(QLatin1String("MSVCP"), Qt::CaseInsensitive)
+ || lib.startsWith(QLatin1String("VCRUNTIME"), Qt::CaseInsensitive)) {
+ int lastDotPos = lib.lastIndexOf(QLatin1Char('.'));
+ pos = -1 == lastDotPos ? 0 : lastDotPos - 1;
}
- if (pos && lib.at(pos).isDigit()) {
- for (++pos; lib.at(pos).isDigit(); ++pos)
- ;
+
+ if (pos) {
return lib.at(pos).toLower() == QLatin1Char('d')
? MsvcDebugRuntime : MsvcReleaseRuntime;
}
diff --git a/src/shared/winutils/utils.h b/src/shared/winutils/utils.h
index 5552a3665..7915f8e4e 100644
--- a/src/shared/winutils/utils.h
+++ b/src/shared/winutils/utils.h
@@ -61,6 +61,11 @@ enum Platform {
UnknownPlatform
};
+inline bool platformHasDebugSuffix(Platform p) // Uses 'd' debug suffix
+{
+ return (p & WindowsBased) != 0 && (p & MinGW) == 0;
+}
+
enum ListOption {
ListNone = 0,
ListSource,
diff --git a/src/windeployqt/main.cpp b/src/windeployqt/main.cpp
index 1fefc6d21..99d1e152a 100644
--- a/src/windeployqt/main.cpp
+++ b/src/windeployqt/main.cpp
@@ -1062,7 +1062,7 @@ static QString libraryPath(const QString &libraryLocation, const char *name,
if (platform & WindowsBased) {
result += QLatin1String(name);
result += qtLibInfix;
- if (debug)
+ if (debug && platformHasDebugSuffix(platform))
result += QLatin1Char('d');
} else if (platform & UnixBased) {
result += QStringLiteral("lib");
@@ -1408,11 +1408,11 @@ static DeployResult deploy(const Options &options,
if ((options.platform & WindowsBased) && options.platform != WinCEIntel
&& options.platform != WinCEArm && !qtGuiLibrary.isEmpty()) {
QString libGlesName = QStringLiteral("libGLESV2");
- if (isDebug)
+ if (isDebug && platformHasDebugSuffix(options.platform))
libGlesName += QLatin1Char('d');
libGlesName += QLatin1String(windowsSharedLibrarySuffix);
QString libCombinedQtAngleName = QStringLiteral("QtANGLE");
- if (isDebug)
+ if (isDebug && platformHasDebugSuffix(options.platform))
libCombinedQtAngleName += QLatin1Char('d');
libCombinedQtAngleName += QLatin1String(windowsSharedLibrarySuffix);
const QStringList guiLibraries = findDependentLibraries(qtGuiLibrary, options.platform, errorMessage);
@@ -1428,7 +1428,7 @@ static DeployResult deploy(const Options &options,
const QString libGlesFullPath = qtBinDir + slash + libGlesName;
deployedQtLibraries.append(libGlesFullPath);
QString libEglFullPath = qtBinDir + slash + QStringLiteral("libEGL");
- if (isDebug)
+ if (isDebug && platformHasDebugSuffix(options.platform))
libEglFullPath += QLatin1Char('d');
libEglFullPath += QLatin1String(windowsSharedLibrarySuffix);
deployedQtLibraries.append(libEglFullPath);
@@ -1606,7 +1606,7 @@ static bool deployWebEngineCore(const QMap<QString, QString> &qmakeVariables,
"qtwebengine_resources_100p.pak",
"qtwebengine_resources_200p.pak"};
QByteArray webEngineProcessName(webEngineProcessC);
- if (isDebug)
+ if (isDebug && platformHasDebugSuffix(options.platform))
webEngineProcessName.append('d');
if (optVerboseLevel)
std::wcout << "Deploying: " << webEngineProcessName.constData() << "...\n";
diff --git a/tests/auto/qdoc/generatedoutput/bug80259/inc/testmodule/TestModule.h b/tests/auto/qdoc/generatedoutput/bug80259/inc/testmodule/TestModule.h
new file mode 100644
index 000000000..686cbe948
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/bug80259/inc/testmodule/TestModule.h
@@ -0,0 +1,3 @@
+#include "testmodule/aaa.h"
+#include "testmodule/bbb.h"
+#include "testmodule/ccc.h"
diff --git a/tests/auto/qdoc/generatedoutput/bug80259/inc/testmodule/aaa.h b/tests/auto/qdoc/generatedoutput/bug80259/inc/testmodule/aaa.h
new file mode 100644
index 000000000..dea5c1841
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/bug80259/inc/testmodule/aaa.h
@@ -0,0 +1,4 @@
+#pragma once
+class Third
+{
+};
diff --git a/tests/auto/qdoc/generatedoutput/bug80259/inc/testmodule/bbb.h b/tests/auto/qdoc/generatedoutput/bug80259/inc/testmodule/bbb.h
new file mode 100644
index 000000000..0dc6e52c6
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/bug80259/inc/testmodule/bbb.h
@@ -0,0 +1,5 @@
+#pragma once
+class First
+{
+ class Nested {};
+};
diff --git a/tests/auto/qdoc/generatedoutput/bug80259/inc/testmodule/ccc.h b/tests/auto/qdoc/generatedoutput/bug80259/inc/testmodule/ccc.h
new file mode 100644
index 000000000..d3a1557e1
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/bug80259/inc/testmodule/ccc.h
@@ -0,0 +1,4 @@
+#pragma once
+class Second
+{
+};
diff --git a/tests/auto/qdoc/generatedoutput/bug80259/src/main.cpp b/tests/auto/qdoc/generatedoutput/bug80259/src/main.cpp
new file mode 100644
index 000000000..a8991e18f
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/bug80259/src/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+/*!
+\class First
+\inmodule TestModule
+
+This is a first class
+*/
+
+/*!
+\class First::Nested
+\inmodule TestModule
+
+This is a nested class
+*/
+
+/*!
+\class Second
+\inmodule TestModule
+
+This is a second class
+*/
+
+/*!
+\class Third
+\inmodule TestModule
+
+This is a third class
+*/
diff --git a/tests/auto/qdoc/generatedoutput/bug80259/src/qdoc/index.qdoc b/tests/auto/qdoc/generatedoutput/bug80259/src/qdoc/index.qdoc
new file mode 100644
index 000000000..35ef7e087
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/bug80259/src/qdoc/index.qdoc
@@ -0,0 +1,7 @@
+/*!
+ \page index.html
+ \title doc index
+
+ \generatelist {classesbymodule TestModule}
+
+*/
diff --git a/tests/auto/qdoc/generatedoutput/bug80259/testmodule.qdocconf b/tests/auto/qdoc/generatedoutput/bug80259/testmodule.qdocconf
new file mode 100644
index 000000000..c02fb6fcf
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/bug80259/testmodule.qdocconf
@@ -0,0 +1,13 @@
+project = TestModule
+
+moduleheader = TestModule.h
+
+headerdirs = inc
+sourcedirs = src
+includepaths += ./bug80259/inc/testmodule
+
+sources.fileextensions = "*.cpp *.qdoc"
+headers.fileextensions = "*.h"
+
+outputdir = doc
+outputformats = HTML
diff --git a/tests/auto/qdoc/generatedoutput/bug80259/webxml_testmodule.qdocconf b/tests/auto/qdoc/generatedoutput/bug80259/webxml_testmodule.qdocconf
new file mode 100644
index 000000000..642fe5c2d
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/bug80259/webxml_testmodule.qdocconf
@@ -0,0 +1,2 @@
+include(testmodule.qdocconf)
+include(../webxml.qdocconf)
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/first.html b/tests/auto/qdoc/generatedoutput/expected_output/first.html
new file mode 100644
index 000000000..0a7f52a13
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/expected_output/first.html
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<!-- main.cpp -->
+ <title>First Class | TestModule</title>
+</head>
+<body>
+<li>First</li>
+<div class="sidebar">
+<div class="toc">
+<h3><a name="toc">Contents</a></h3>
+<ul>
+<li class="level1"><a href="#details">Detailed Description</a></li>
+</ul>
+</div>
+<div class="sidebar-content" id="sidebar-content"></div></div>
+<h1 class="title">First Class</h1>
+<div class="table"><table class="alignedsummary">
+<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign"> <span class="preprocessor">#include &lt;First&gt;</span>
+</td></tr></table></div><ul>
+</ul>
+<a name="details"></a>
+<!-- $$$First-description -->
+<div class="descr">
+<h2 id="details">Detailed Description</h2>
+<p>This is a first class</p>
+</div>
+<!-- @@@First -->
+</body>
+</html>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/html/first.webxml b/tests/auto/qdoc/generatedoutput/expected_output/html/first.webxml
new file mode 100644
index 000000000..1001d0c53
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/expected_output/html/first.webxml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<WebXML>
+ <document>
+ <class name="First" href="first.html" status="active" access="public" location="bbb.h" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/bug80259/inc/testmodule/bbb.h" lineno="2" documented="true" module="TestModule">
+ <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/bug80259/src/main.cpp" line="28" column="4">
+ <para>This is a first class</para>
+ </description>
+ <class name="Nested" fullname="First::Nested" href="first-nested.html" status="active" access="private" location="bbb.h" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/bug80259/inc/testmodule/bbb.h" lineno="4" documented="true" module="TestModule">
+ <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/bug80259/src/main.cpp" line="35" column="4">
+ <para>This is a nested class</para>
+ </description>
+ </class>
+ </class>
+ </document>
+</WebXML>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/html/index.webxml b/tests/auto/qdoc/generatedoutput/expected_output/html/index.webxml
new file mode 100644
index 000000000..4e51df8d0
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/expected_output/html/index.webxml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<WebXML>
+ <document>
+ <page name="index.html" href="index.html" status="active" location="index.qdoc" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/bug80259/src/qdoc/index.qdoc" lineno="1" documented="true" subtype="page" title="doc index" fulltitle="doc index" subtitle="" module="TestModule">
+ <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/bug80259/src/qdoc/index.qdoc" line="1" column="5">
+ <generatedlist contents="classesbymodule TestModule"/>
+ </description>
+ </page>
+ </document>
+</WebXML>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/html/qdoctests-qdocfileoutput-linking.webxml b/tests/auto/qdoc/generatedoutput/expected_output/html/qdoctests-qdocfileoutput-linking.webxml
new file mode 100644
index 000000000..9e203d926
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/expected_output/html/qdoctests-qdocfileoutput-linking.webxml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<WebXML>
+ <document>
+ <page name="qdoctests-qdocfileoutput-linking.html" href="qdoctests-qdocfileoutput-linking.html" status="active" location="qdoctests-outputfromqdocfiles.qdoc" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/qdoctests-outputfromqdocfiles.qdoc" lineno="71" documented="true" subtype="page" title="Testing QDoc's link command" fulltitle="Testing QDoc's link command" subtitle="" module="Test" brief="This is a page for testing QDoc's link command">
+ <target name="link-test-target"/>
+ <keyword name="qdoc-linking-test" title="QDoc Linking Test"/>
+ <contents name="link-targets" title="Link targets" level="1"/>
+ <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/qdoctests-outputfromqdocfiles.qdoc" line="71" column="4">
+ <brief>This is a page for testing QDoc's link command.</brief>
+ <target name="link-test-target"/>
+ <section id="link-targets">
+ <heading level="1">Link targets</heading>
+ <para>Valid parameters for the link command (<teletype type="highlighted">\l</teletype>) are page and section titles, targets defined with \target or \keyword commands, and API reference keywords (types, methods, namespaces, and so on).</para>
+ </section>
+ </description>
+ </page>
+ </document>
+</WebXML>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/html/qdoctests-qdocfileoutput.webxml b/tests/auto/qdoc/generatedoutput/expected_output/html/qdoctests-qdocfileoutput.webxml
new file mode 100644
index 000000000..c09bbe31c
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/expected_output/html/qdoctests-qdocfileoutput.webxml
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<WebXML>
+ <document>
+ <page name="qdoctests-qdocfileoutput.html" href="qdoctests-qdocfileoutput.html" status="active" location="qdoctests-outputfromqdocfiles.qdoc" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/qdoctests-outputfromqdocfiles.qdoc" lineno="28" documented="true" subtype="page" title="Testing QDoc output from .qdoc files" fulltitle="Testing QDoc output from .qdoc files" subtitle="" module="Test" brief="This is a simple page for testing purposes only">
+ <contents name="supported-file-types" title="Supported file types" level="1"/>
+ <contents name="further-information" title="Further information" level="1"/>
+ <contents name="linking" title="Linking" level="1"/>
+ <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/qdoctests-outputfromqdocfiles.qdoc" line="28" column="4">
+ <brief>This is a simple page for testing purposes only.</brief>
+ <para>QDoc generates documentation for software projects. It does this by extracting <italic>QDoc comments</italic> from project source files. QDoc comments are signified by a C-style-like comment tag followed by an exclamation point, like this: <teletype type="highlighted">/*!</teletype> <teletype type="highlighted">This text is contained within QDoc comment tags.</teletype> <teletype type="highlighted">*/</teletype>.</para>
+ <section id="supported-file-types">
+ <heading level="1">Supported file types</heading>
+ <para>QDoc parses <teletype type="highlighted">.cpp</teletype> and <teletype type="highlighted">.qdoc</teletype> files. It does extract comments from header (<teletype type="highlighted">.h</teletype>) files.</para>
+ </section>
+ <section id="further-information">
+ <heading level="1">Further information</heading>
+ <para>This test document is written with the purpose of testing the output QDoc generates when parsing <teletype type="highlighted">.qdoc</teletype> files. It is fairly simple and makes use of a limited subset of QDoc's command. Those commands are:</para>
+ <list type="bullet">
+ <item>
+ <para>
+ <teletype type="highlighted">\page</teletype></para>
+ </item>
+ <item>
+ <para>
+ <teletype type="highlighted">\title</teletype></para>
+ </item>
+ <item>
+ <para>
+ <teletype type="highlighted">\brief</teletype></para>
+ </item>
+ <item>
+ <para>
+ <teletype type="highlighted">\e</teletype> (for emphasizing &quot;QDoc comments&quot;)</para>
+ </item>
+ <item>
+ <para>
+ <teletype type="highlighted">\c</teletype> (for multiple monospace-formatted entries)</para>
+ </item>
+ <item>
+ <para>
+ <teletype type="highlighted">\section1</teletype></para>
+ </item>
+ <item>
+ <para>
+ <teletype type="highlighted">\list</teletype></para>
+ </item>
+ <item>
+ <para>
+ <teletype type="highlighted">\li</teletype></para>
+ </item>
+ <item>
+ <para>
+ <teletype type="highlighted">\endlist</teletype></para>
+ </item>
+ </list>
+ </section>
+ <section id="linking">
+ <heading level="1">Linking</heading>
+ <para>There are multiple ways to create hyperlinks to other topics:</para>
+ <list type="bullet">
+ <item>
+ <para>
+ <link raw="Testing QDoc's link command" href="qdoctests-qdocfileoutput-linking.html" type="page" page="Testing QDoc's link command">Linking to a page title</link></para>
+ </item>
+ <item>
+ <para>
+ <link raw="Link targets" href="qdoctests-qdocfileoutput-linking.html#link-targets" type="page" page="Testing QDoc's link command">Linking to a section title</link></para>
+ </item>
+ <item>
+ <para>
+ <link raw="link-test-target" href="qdoctests-qdocfileoutput-linking.html#link-test-target" type="page" page="Testing QDoc's link command">Linking using a \target string</link></para>
+ </item>
+ <item>
+ <para>
+ <link raw="QDoc Linking Test" href="qdoctests-qdocfileoutput-linking.html" type="page" page="Testing QDoc's link command">Linking using a \keyword string</link></para>
+ </item>
+ </list>
+ </section>
+ </description>
+ </page>
+ </document>
+</WebXML>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/html/second.webxml b/tests/auto/qdoc/generatedoutput/expected_output/html/second.webxml
new file mode 100644
index 000000000..0a4939841
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/expected_output/html/second.webxml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<WebXML>
+ <document>
+ <class name="Second" href="second.html" status="active" access="public" location="ccc.h" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/bug80259/inc/testmodule/ccc.h" lineno="2" documented="true" module="TestModule">
+ <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/bug80259/src/main.cpp" line="42" column="4">
+ <para>This is a second class</para>
+ </description>
+ </class>
+ </document>
+</WebXML>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/html/test-componentset-example.webxml b/tests/auto/qdoc/generatedoutput/expected_output/html/test-componentset-example.webxml
new file mode 100644
index 000000000..8689d2e76
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/expected_output/html/test-componentset-example.webxml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<WebXML>
+ <document>
+ <page name="componentset" href="test-componentset-example.html" status="active" location="examples.qdoc" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/examples.qdoc" lineno="28" documented="true" subtype="example" title="QML Documentation Example" fulltitle="QML Documentation Example" subtitle="" module="Test">
+ <contents name="qml-class" title="QML Class" level="1"/>
+ <contents name="properties-signals-handlers-and-methods" title="Properties, Signals, Handlers, and Methods" level="1"/>
+ <contents name="internal-documentation" title="Internal Documentation" level="2"/>
+ <contents name="qml-types-with-c-implementation" title="QML Types with C++ Implementation" level="1"/>
+ <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/examples.qdoc" line="28" column="4">
+ <para>This example demonstrates one of the ways to document QML types.</para>
+ <para>In particular, there are sample types that are documented with QDoc commands comments. There are documentation comments for the QML types and their public interfaces. The types are grouped into a module, the <link raw="UI Components" href="uicomponents-qmlmodule.html" type="">UI Components</link> module.</para>
+ <para>The uicomponents.qdoc file generates the overview page for the <link raw="UI Components" href="uicomponents-qmlmodule.html" type="">UI Components</link> module page.</para>
+ <para>The generated documentation is available in the <link raw="UI Components" href="uicomponents-qmlmodule.html" type="">UI Components</link> module.</para>
+ <section id="qml-class">
+ <heading level="1">QML Class</heading>
+ <para>The QML types use the \qmltype to document the type. In addition, they have the \inmodule command in order for QDoc to associate them to the <teletype type="highlighted">UIComponents</teletype> module.</para>
+ <para>QDoc uses the \brief command to place a basic description when listing the types.</para>
+ </section>
+ <section id="properties-signals-handlers-and-methods">
+ <heading level="1">Properties, Signals, Handlers, and Methods</heading>
+ <para>The types have their properties, signals, handlers, and methods defined in their respective QML files. QDoc associates the properties and methods to the types, therefore, you only need to place the documentation above the property, method, or signal.</para>
+ <para>To document the type of a <italic>property alias</italic>, you must use the \qmlproperty command to specify the data type.</para>
+ <code>\qmlproperty int anAliasedProperty
+An aliased property of type int.</code>
+ </section>
+ <section id="internal-documentation">
+ <heading level="2">Internal Documentation</heading>
+ <para>You may declare that a documentation is for internal use by placing the \internal command after the beginning QDoc comment <teletype type="highlighted">/*</teletype>. QDoc will prevent the internal documentation from appearing in the public API.</para>
+ <para>If you wish to omit certain parts of the documentation, you may use the \omit and \endomit command.</para>
+ </section>
+ <section id="qml-types-with-c-implementation">
+ <heading level="1">QML Types with C++ Implementation</heading>
+ <para>This example only demonstrates the documentation for types in QML files, but the regular QML commands may be placed inside C++ classes to define the public API of the QML type.</para>
+ </section>
+ </description>
+ </page>
+ </document>
+</WebXML>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/html/testcpp-module.webxml b/tests/auto/qdoc/generatedoutput/expected_output/html/testcpp-module.webxml
new file mode 100644
index 000000000..5d24b3077
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/expected_output/html/testcpp-module.webxml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<WebXML>
+ <document/>
+</WebXML>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/html/testqdoc-test.webxml b/tests/auto/qdoc/generatedoutput/expected_output/html/testqdoc-test.webxml
new file mode 100644
index 000000000..028921a6e
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/expected_output/html/testqdoc-test.webxml
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<WebXML>
+ <document>
+ <class name="Test" fullname="TestQDoc::Test" href="testqdoc-test.html" status="active" access="public" location="testcpp.h" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.h" lineno="34" documented="true" module="TestCPP" brief="A class in a namespace">
+ <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.cpp" line="49" column="4">
+ <brief>A class in a namespace.</brief>
+ </description>
+ <function name="QDOCTEST_MACRO2" href="testqdoc-test.html#QDOCTEST_MACRO2" status="active" access="public" documented="true" related="true" since="Test 1.1" meta="macrowithparams" virtual="non" const="false" static="false" final="false" override="false" type="" brief="A macro with argument x" signature="QDOCTEST_MACRO2( x)">
+ <parameter type="" name="x" default=""/>
+ <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.cpp" line="66" column="4">
+ <brief>A macro with argument <argument>x</argument>.</brief>
+ </description>
+ </function>
+ <function name="anotherObsoleteMember" fullname="TestQDoc::Test::anotherObsoleteMember" href="testqdoc-test-obsolete.html#anotherObsoleteMember" status="obsolete" access="public" location="testcpp.h" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.h" lineno="39" documented="true" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="void" signature="void anotherObsoleteMember()">
+ <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.cpp" line="93" column="4">
+ <para>Use <link raw="obsoleteMember()" href="testqdoc-test-obsolete.html#obsoleteMember" type="function">obsoleteMember()</link> instead.</para>
+ </description>
+ </function>
+ <function name="deprecatedMember" fullname="TestQDoc::Test::deprecatedMember" href="testqdoc-test-obsolete.html#deprecatedMember" status="obsolete" access="public" location="testcpp.h" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.h" lineno="40" documented="true" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="void" signature="void deprecatedMember()">
+ <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.cpp" line="73" column="4">
+ <para>Use <link raw="someFunction()" href="testqdoc-test.html#someFunction" type="function">someFunction()</link> instead.</para>
+ </description>
+ </function>
+ <function name="inlineFunction" fullname="TestQDoc::Test::inlineFunction" href="testqdoc-test.html#inlineFunction" status="active" access="public" location="testcpp.h" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.h" lineno="41" documented="true" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="void" brief="An inline function, documented using the \fn QDoc command" signature="void inlineFunction()">
+ <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.cpp" line="120" column="4">
+ <brief>An inline function, documented using the \fn QDoc command.</brief>
+ </description>
+ </function>
+ <function name="obsoleteMember" fullname="TestQDoc::Test::obsoleteMember" href="testqdoc-test-obsolete.html#obsoleteMember" status="obsolete" access="public" location="testcpp.h" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.h" lineno="38" documented="true" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="void" signature="void obsoleteMember()">
+ <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.cpp" line="83" column="4">
+ <para>Use <link raw="someFunction()" href="testqdoc-test.html#someFunction" type="function">someFunction()</link> instead.</para>
+ </description>
+ </function>
+ <function name="someFunction" fullname="TestQDoc::Test::someFunction" href="testqdoc-test.html#someFunction" status="active" access="public" location="testcpp.h" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.h" lineno="36" documented="true" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="int" signature="int someFunction(int v)">
+ <parameter type="int" name="v" default=""/>
+ <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.cpp" line="111" column="4">
+ <para>Function that takes a parameter <argument>v</argument>. Also returns the value of <argument>v</argument>.</para>
+ </description>
+ </function>
+ <function name="someFunctionDefaultArg" fullname="TestQDoc::Test::someFunctionDefaultArg" href="testqdoc-test.html#someFunctionDefaultArg" status="active" access="public" location="testcpp.h" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.h" lineno="37" documented="true" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="void" signature="void someFunctionDefaultArg(int i, bool b)">
+ <parameter type="int" name="i" default=""/>
+ <parameter type="bool" name="b" default="false"/>
+ <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.cpp" line="103" column="4">
+ <para>Function that takes a parameter <argument>i</argument> and <argument>b</argument>.</para>
+ </description>
+ </function>
+ <function name="virtualFun" fullname="TestQDoc::Test::virtualFun" href="testqdoc-test.html#virtualFun" status="active" access="public" location="testcpp.h" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.h" lineno="42" documented="true" meta="plain" virtual="virtual" const="false" static="false" final="false" override="false" type="void" signature="void virtualFun()">
+ <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.cpp" line="126" column="4">
+ <para>Function that must be reimplemented.</para>
+ </description>
+ </function>
+ </class>
+ </document>
+</WebXML>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/html/testqdoc-testderived.webxml b/tests/auto/qdoc/generatedoutput/expected_output/html/testqdoc-testderived.webxml
new file mode 100644
index 000000000..07b6c4caf
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/expected_output/html/testqdoc-testderived.webxml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<WebXML>
+ <document>
+ <class name="TestDerived" fullname="TestQDoc::TestDerived" href="testqdoc-testderived.html" status="active" access="public" location="testcpp.h" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.h" lineno="45" documented="true" bases="TestQDoc::Test" module="TestCPP" brief="A derived class in a namespace">
+ <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.cpp" line="55" column="4">
+ <brief>A derived class in a namespace.</brief>
+ </description>
+ <function name="virtualFun" fullname="TestQDoc::TestDerived::virtualFun" href="testqdoc-testderived.html#virtualFun" status="active" access="public" location="testcpp.h" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.h" lineno="47" documented="true" meta="plain" virtual="virtual" const="false" static="false" final="false" override="true" type="void" signature="void virtualFun() override">
+ <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.cpp" line="134" column="4"/>
+ </function>
+ </class>
+ </document>
+</WebXML>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/html/testqdoc.webxml b/tests/auto/qdoc/generatedoutput/expected_output/html/testqdoc.webxml
new file mode 100644
index 000000000..750f544b8
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/expected_output/html/testqdoc.webxml
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<WebXML>
+ <document>
+ <namespace name="TestQDoc" href="testqdoc.html" status="active" access="public" location="testcpp.h" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.h" lineno="32" documented="true" module="TestCPP" brief="A namespace">
+ <contents name="usage" title="Usage" level="1"/>
+ <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.cpp" line="39" column="4">
+ <brief>A namespace.</brief>
+ <section id="usage">
+ <heading level="1">Usage</heading>
+ <para>This namespace is for testing QDoc output.</para>
+ </section>
+ </description>
+ <function name="QDOCTEST_MACRO" href="testqdoc.html#QDOCTEST_MACRO" status="active" access="public" documented="true" related="true" meta="macrowithoutparams" virtual="non" const="false" static="false" final="false" override="false" type="" signature="QDOCTEST_MACRO">
+ <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.cpp" line="61" column="4"/>
+ </function>
+ <class name="Test" fullname="TestQDoc::Test" href="testqdoc-test.html" status="active" access="public" location="testcpp.h" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.h" lineno="34" documented="true" module="TestCPP" brief="A class in a namespace">
+ <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.cpp" line="49" column="4">
+ <brief>A class in a namespace.</brief>
+ </description>
+ <function name="QDOCTEST_MACRO2" href="testqdoc-test.html#QDOCTEST_MACRO2" status="active" access="public" documented="true" related="true" since="Test 1.1" meta="macrowithparams" virtual="non" const="false" static="false" final="false" override="false" type="" brief="A macro with argument x" signature="QDOCTEST_MACRO2( x)">
+ <parameter type="" name="x" default=""/>
+ <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.cpp" line="66" column="4">
+ <brief>A macro with argument <argument>x</argument>.</brief>
+ </description>
+ </function>
+ <function name="anotherObsoleteMember" fullname="TestQDoc::Test::anotherObsoleteMember" href="testqdoc-test-obsolete.html#anotherObsoleteMember" status="obsolete" access="public" location="testcpp.h" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.h" lineno="39" documented="true" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="void" signature="void anotherObsoleteMember()">
+ <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.cpp" line="93" column="4">
+ <para>Use <link raw="obsoleteMember()" href="testqdoc-test-obsolete.html#obsoleteMember" type="function">obsoleteMember()</link> instead.</para>
+ </description>
+ </function>
+ <function name="deprecatedMember" fullname="TestQDoc::Test::deprecatedMember" href="testqdoc-test-obsolete.html#deprecatedMember" status="obsolete" access="public" location="testcpp.h" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.h" lineno="40" documented="true" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="void" signature="void deprecatedMember()">
+ <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.cpp" line="73" column="4">
+ <para>Use <link raw="someFunction()" href="testqdoc-test.html#someFunction" type="function">someFunction()</link> instead.</para>
+ </description>
+ </function>
+ <function name="inlineFunction" fullname="TestQDoc::Test::inlineFunction" href="testqdoc-test.html#inlineFunction" status="active" access="public" location="testcpp.h" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.h" lineno="41" documented="true" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="void" brief="An inline function, documented using the \fn QDoc command" signature="void inlineFunction()">
+ <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.cpp" line="120" column="4">
+ <brief>An inline function, documented using the \fn QDoc command.</brief>
+ </description>
+ </function>
+ <function name="obsoleteMember" fullname="TestQDoc::Test::obsoleteMember" href="testqdoc-test-obsolete.html#obsoleteMember" status="obsolete" access="public" location="testcpp.h" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.h" lineno="38" documented="true" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="void" signature="void obsoleteMember()">
+ <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.cpp" line="83" column="4">
+ <para>Use <link raw="someFunction()" href="testqdoc-test.html#someFunction" type="function">someFunction()</link> instead.</para>
+ </description>
+ </function>
+ <function name="someFunction" fullname="TestQDoc::Test::someFunction" href="testqdoc-test.html#someFunction" status="active" access="public" location="testcpp.h" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.h" lineno="36" documented="true" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="int" signature="int someFunction(int v)">
+ <parameter type="int" name="v" default=""/>
+ <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.cpp" line="111" column="4">
+ <para>Function that takes a parameter <argument>v</argument>. Also returns the value of <argument>v</argument>.</para>
+ </description>
+ </function>
+ <function name="someFunctionDefaultArg" fullname="TestQDoc::Test::someFunctionDefaultArg" href="testqdoc-test.html#someFunctionDefaultArg" status="active" access="public" location="testcpp.h" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.h" lineno="37" documented="true" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="void" signature="void someFunctionDefaultArg(int i, bool b)">
+ <parameter type="int" name="i" default=""/>
+ <parameter type="bool" name="b" default="false"/>
+ <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.cpp" line="103" column="4">
+ <para>Function that takes a parameter <argument>i</argument> and <argument>b</argument>.</para>
+ </description>
+ </function>
+ <function name="virtualFun" fullname="TestQDoc::Test::virtualFun" href="testqdoc-test.html#virtualFun" status="active" access="public" location="testcpp.h" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.h" lineno="42" documented="true" meta="plain" virtual="virtual" const="false" static="false" final="false" override="false" type="void" signature="void virtualFun()">
+ <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.cpp" line="126" column="4">
+ <para>Function that must be reimplemented.</para>
+ </description>
+ </function>
+ </class>
+ <class name="TestDerived" fullname="TestQDoc::TestDerived" href="testqdoc-testderived.html" status="active" access="public" location="testcpp.h" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.h" lineno="45" documented="true" bases="TestQDoc::Test" module="TestCPP" brief="A derived class in a namespace">
+ <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.cpp" line="55" column="4">
+ <brief>A derived class in a namespace.</brief>
+ </description>
+ <function name="virtualFun" fullname="TestQDoc::TestDerived::virtualFun" href="testqdoc-testderived.html#virtualFun" status="active" access="public" location="testcpp.h" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.h" lineno="47" documented="true" meta="plain" virtual="virtual" const="false" static="false" final="false" override="true" type="void" signature="void virtualFun() override">
+ <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.cpp" line="134" column="4"/>
+ </function>
+ </class>
+ </namespace>
+ </document>
+</WebXML>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/html/third.webxml b/tests/auto/qdoc/generatedoutput/expected_output/html/third.webxml
new file mode 100644
index 000000000..d826bb421
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/expected_output/html/third.webxml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<WebXML>
+ <document>
+ <class name="Third" href="third.html" status="active" access="public" location="aaa.h" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/bug80259/inc/testmodule/aaa.h" lineno="2" documented="true" module="TestModule">
+ <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/bug80259/src/main.cpp" line="49" column="4">
+ <para>This is a third class</para>
+ </description>
+ </class>
+ </document>
+</WebXML>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/html/uicomponents-qmlmodule.webxml b/tests/auto/qdoc/generatedoutput/expected_output/html/uicomponents-qmlmodule.webxml
new file mode 100644
index 000000000..5d24b3077
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/expected_output/html/uicomponents-qmlmodule.webxml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<WebXML>
+ <document/>
+</WebXML>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/index.html b/tests/auto/qdoc/generatedoutput/expected_output/index.html
new file mode 100644
index 000000000..8600e0867
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/expected_output/index.html
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<!-- index.qdoc -->
+ <title>doc index | TestModule</title>
+</head>
+<body>
+<h1 class="title">doc index</h1>
+<span class="subtitle"></span>
+<!-- $$$index.html-description -->
+<div class="descr"> <a name="details"></a>
+<div class="table"><table class="annotated">
+<tr class="odd topAlign"><td class="tblName"><p><a href="first.html">First</a></p></td></tr>
+<tr class="even topAlign"><td class="tblName"><p><a href="">First::Nested</a></p></td></tr>
+<tr class="odd topAlign"><td class="tblName"><p><a href="second.html">Second</a></p></td></tr>
+<tr class="even topAlign"><td class="tblName"><p><a href="third.html">Third</a></p></td></tr>
+</table></div>
+</div>
+<!-- @@@index.html -->
+</body>
+</html>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/qdoc-test-qmlmodule.html b/tests/auto/qdoc/generatedoutput/expected_output/qdoc-test-qmlmodule.html
new file mode 100644
index 000000000..0d424fb73
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/expected_output/qdoc-test-qmlmodule.html
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<!-- type.cpp -->
+ <title>Test</title>
+</head>
+<body>
+<div class="sidebar"><div class="sidebar-content" id="sidebar-content"></div></div>
+<span class="subtitle"></span>
+<!-- $$$QDoc.Test-description -->
+<div class="descr"> <a name="details"></a>
+</div>
+<!-- @@@QDoc.Test -->
+<div class="table"><table class="annotated">
+<tr class="odd topAlign"><td class="tblName"><p><a href="qml-qdoc-test-abstractparent.html">AbstractParent</a></p></td><td class="tblDescr"><p>Abstract base QML type</p></td></tr>
+<tr class="even topAlign"><td class="tblName"><p><a href="qml-qdoc-test-child.html">Child</a></p></td><td class="tblDescr"><p>A Child inheriting its parent</p></td></tr>
+<tr class="odd topAlign"><td class="tblName"><p><a href="qml-qdoc-test-doctest.html">DocTest</a></p></td><td class="tblDescr"><p>Represents a doc test case</p></td></tr>
+<tr class="even topAlign"><td class="tblName"><p><a href="qml-qdoc-test-type.html">Type</a></p></td><td class="tblDescr"><p>A QML type documented in a .cpp file</p></td></tr>
+<tr class="odd topAlign"><td class="tblName"><p><a href="qml-int.html">int</a></p></td><td class="tblDescr"><p>An integer basic type</p></td></tr>
+</table></div>
+</body>
+</html>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/qml-int.html b/tests/auto/qdoc/generatedoutput/expected_output/qml-int.html
new file mode 100644
index 000000000..108bf6a37
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/expected_output/qml-int.html
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<!-- parent.qdoc -->
+ <title>int QML Basic Type | Test</title>
+</head>
+<body>
+<div class="sidebar">
+<div class="toc">
+<h3><a name="toc">Contents</a></h3>
+<ul>
+</ul>
+</div>
+<div class="sidebar-content" id="sidebar-content"></div></div>
+<h1 class="title">int QML Basic Type</h1>
+<span class="subtitle"></span>
+<!-- $$$int-description -->
+<div class="descr"> <a name="details"></a>
+</div>
+<!-- @@@int -->
+</body>
+</html>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-abstractparent.html b/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-abstractparent.html
new file mode 100644
index 000000000..5b9bad572
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-abstractparent.html
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<!-- parent.qdoc -->
+ <title>AbstractParent QML Type | Test</title>
+</head>
+<body>
+<div class="sidebar">
+<div class="toc">
+<h3><a name="toc">Contents</a></h3>
+<ul>
+<li class="level1"><a href="#properties">Properties</a></li>
+<li class="level1"><a href="#methods">Methods</a></li>
+<li class="level1"><a href="#details">Detailed Description</a></li>
+</ul>
+</div>
+<div class="sidebar-content" id="sidebar-content"></div></div>
+<h1 class="title">AbstractParent QML Type</h1>
+<span class="subtitle"></span>
+<!-- $$$AbstractParent-brief -->
+<p>Abstract base QML type. <a href="#details">More...</a></p>
+<!-- @@@AbstractParent -->
+<div class="table"><table class="alignedsummary">
+<tr><td class="memItemLeft rightAlign topAlign"> Import Statement:</td><td class="memItemRight bottomAlign"> import QDoc.Test 1.1</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherited By:</td><td class="memItemRight bottomAlign"> <p><a href="qml-qdoc-test-child.html">Child</a></p>
+</td></tr></table></div><ul>
+<li><a href="qml-qdoc-test-abstractparent-members.html">List of all members, including inherited members</a></li>
+</ul>
+<a name="properties"></a>
+<h2 id="properties">Properties</h2>
+<ul>
+<li class="fn"><b><b><a href="qml-qdoc-test-abstractparent.html#children-prop">children</a></b></b> : list&lt;Child&gt;</li>
+</ul>
+<a name="methods"></a>
+<h2 id="methods">Methods</h2>
+<ul>
+<li class="fn">void <b><b><a href="qml-qdoc-test-abstractparent.html#rear-method">rear</a></b></b>(<i>child</i>)</li>
+</ul>
+<!-- $$$AbstractParent-description -->
+<a name="details"></a>
+<h2 id="details">Detailed Description</h2>
+<!-- @@@AbstractParent -->
+<h2>Property Documentation</h2>
+<!-- $$$children -->
+<div class="qmlitem"><div class="qmlproto">
+<div class="table"><table class="qmlname">
+<tr valign="top" class="odd" id="">
+<td class="tblQmlPropNode"><p>
+<a name="children-prop"></a><span class="qmldefault">[default] </span><span class="name">children</span> : <span class="type">list</span>&lt;<span class="type"><a href="qml-qdoc-test-child.html">Child</a></span>&gt;</p></td></tr>
+</table></div>
+</div><div class="qmldoc"><p>Children of the type.</p>
+</div></div><!-- @@@children -->
+<br/>
+<h2>Method Documentation</h2>
+<!-- $$$rear[overload1]$$$rear -->
+<div class="qmlitem"><div class="qmlproto">
+<div class="table"><table class="qmlname">
+<tr valign="top" class="odd" id="">
+<td class="tblQmlFuncNode"><p>
+<a name="rear-method"></a><span class="type">void</span> <span class="name">rear</span>(<i>child</i>)</p></td></tr>
+</table></div>
+</div><div class="qmldoc"><p>Do some abstract parenting on <i>child</i>.</p>
+</div></div><!-- @@@rear -->
+<br/>
+</body>
+</html>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-child.html b/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-child.html
new file mode 100644
index 000000000..c9cb241af
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-child.html
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<!-- parent.qdoc -->
+ <title>Child QML Type | Test</title>
+</head>
+<body>
+<div class="sidebar">
+<div class="toc">
+<h3><a name="toc">Contents</a></h3>
+<ul>
+<li class="level1"><a href="#properties">Properties</a></li>
+<li class="level1"><a href="#methods">Methods</a></li>
+<li class="level1"><a href="#details">Detailed Description</a></li>
+</ul>
+</div>
+<div class="sidebar-content" id="sidebar-content"></div></div>
+<h1 class="title">Child QML Type</h1>
+<span class="subtitle"></span>
+<!-- $$$Child-brief -->
+<p>A Child inheriting its parent. <a href="#details">More...</a></p>
+<!-- @@@Child -->
+<div class="table"><table class="alignedsummary">
+<tr><td class="memItemLeft rightAlign topAlign"> Import Statement:</td><td class="memItemRight bottomAlign"> import QDoc.Test 1.1</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <p><a href="qml-qdoc-test-abstractparent.html">AbstractParent</a></p>
+</td></tr></table></div><ul>
+<li><a href="qml-qdoc-test-child-members.html">List of all members, including inherited members</a></li>
+</ul>
+<a name="properties"></a>
+<h2 id="properties">Properties</h2>
+<ul>
+<li class="fn"><b><b><a href="qml-qdoc-test-child.html#children-prop">children</a></b></b> : list&lt;Child&gt;</li>
+</ul>
+<a name="methods"></a>
+<h2 id="methods">Methods</h2>
+<ul>
+<li class="fn">void <b><b><a href="qml-qdoc-test-child.html#rear-method">rear</a></b></b>(<i>child</i>)</li>
+</ul>
+<!-- $$$Child-description -->
+<a name="details"></a>
+<h2 id="details">Detailed Description</h2>
+<!-- @@@Child -->
+<h2>Property Documentation</h2>
+<!-- $$$children -->
+<div class="qmlitem"><div class="qmlproto">
+<div class="table"><table class="qmlname">
+<tr valign="top" class="odd" id="">
+<td class="tblQmlPropNode"><p>
+<a name="children-prop"></a><span class="qmldefault">[default] </span><span class="name">children</span> : <span class="type">list</span>&lt;<span class="type"><a href="qml-qdoc-test-child.html">Child</a></span>&gt;</p></td></tr>
+</table></div>
+</div><div class="qmldoc"><p>Children of the type.</p>
+</div></div><!-- @@@children -->
+<br/>
+<h2>Method Documentation</h2>
+<!-- $$$rear[overload1]$$$rear -->
+<div class="qmlitem"><div class="qmlproto">
+<div class="table"><table class="qmlname">
+<tr valign="top" class="odd" id="">
+<td class="tblQmlFuncNode"><p>
+<a name="rear-method"></a><span class="type">void</span> <span class="name">rear</span>(<i>child</i>)</p></td></tr>
+</table></div>
+</div><div class="qmldoc"><p>Do some abstract parenting on <i>child</i>.</p>
+</div></div><!-- @@@rear -->
+<br/>
+</body>
+</html>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-doctest.html b/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-doctest.html
new file mode 100644
index 000000000..8ad2b4d5e
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-doctest.html
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<!-- DocTest.qml -->
+ <title>DocTest QML Type | Test</title>
+</head>
+<body>
+<div class="sidebar">
+<div class="toc">
+<h3><a name="toc">Contents</a></h3>
+<ul>
+<li class="level1"><a href="#properties">Properties</a></li>
+<li class="level1"><a href="#methods">Methods</a></li>
+<li class="level1"><a href="#details">Detailed Description</a></li>
+<li class="level2"><a href="#introduction">Introduction</a></li>
+</ul>
+</div>
+<div class="sidebar-content" id="sidebar-content"></div></div>
+<h1 class="title">DocTest QML Type</h1>
+<span class="subtitle"></span>
+<!-- $$$DocTest-brief -->
+<p>Represents a doc test case. <a href="#details">More...</a></p>
+<!-- @@@DocTest -->
+<div class="table"><table class="alignedsummary">
+<tr><td class="memItemLeft rightAlign topAlign"> Import Statement:</td><td class="memItemRight bottomAlign"> import QDoc.Test 1.1</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Since:</td><td class="memItemRight bottomAlign"> QDoc.Test 0.9</td></tr></table></div><ul>
+<li><a href="qml-qdoc-test-doctest-members.html">List of all members, including inherited members</a></li>
+</ul>
+<a name="properties"></a>
+<h2 id="properties">Properties</h2>
+<ul>
+<li class="fn"><b><b><a href="qml-qdoc-test-doctest.html#active-prop">active</a></b></b> : bool</li>
+<li class="fn"><b><b><a href="qml-qdoc-test-doctest.html#name-prop">name</a></b></b> : string</li>
+</ul>
+<a name="methods"></a>
+<h2 id="methods">Methods</h2>
+<ul>
+<li class="fn"><b><b><a href="qml-qdoc-test-doctest.html#fail-method">fail</a></b></b>(<i>message</i>)</li>
+</ul>
+<!-- $$$DocTest-description -->
+<a name="details"></a>
+<h2 id="details">Detailed Description</h2>
+<a name="introduction"></a>
+<h2 id="introduction">Introduction</h2>
+<p>A documentation test case, itself documented inline in DocTest.qml.</p>
+<!-- @@@DocTest -->
+<h2>Property Documentation</h2>
+<!-- $$$active -->
+<div class="qmlitem"><div class="qmlproto">
+<div class="table"><table class="qmlname">
+<tr valign="top" class="odd" id="">
+<td class="tblQmlPropNode"><p>
+<a name="active-prop"></a><span class="name">active</span> : <span class="type">bool</span></p></td></tr>
+</table></div>
+</div><div class="qmldoc"><p>Whether the test is active.</p>
+<p><b>See also </b><a href="qml-qdoc-test-doctest.html#name-prop">name</a>.</p>
+</div></div><!-- @@@active -->
+<br/>
+<!-- $$$name -->
+<div class="qmlitem"><div class="qmlproto">
+<div class="table"><table class="qmlname">
+<tr valign="top" class="odd" id="">
+<td class="tblQmlPropNode"><p>
+<a name="name-prop"></a><span class="name">name</span> : <span class="type">string</span></p></td></tr>
+</table></div>
+</div><div class="qmldoc"><p>Name of the test.</p>
+<pre class="qml"><span class="type"><a href="qml-qdoc-test-doctest.html">DocTest</a></span> {
+ <span class="name">name</span>: <span class="string">&quot;test&quot;</span>
+ <span class="comment">// ...</span>
+}</pre>
+</div></div><!-- @@@name -->
+<br/>
+<h2>Method Documentation</h2>
+<!-- $$$fail[overload1]$$$fail -->
+<div class="qmlitem"><div class="qmlproto">
+<div class="table"><table class="qmlname">
+<tr valign="top" class="odd" id="">
+<td class="tblQmlFuncNode"><p>
+<a name="fail-method"></a><span class="name">fail</span>(<i>message</i> = &quot;oops&quot;)</p></td></tr>
+</table></div>
+</div><div class="qmldoc"><p>Fails the current test case, with the optional <i>message</i>.</p>
+<p>This method was introduced in QDoc.Test 1.0.</p>
+</div></div><!-- @@@fail -->
+<br/>
+</body>
+</html>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-type-members.html b/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-type-members.html
new file mode 100644
index 000000000..a227cfc0a
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-type-members.html
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<!-- type.cpp -->
+ <title>List of All Members for Type | Test</title>
+</head>
+<body>
+<div class="sidebar"><div class="sidebar-content" id="sidebar-content"></div></div>
+<h1 class="title">List of All Members for Type</h1>
+<p>This is the complete list of members for <a href="qml-qdoc-test-type.html">Type</a>, including inherited members.</p>
+<ul>
+<li class="fn"><b><b><a href="qml-qdoc-test-type.html#group-prop">group</a></b></b><ul>
+<li class="fn"><b><b><a href="qml-qdoc-test-type.html#group.first-prop">group.first</a></b></b> : int</li>
+<li class="fn"><b><b><a href="qml-qdoc-test-type.html#group.second-prop">group.second</a></b></b> : int</li>
+<li class="fn"><b><b><a href="qml-qdoc-test-type.html#group.third-prop">group.third</a></b></b> : int</li>
+</ul>
+</li>
+<li class="fn"><b><b><a href="qml-qdoc-test-type.html#id-prop">id</a></b></b> : int</li>
+<li class="fn"><b><b><a href="qml-qdoc-test-type.html#name-prop">name</a></b></b> : string</li>
+<li class="fn"><b><b><a href="qml-qdoc-test-type.html#type-attached-prop">type</a></b></b> : enumeration [attached]</li>
+<li class="fn"><b><b><a href="qml-qdoc-test-type.html#completed-signal">completed</a></b></b>(<i>status</i>)</li>
+<li class="fn"><b><b><a href="qml-qdoc-test-type.html#configured-signal">configured</a></b></b>() [attached]</li>
+<li class="fn">Type <b><b><a href="qml-qdoc-test-type.html#copy-method">copy</a></b></b>(<i>a</i>)</li>
+</ul>
+</body>
+</html>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-type.html b/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-type.html
new file mode 100644
index 000000000..8bd343fa1
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-type.html
@@ -0,0 +1,141 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<!-- type.cpp -->
+ <title>Type QML Type | Test</title>
+</head>
+<body>
+<div class="sidebar">
+<div class="toc">
+<h3><a name="toc">Contents</a></h3>
+<ul>
+<li class="level1"><a href="#properties">Properties</a></li>
+<li class="level1"><a href="#attached-properties">Attached Properties</a></li>
+<li class="level1"><a href="#signals">Signals</a></li>
+<li class="level1"><a href="#attached-signals">Attached Signals</a></li>
+<li class="level1"><a href="#methods">Methods</a></li>
+<li class="level1"><a href="#details">Detailed Description</a></li>
+</ul>
+</div>
+<div class="sidebar-content" id="sidebar-content"></div></div>
+<h1 class="title">Type QML Type</h1>
+<span class="subtitle"></span>
+<!-- $$$Type-brief -->
+<p>A QML type documented in a .cpp file. <a href="#details">More...</a></p>
+<!-- @@@Type -->
+<div class="table"><table class="alignedsummary">
+<tr><td class="memItemLeft rightAlign topAlign"> Import Statement:</td><td class="memItemRight bottomAlign"> import QDoc.Test 1.1</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Instantiates:</td><td class="memItemRight bottomAlign"> <a href="qml-qdoc-test-type.html"><a href="testqdoc-test.html">Test</a></td></tr></table></div><ul>
+<li><a href="qml-qdoc-test-type-members.html">List of all members, including inherited members</a></li>
+</ul>
+<a name="properties"></a>
+<h2 id="properties">Properties</h2>
+<ul>
+<li class="fn"><b><b><a href="qml-qdoc-test-type.html#group-prop">group</a></b></b><ul>
+<li class="fn"><b><b><a href="qml-qdoc-test-type.html#group.first-prop">group.first</a></b></b> : int</li>
+<li class="fn"><b><b><a href="qml-qdoc-test-type.html#group.second-prop">group.second</a></b></b> : int</li>
+<li class="fn"><b><b><a href="qml-qdoc-test-type.html#group.third-prop">group.third</a></b></b> : int</li>
+</ul>
+</li>
+<li class="fn"><b><b><a href="qml-qdoc-test-type.html#id-prop">id</a></b></b> : int</li>
+<li class="fn"><b><b><a href="qml-qdoc-test-type.html#name-prop">name</a></b></b> : string</li>
+</ul>
+<a name="attached-properties"></a>
+<h2 id="attached-properties">Attached Properties</h2>
+<ul>
+<li class="fn"><b><b><a href="qml-qdoc-test-type.html#type-attached-prop">type</a></b></b> : enumeration</li>
+</ul>
+<a name="signals"></a>
+<h2 id="signals">Signals</h2>
+<ul>
+<li class="fn"><b><b><a href="qml-qdoc-test-type.html#completed-signal">completed</a></b></b>(<i>status</i>)</li>
+</ul>
+<a name="attached-signals"></a>
+<h2 id="attached-signals">Attached Signals</h2>
+<ul>
+<li class="fn"><b><b><a href="qml-qdoc-test-type.html#configured-signal">configured</a></b></b>()</li>
+</ul>
+<a name="methods"></a>
+<h2 id="methods">Methods</h2>
+<ul>
+<li class="fn">Type <b><b><a href="qml-qdoc-test-type.html#copy-method">copy</a></b></b>(<i>a</i>)</li>
+</ul>
+<!-- $$$Type-description -->
+<a name="details"></a>
+<h2 id="details">Detailed Description</h2>
+<!-- @@@Type -->
+<h2>Property Documentation</h2>
+<!-- $$$group -->
+<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="even" id="group-prop"><th class="centerAlign"><p><a name="group-prop"></a><b>group group</b></p></th></tr><tr valign="top" class="odd" id="group.first-prop"><td class="tblQmlPropNode"><p><a name="group.first-prop"></a><span class="name">group.first</span> : <span class="type"><a href="qml-int.html">int</a></span></p></td></tr><tr valign="top" class="odd" id="group.second-prop"><td class="tblQmlPropNode"><p><a name="group.second-prop"></a><span class="name">group.second</span> : <span class="type"><a href="qml-int.html">int</a></span></p></td></tr><tr valign="top" class="odd" id="group.third-prop"><td class="tblQmlPropNode"><p><a name="group.third-prop"></a><span class="name">group.third</span> : <span class="type"><a href="qml-int.html">int</a></span></p></td></tr></table></div></div><div class="qmldoc"><p>A property group.</p>
+</div></div><!-- @@@group -->
+<br/>
+<!-- $$$id -->
+<div class="qmlitem"><div class="qmlproto">
+<div class="table"><table class="qmlname">
+<tr valign="top" class="odd" id="">
+<td class="tblQmlPropNode"><p>
+<a name="id-prop"></a><span class="qmlreadonly">[read-only] </span><span class="name">id</span> : <span class="type"><a href="qml-int.html">int</a></span></p></td></tr>
+</table></div>
+</div><div class="qmldoc"><p>A read-only property.</p>
+</div></div><!-- @@@id -->
+<br/>
+<!-- $$$name -->
+<div class="qmlitem"><div class="qmlproto">
+<div class="table"><table class="qmlname">
+<tr valign="top" class="odd" id="">
+<td class="tblQmlPropNode"><p>
+<a name="name-prop"></a><span class="name">name</span> : <span class="type">string</span></p></td></tr>
+</table></div>
+</div><div class="qmldoc"><p>Name of the Test.</p>
+</div></div><!-- @@@name -->
+<br/>
+<h2>Attached Property Documentation</h2>
+<!-- $$$type -->
+<div class="qmlitem"><div class="qmlproto">
+<div class="table"><table class="qmlname">
+<tr valign="top" class="odd" id="">
+<td class="tblQmlPropNode"><p>
+<a name="type-attached-prop"></a><span class="name">Type.type</span> : <span class="type">enumeration</span></p></td></tr>
+</table></div>
+</div><div class="qmldoc"><div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tbldscr">Description</th></tr>
+<tr><td class="topAlign"><code>Type.NoType</code></td><td class="topAlign">Nothing</td></tr>
+<tr><td class="topAlign"><code>Type.SomeType</code></td><td class="topAlign">Something</td></tr>
+</table></div>
+</div></div><!-- @@@type -->
+<br/>
+<h2>Signal Documentation</h2>
+<!-- $$$completed[overload1]$$$completed -->
+<div class="qmlitem"><div class="qmlproto">
+<div class="table"><table class="qmlname">
+<tr valign="top" class="odd" id="">
+<td class="tblQmlFuncNode"><p>
+<a name="completed-signal"></a><span class="name">completed</span>(<i>status</i>)</p></td></tr>
+</table></div>
+</div><div class="qmldoc"><p>This signal is emitted when the operation completed with <i>status</i>.</p>
+</div></div><!-- @@@completed -->
+<br/>
+<h2>Attached Signal Documentation</h2>
+<!-- $$$configured[overload1]$$$configured -->
+<div class="qmlitem"><div class="qmlproto">
+<div class="table"><table class="qmlname">
+<tr valign="top" class="odd" id="">
+<td class="tblQmlFuncNode"><p>
+<a name="configured-signal"></a><span class="name">configured</span>()</p></td></tr>
+</table></div>
+</div><div class="qmldoc"><p>This attached signal is emitted when the type was configured.</p>
+</div></div><!-- @@@configured -->
+<br/>
+<h2>Method Documentation</h2>
+<!-- $$$copy[overload1]$$$copy -->
+<div class="qmlitem"><div class="qmlproto">
+<div class="table"><table class="qmlname">
+<tr valign="top" class="odd" id="">
+<td class="tblQmlFuncNode"><p>
+<a name="copy-method"></a><span class="type"><a href="qml-qdoc-test-type.html">Type</a></span> <span class="name">copy</span>(<i>a</i>)</p></td></tr>
+</table></div>
+</div><div class="qmldoc"><p>Returns another Type based on <i>a</i>.</p>
+</div></div><!-- @@@copy -->
+<br/>
+</body>
+</html>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/qml-uicomponents-progressbar.html b/tests/auto/qdoc/generatedoutput/expected_output/qml-uicomponents-progressbar.html
new file mode 100644
index 000000000..5a25e2ff1
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/expected_output/qml-uicomponents-progressbar.html
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<!-- ProgressBar.qml -->
+ <title>ProgressBar QML Type | Test</title>
+</head>
+<body>
+<div class="sidebar">
+<div class="toc">
+<h3><a name="toc">Contents</a></h3>
+<ul>
+<li class="level1"><a href="#properties">Properties</a></li>
+<li class="level1"><a href="#details">Detailed Description</a></li>
+</ul>
+</div>
+<div class="sidebar-content" id="sidebar-content"></div></div>
+<h1 class="title">ProgressBar QML Type</h1>
+<span class="subtitle"></span>
+<!-- $$$ProgressBar-brief -->
+<p>A component that shows the progress of an event. <a href="#details">More...</a></p>
+<!-- @@@ProgressBar -->
+<div class="table"><table class="alignedsummary">
+<tr><td class="memItemLeft rightAlign topAlign"> Import Statement:</td><td class="memItemRight bottomAlign"> import UIComponents 1.0</td></tr></table></div><ul>
+<li><a href="qml-uicomponents-progressbar-members.html">List of all members, including inherited members</a></li>
+</ul>
+<a name="properties"></a>
+<h2 id="properties">Properties</h2>
+<ul>
+<li class="fn"><b><b><a href="qml-uicomponents-progressbar.html#color-prop">color</a></b></b> : color</li>
+<li class="fn"><b><b><a href="qml-uicomponents-progressbar.html#maximum-prop">maximum</a></b></b> : int</li>
+<li class="fn"><b><b><a href="qml-uicomponents-progressbar.html#minimum-prop">minimum</a></b></b> : int</li>
+<li class="fn"><b><b><a href="qml-uicomponents-progressbar.html#secondColor-prop">secondColor</a></b></b> : color</li>
+<li class="fn"><b><b><a href="qml-uicomponents-progressbar.html#value-prop">value</a></b></b> : int</li>
+</ul>
+<!-- $$$ProgressBar-description -->
+<a name="details"></a>
+<h2 id="details">Detailed Description</h2>
+<p>A ProgressBar shows the linear progress of an event as its <a href="qml-uicomponents-progressbar.html#value-prop">value</a>. The range is specified using the <a href="qml-uicomponents-progressbar.html#minimum-prop">minimum</a> and the <a href="qml-uicomponents-progressbar.html#maximum-prop">maximum</a> values.</p>
+<p>The ProgressBar component is part of the <a href="uicomponents-qmlmodule.html">UI Components</a> module.</p>
+<p>This documentation is part of the <a href="test-componentset-example.html">UIComponents</a> example.</p>
+<!-- @@@ProgressBar -->
+<h2>Property Documentation</h2>
+<!-- $$$color -->
+<div class="qmlitem"><div class="qmlproto">
+<div class="table"><table class="qmlname">
+<tr valign="top" class="odd" id="">
+<td class="tblQmlPropNode"><p>
+<a name="color-prop"></a><span class="name">color</span> : <span class="type">color</span></p></td></tr>
+</table></div>
+</div><div class="qmldoc"><p>The color of the <a href="qml-uicomponents-progressbar.html">ProgressBar</a>'s gradient. Must bind to a color type.</p>
+<p><b>See also </b><a href="qml-uicomponents-progressbar.html#secondColor-prop">secondColor</a>.</p>
+</div></div><!-- @@@color -->
+<br/>
+<!-- $$$maximum -->
+<div class="qmlitem"><div class="qmlproto">
+<div class="table"><table class="qmlname">
+<tr valign="top" class="odd" id="">
+<td class="tblQmlPropNode"><p>
+<a name="maximum-prop"></a><span class="name">maximum</span> : <span class="type"><a href="qml-int.html">int</a></span></p></td></tr>
+</table></div>
+</div><div class="qmldoc"><p>The maximum value of the <a href="qml-uicomponents-progressbar.html">ProgressBar</a> range. The <a href="qml-uicomponents-progressbar.html#value-prop">value</a> must not be more than this value.</p>
+</div></div><!-- @@@maximum -->
+<br/>
+<!-- $$$minimum -->
+<div class="qmlitem"><div class="qmlproto">
+<div class="table"><table class="qmlname">
+<tr valign="top" class="odd" id="">
+<td class="tblQmlPropNode"><p>
+<a name="minimum-prop"></a><span class="name">minimum</span> : <span class="type"><a href="qml-int.html">int</a></span></p></td></tr>
+</table></div>
+</div><div class="qmldoc"><p>The minimum value of the <a href="qml-uicomponents-progressbar.html">ProgressBar</a> range. The <a href="qml-uicomponents-progressbar.html#value-prop">value</a> must not be less than this value.</p>
+</div></div><!-- @@@minimum -->
+<br/>
+<!-- $$$secondColor -->
+<div class="qmlitem"><div class="qmlproto">
+<div class="table"><table class="qmlname">
+<tr valign="top" class="odd" id="">
+<td class="tblQmlPropNode"><p>
+<a name="secondColor-prop"></a><span class="name">secondColor</span> : <span class="type">color</span></p></td></tr>
+</table></div>
+</div><div class="qmldoc"><p>The second color of the <a href="qml-uicomponents-progressbar.html">ProgressBar</a>'s gradient. Must bind to a color type.</p>
+<p><b>See also </b><a href="qml-uicomponents-progressbar.html#color-prop">color</a>.</p>
+</div></div><!-- @@@secondColor -->
+<br/>
+<!-- $$$value -->
+<div class="qmlitem"><div class="qmlproto">
+<div class="table"><table class="qmlname">
+<tr valign="top" class="odd" id="">
+<td class="tblQmlPropNode"><p>
+<a name="value-prop"></a><span class="name">value</span> : <span class="type"><a href="qml-int.html">int</a></span></p></td></tr>
+</table></div>
+</div><div class="qmldoc"><p>The value of the progress.</p>
+</div></div><!-- @@@value -->
+<br/>
+</body>
+</html>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/qml-uicomponents-switch.html b/tests/auto/qdoc/generatedoutput/expected_output/qml-uicomponents-switch.html
new file mode 100644
index 000000000..06d7ab184
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/expected_output/qml-uicomponents-switch.html
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<!-- Switch.qml -->
+ <title>Switch QML Type | Test</title>
+</head>
+<body>
+<div class="sidebar">
+<div class="toc">
+<h3><a name="toc">Contents</a></h3>
+<ul>
+<li class="level1"><a href="#properties">Properties</a></li>
+<li class="level1"><a href="#methods">Methods</a></li>
+<li class="level1"><a href="#details">Detailed Description</a></li>
+</ul>
+</div>
+<div class="sidebar-content" id="sidebar-content"></div></div>
+<h1 class="title">Switch QML Type</h1>
+<span class="subtitle"></span>
+<!-- $$$Switch-brief -->
+<p>A component that can be turned on or off. <a href="#details">More...</a></p>
+<!-- @@@Switch -->
+<div class="table"><table class="alignedsummary">
+<tr><td class="memItemLeft rightAlign topAlign"> Import Statement:</td><td class="memItemRight bottomAlign"> import UIComponents 1.0</td></tr></table></div><ul>
+<li><a href="qml-uicomponents-switch-members.html">List of all members, including inherited members</a></li>
+</ul>
+<a name="properties"></a>
+<h2 id="properties">Properties</h2>
+<ul>
+<li class="fn"><b><b><a href="qml-uicomponents-switch.html#on-prop">on</a></b></b> : bool</li>
+</ul>
+<a name="methods"></a>
+<h2 id="methods">Methods</h2>
+<ul>
+<li class="fn"><b><b><a href="qml-uicomponents-switch.html#toggle-method">toggle</a></b></b>()</li>
+</ul>
+<!-- $$$Switch-description -->
+<a name="details"></a>
+<h2 id="details">Detailed Description</h2>
+<p>A toggle switch has two states: an <code>on</code> and an <code>off</code> state. The <code>off</code> state is when the <a href="qml-uicomponents-switch.html#on-prop">on</a> property is set to <code>false</code>.</p>
+<p>The ToggleSwitch component is part of the <a href="uicomponents-qmlmodule.html">UI Components</a> module.</p>
+<p>This documentation is part of the <a href="test-componentset-example.html">UIComponents</a> example.</p>
+<!-- @@@Switch -->
+<h2>Property Documentation</h2>
+<!-- $$$on -->
+<div class="qmlitem"><div class="qmlproto">
+<div class="table"><table class="qmlname">
+<tr valign="top" class="odd" id="">
+<td class="tblQmlPropNode"><p>
+<a name="on-prop"></a><span class="name">on</span> : <span class="type">bool</span></p></td></tr>
+</table></div>
+</div><div class="qmldoc"><p>Indicates the state of the switch. If <code>false</code>, then the switch is in the <code>off</code> state.</p>
+</div></div><!-- @@@on -->
+<br/>
+<h2>Method Documentation</h2>
+<!-- $$$toggle[overload1]$$$toggle -->
+<div class="qmlitem"><div class="qmlproto">
+<div class="table"><table class="qmlname">
+<tr valign="top" class="odd" id="">
+<td class="tblQmlFuncNode"><p>
+<a name="toggle-method"></a><span class="name">toggle</span>()</p></td></tr>
+</table></div>
+</div><div class="qmldoc"><p>A method to toggle the switch. If the switch is <code>on</code>, the toggling it will turn it <code>off</code>. Toggling a switch in the <code>off</code> position will turn it <code>on</code>.</p>
+</div></div><!-- @@@toggle -->
+<br/>
+</body>
+</html>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/qml-uicomponents-tabwidget.html b/tests/auto/qdoc/generatedoutput/expected_output/qml-uicomponents-tabwidget.html
new file mode 100644
index 000000000..991737785
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/expected_output/qml-uicomponents-tabwidget.html
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<!-- TabWidget.qml -->
+ <title>TabWidget QML Type | Test</title>
+</head>
+<body>
+<div class="sidebar">
+<div class="toc">
+<h3><a name="toc">Contents</a></h3>
+<ul>
+<li class="level1"><a href="#properties">Properties</a></li>
+<li class="level1"><a href="#details">Detailed Description</a></li>
+<li class="level2"><a href="#adding-tabs">Adding Tabs</a></li>
+</ul>
+</div>
+<div class="sidebar-content" id="sidebar-content"></div></div>
+<h1 class="title">TabWidget QML Type</h1>
+<span class="subtitle"></span>
+<!-- $$$TabWidget-brief -->
+<p>A widget that places its children as tabs. <a href="#details">More...</a></p>
+<!-- @@@TabWidget -->
+<div class="table"><table class="alignedsummary">
+<tr><td class="memItemLeft rightAlign topAlign"> Import Statement:</td><td class="memItemRight bottomAlign"> import UIComponents 1.0</td></tr></table></div><ul>
+<li><a href="qml-uicomponents-tabwidget-members.html">List of all members, including inherited members</a></li>
+</ul>
+<a name="properties"></a>
+<h2 id="properties">Properties</h2>
+<ul>
+<li class="fn"><b><b><a href="qml-uicomponents-tabwidget.html#current-prop">current</a></b></b> : int</li>
+<li class="fn"><b><b><a href="qml-uicomponents-tabwidget.html#sampleReadOnlyProperty-prop">sampleReadOnlyProperty</a></b></b> : int</li>
+</ul>
+<!-- $$$TabWidget-description -->
+<a name="details"></a>
+<h2 id="details">Detailed Description</h2>
+<p>A TabWidget places its children as tabs in a view. Selecting a tab involves selecting the tab at the top.</p>
+<p>The TabWidget component is part of the <a href="uicomponents-qmlmodule.html">UI Components</a> module.</p>
+<p>This documentation is part of the <a href="test-componentset-example.html">UIComponents</a> example.</p>
+<a name="adding-tabs"></a>
+<h2 id="adding-tabs">Adding Tabs</h2>
+<p>To add a tab, declare the tab as a child of the TabWidget.</p>
+<pre class="cpp">TabWidget {
+ id: tabwidget
+
+ Rectangle {
+ id: tab1
+ color: <span class="string">&quot;red&quot;</span>
+ <span class="comment">//... omitted</span>
+ }
+ Rectangle {
+ id: tab2
+ color: <span class="string">&quot;blue&quot;</span>
+ <span class="comment">//... omitted</span>
+ }
+
+}</pre>
+<!-- @@@TabWidget -->
+<h2>Property Documentation</h2>
+<!-- $$$current -->
+<div class="qmlitem"><div class="qmlproto">
+<div class="table"><table class="qmlname">
+<tr valign="top" class="odd" id="">
+<td class="tblQmlPropNode"><p>
+<a name="current-prop"></a><span class="name">current</span> : <span class="type"><a href="qml-int.html">int</a></span></p></td></tr>
+</table></div>
+</div><div class="qmldoc"><p>The currently active tab in the <a href="qml-uicomponents-tabwidget.html">TabWidget</a>.</p>
+</div></div><!-- @@@current -->
+<br/>
+<!-- $$$sampleReadOnlyProperty -->
+<div class="qmlitem"><div class="qmlproto">
+<div class="table"><table class="qmlname">
+<tr valign="top" class="odd" id="">
+<td class="tblQmlPropNode"><p>
+<a name="sampleReadOnlyProperty-prop"></a><span class="qmlreadonly">[read-only] </span><span class="name">sampleReadOnlyProperty</span> : <span class="type"><a href="qml-int.html">int</a></span></p></td></tr>
+</table></div>
+</div><div class="qmldoc"><p>A sample <code>read-only</code> property. A contrived property to demonstrate QDoc's ability to detect read-only properties.</p>
+<p>The signature is:</p>
+<pre class="cpp">readonly property <span class="type"><a href="qml-int.html">int</a></span> sampleReadOnlyProperty: <span class="number">0</span></pre>
+<p>Note that the property must be initialized to a value.</p>
+</div></div><!-- @@@sampleReadOnlyProperty -->
+<br/>
+</body>
+</html>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/second.html b/tests/auto/qdoc/generatedoutput/expected_output/second.html
new file mode 100644
index 000000000..c3d76d0f8
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/expected_output/second.html
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<!-- main.cpp -->
+ <title>Second Class | TestModule</title>
+</head>
+<body>
+<li>Second</li>
+<div class="sidebar">
+<div class="toc">
+<h3><a name="toc">Contents</a></h3>
+<ul>
+<li class="level1"><a href="#details">Detailed Description</a></li>
+</ul>
+</div>
+<div class="sidebar-content" id="sidebar-content"></div></div>
+<h1 class="title">Second Class</h1>
+<div class="table"><table class="alignedsummary">
+<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign"> <span class="preprocessor">#include &lt;Second&gt;</span>
+</td></tr></table></div><ul>
+</ul>
+<a name="details"></a>
+<!-- $$$Second-description -->
+<div class="descr">
+<h2 id="details">Detailed Description</h2>
+<p>This is a second class</p>
+</div>
+<!-- @@@Second -->
+</body>
+</html>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/third.html b/tests/auto/qdoc/generatedoutput/expected_output/third.html
new file mode 100644
index 000000000..93dc5a1c1
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/expected_output/third.html
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<!-- main.cpp -->
+ <title>Third Class | TestModule</title>
+</head>
+<body>
+<li>Third</li>
+<div class="sidebar">
+<div class="toc">
+<h3><a name="toc">Contents</a></h3>
+<ul>
+<li class="level1"><a href="#details">Detailed Description</a></li>
+</ul>
+</div>
+<div class="sidebar-content" id="sidebar-content"></div></div>
+<h1 class="title">Third Class</h1>
+<div class="table"><table class="alignedsummary">
+<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign"> <span class="preprocessor">#include &lt;Third&gt;</span>
+</td></tr></table></div><ul>
+</ul>
+<a name="details"></a>
+<!-- $$$Third-description -->
+<div class="descr">
+<h2 id="details">Detailed Description</h2>
+<p>This is a third class</p>
+</div>
+<!-- @@@Third -->
+</body>
+</html>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/uicomponents-qmlmodule.html b/tests/auto/qdoc/generatedoutput/expected_output/uicomponents-qmlmodule.html
index 8c577ab7f..5aa475abc 100644
--- a/tests/auto/qdoc/generatedoutput/expected_output/uicomponents-qmlmodule.html
+++ b/tests/auto/qdoc/generatedoutput/expected_output/uicomponents-qmlmodule.html
@@ -16,5 +16,10 @@
<p>This module is part of the <a href="test-componentset-example.html">UIComponents</a> example.</p>
</div>
<!-- @@@UIComponents -->
+<div class="table"><table class="annotated">
+<tr class="odd topAlign"><td class="tblName"><p><a href="qml-uicomponents-progressbar.html">ProgressBar</a></p></td><td class="tblDescr"><p>A component that shows the progress of an event</p></td></tr>
+<tr class="even topAlign"><td class="tblName"><p><a href="qml-uicomponents-switch.html">Switch</a></p></td><td class="tblDescr"><p>A component that can be turned on or off</p></td></tr>
+<tr class="odd topAlign"><td class="tblName"><p><a href="qml-uicomponents-tabwidget.html">TabWidget</a></p></td><td class="tblDescr"><p>A widget that places its children as tabs</p></td></tr>
+</table></div>
</body>
</html>
diff --git a/tests/auto/qdoc/generatedoutput/qml/DocTest.qml b/tests/auto/qdoc/generatedoutput/qml/DocTest.qml
new file mode 100644
index 000000000..1ddafcfe4
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/qml/DocTest.qml
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+/*!
+ \qmltype DocTest
+ \inherits Test
+ \inqmlmodule QDoc.Test
+ \brief Represents a doc test case.
+ \since QDoc.Test 0.9
+
+ \section1 Introduction
+
+ A documentation test case, itself documented inline in DocTest.qml.
+*/
+Item {
+ id: testCase
+
+ /*!
+ \qmlproperty string DocTest::name
+
+ Name of the test.
+ \qml
+ DocTest {
+ name: "test"
+ // ...
+ }
+ \endqml
+ */
+ property string name
+
+ /*!
+ Whether the test is active.
+
+ \sa name
+ */
+ property bool active: true
+
+ /*! \internal */
+ property int doctest_internal: -1
+
+ /*!
+ \qmlmethod DocTest::fail(message = "oops")
+ \since QDoc.Test 1.0
+
+ Fails the current test case, with the optional \a message.
+ */
+ function fail(msg) {
+ if (msg === undefined)
+ msg = "oops";
+ }
+
+ /*! \internal */
+ function doctest_fail(msg) {
+ if (msg === undefined)
+ msg = "";
+ }
+}
diff --git a/tests/auto/qdoc/generatedoutput/componentset/ProgressBar.qml b/tests/auto/qdoc/generatedoutput/qml/componentset/ProgressBar.qml
index 2a40cc488..2a40cc488 100644
--- a/tests/auto/qdoc/generatedoutput/componentset/ProgressBar.qml
+++ b/tests/auto/qdoc/generatedoutput/qml/componentset/ProgressBar.qml
diff --git a/tests/auto/qdoc/generatedoutput/componentset/Switch.qml b/tests/auto/qdoc/generatedoutput/qml/componentset/Switch.qml
index db9616b69..db9616b69 100644
--- a/tests/auto/qdoc/generatedoutput/componentset/Switch.qml
+++ b/tests/auto/qdoc/generatedoutput/qml/componentset/Switch.qml
diff --git a/tests/auto/qdoc/generatedoutput/componentset/TabWidget.qml b/tests/auto/qdoc/generatedoutput/qml/componentset/TabWidget.qml
index 07fd40db9..07fd40db9 100644
--- a/tests/auto/qdoc/generatedoutput/componentset/TabWidget.qml
+++ b/tests/auto/qdoc/generatedoutput/qml/componentset/TabWidget.qml
diff --git a/tests/auto/qdoc/generatedoutput/componentset/componentset.pro b/tests/auto/qdoc/generatedoutput/qml/componentset/componentset.pro
index 5b44737c2..5b44737c2 100644
--- a/tests/auto/qdoc/generatedoutput/componentset/componentset.pro
+++ b/tests/auto/qdoc/generatedoutput/qml/componentset/componentset.pro
diff --git a/tests/auto/qdoc/generatedoutput/examples.qdoc b/tests/auto/qdoc/generatedoutput/qml/componentset/examples.qdoc
index 7c780eca8..7c780eca8 100644
--- a/tests/auto/qdoc/generatedoutput/examples.qdoc
+++ b/tests/auto/qdoc/generatedoutput/qml/componentset/examples.qdoc
diff --git a/tests/auto/qdoc/generatedoutput/componentset/uicomponents.qdoc.sample b/tests/auto/qdoc/generatedoutput/qml/componentset/uicomponents.qdoc.sample
index 0c6d187ed..0c6d187ed 100644
--- a/tests/auto/qdoc/generatedoutput/componentset/uicomponents.qdoc.sample
+++ b/tests/auto/qdoc/generatedoutput/qml/componentset/uicomponents.qdoc.sample
diff --git a/tests/auto/qdoc/generatedoutput/qml/parent.qdoc b/tests/auto/qdoc/generatedoutput/qml/parent.qdoc
new file mode 100644
index 000000000..e0bed66c0
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/qml/parent.qdoc
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \qmltype AbstractParent
+ \inqmlmodule QDoc.Test
+ \qmlabstract
+ \brief Abstract base QML type.
+*/
+
+/*!
+ \qmlproperty list<Child> AbstractParent::children
+ \default
+ \brief Children of the type.
+*/
+
+/*!
+ \qmlmethod void AbstractParent::rear(Child child)
+ \brief Do some abstract parenting on \a child.
+*/
+
+/*!
+ \qmltype Child
+ \inqmlmodule QDoc.Test
+ \inherits AbstractParent
+ \brief A Child inheriting its parent.
+*/
+
+/*!
+ \qmlbasictype int
+ \inqmlmodule QDoc.Test
+
+ \brief An integer basic type.
+*/
diff --git a/tests/auto/qdoc/generatedoutput/qml/type.cpp b/tests/auto/qdoc/generatedoutput/qml/type.cpp
new file mode 100644
index 000000000..db3dd1047
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/qml/type.cpp
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "testcpp.h"
+
+/*!
+ \qmlmodule QDoc.Test \QDocTestVer
+ \brief QML Types for the Test module.
+*/
+
+/*!
+ \qmltype Type
+ \instantiates TestQDoc::Test
+ \inqmlmodule QDoc.Test
+ \brief A QML type documented in a .cpp file.
+*/
+
+/*!
+ \qmlproperty int Type::id
+ \readonly
+ \brief A read-only property.
+*/
+
+/*!
+ \qmlproperty string QDoc.Test::Type::name
+ \brief Name of the Test.
+*/
+
+/*!
+ \qmlattachedproperty enumeration Type::type
+
+ \value Type.NoType
+ Nothing
+ \value Type.SomeType
+ Something
+*/
+
+/*!
+ \qmlproperty int Type::group.first
+ \qmlproperty int Type::group.second
+ \qmlproperty int Type::group.third
+
+ \brief A property group.
+*/
+
+/*!
+ \qmlmethod Type Type::copy(a)
+
+ Returns another Type based on \a a.
+*/
+
+/*!
+ \qmlsignal Type::completed(int status)
+
+ This signal is emitted when the operation completed with \a status.
+*/
+
+/*!
+ \qmlattachedsignal Type::configured()
+
+ This attached signal is emitted when the type was configured.
+*/
diff --git a/tests/auto/qdoc/generatedoutput/testqml.qdocconf b/tests/auto/qdoc/generatedoutput/testqml.qdocconf
index 769c3d627..00d12a463 100644
--- a/tests/auto/qdoc/generatedoutput/testqml.qdocconf
+++ b/tests/auto/qdoc/generatedoutput/testqml.qdocconf
@@ -1,10 +1,15 @@
+include(testcpp.qdocconf)
project = Test
description = "A test project for QDoc build artifacts"
-moduleheader=
outputdir = ./html
-exampledirs = .
-sources.fileextensions = \
- examples.qdoc
+exampledirs = qml
+
+headerdirs += .
+sourcedirs += qml
+
+sources.fileextensions = "*.qml *.cpp *.qdoc"
+headers.fileextensions = "*.h"
macro.begincomment = "\\c{/*}"
+macro.QDocTestVer = "1.1"
diff --git a/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp b/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp
index 09709ac6c..17f930981 100644
--- a/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp
+++ b/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp
@@ -40,16 +40,24 @@ private slots:
void htmlFromQDocFile();
void htmlFromCpp();
void htmlFromQml();
+ void htmlFromCppBug80259();
+
+ void webXmlFromQDocFile();
+ void webXmlFromCpp();
+ void webXmlFromQml();
+ void webXmlFromCppBug80259();
private:
QScopedPointer<QTemporaryDir> m_outputDir;
QString m_qdoc;
+ void removeFullPathStrings(QString& str);
void runQDocProcess(const QStringList &arguments);
void compareLineByLine(const QStringList &expectedFiles);
void testAndCompare(const char *input,
const char *outNames,
- const char *extraParams = nullptr);
+ const char *extraParams = nullptr,
+ const char *outputPathPrefix = nullptr);
};
void tst_generatedOutput::initTestCase()
@@ -93,6 +101,13 @@ void tst_generatedOutput::runQDocProcess(const QStringList &arguments)
QFAIL("Running QDoc failed. See output above.");
}
+void tst_generatedOutput::removeFullPathStrings(QString &str)
+{
+ QRegularExpression re("(location|path|filepath)=\"[^\"]+\"");
+ QRegularExpressionMatch match = re.match(str);
+ str.replace(re, match.captured(1) + "=\"REMOVED_BY_TEST\"");
+}
+
void tst_generatedOutput::compareLineByLine(const QStringList &expectedFiles)
{
for (const auto &file : expectedFiles) {
@@ -116,6 +131,8 @@ void tst_generatedOutput::compareLineByLine(const QStringList &expectedFiles)
QString prefix = file + delim + QString::number(lineNumber) + delim;
QString expectedLine = prefix + expectedIn.readLine();
QString actualLine = prefix + actualIn.readLine();
+ removeFullPathStrings(actualLine);
+ removeFullPathStrings(expectedLine);
QCOMPARE(actualLine, expectedLine);
}
}
@@ -123,17 +140,28 @@ void tst_generatedOutput::compareLineByLine(const QStringList &expectedFiles)
void tst_generatedOutput::testAndCompare(const char *input,
const char *outNames,
- const char *extraParams)
+ const char *extraParams,
+ const char *outputPathPrefix)
{
- QStringList args{ "-outputdir", m_outputDir->path(), QFINDTESTDATA(input) };
+ QStringList args{ "-outputdir", m_outputDir->path() + "/" + outputPathPrefix,
+ QFINDTESTDATA(input) };
if (extraParams)
args << QString(QLatin1String(extraParams)).split(QChar(' '));
+
runQDocProcess(args);
+
if (QTest::currentTestFailed())
return;
- compareLineByLine(QString(QLatin1String(outNames)).split(QChar(' ')));
+
+ QStringList expectedOuts(QString(QLatin1String(outNames)).split(QChar(' ')));
+ if (outputPathPrefix)
+ for (auto &expectedOut : expectedOuts)
+ expectedOut = QString(outputPathPrefix) + "/" + expectedOut;
+
+ compareLineByLine(expectedOuts);
}
+
void tst_generatedOutput::htmlFromQDocFile()
{
testAndCompare("test.qdocconf",
@@ -141,6 +169,13 @@ void tst_generatedOutput::htmlFromQDocFile()
"qdoctests-qdocfileoutput-linking.html");
}
+void tst_generatedOutput::webXmlFromQDocFile()
+{
+ testAndCompare("webxml_test.qdocconf",
+ "html/qdoctests-qdocfileoutput.webxml "
+ "html/qdoctests-qdocfileoutput-linking.webxml");
+}
+
void tst_generatedOutput::htmlFromCpp()
{
testAndCompare("testcpp.qdocconf",
@@ -150,11 +185,56 @@ void tst_generatedOutput::htmlFromCpp()
"testqdoc.html");
}
+
+void tst_generatedOutput::webXmlFromCpp()
+{
+ testAndCompare("webxml_testcpp.qdocconf",
+ "html/testcpp-module.webxml "
+ "html/testqdoc-test.webxml "
+ "html/testqdoc-testderived.webxml");
+}
+
+
void tst_generatedOutput::htmlFromQml()
{
testAndCompare("testqml.qdocconf",
"test-componentset-example.html "
- "uicomponents-qmlmodule.html");
+ "uicomponents-qmlmodule.html "
+ "qdoc-test-qmlmodule.html "
+ "qml-qdoc-test-abstractparent.html "
+ "qml-qdoc-test-child.html "
+ "qml-qdoc-test-doctest.html "
+ "qml-qdoc-test-type-members.html "
+ "qml-qdoc-test-type.html "
+ "qml-uicomponents-progressbar.html "
+ "qml-uicomponents-switch.html "
+ "qml-uicomponents-tabwidget.html "
+ "qml-int.html");
+}
+
+void tst_generatedOutput::webXmlFromQml()
+{
+ testAndCompare("webxml_testqml.qdocconf",
+ "html/test-componentset-example.webxml "
+ "html/uicomponents-qmlmodule.webxml");
+}
+
+void tst_generatedOutput::htmlFromCppBug80259()
+{
+ testAndCompare("bug80259/testmodule.qdocconf",
+ "first.html "
+ "second.html "
+ "third.html "
+ "index.html");
+}
+
+void tst_generatedOutput::webXmlFromCppBug80259()
+{
+ testAndCompare("bug80259/webxml_testmodule.qdocconf",
+ "html/first.webxml "
+ "html/second.webxml "
+ "html/third.webxml "
+ "html/index.webxml");
}
QTEST_APPLESS_MAIN(tst_generatedOutput)
diff --git a/tests/auto/qdoc/generatedoutput/webxml.qdocconf b/tests/auto/qdoc/generatedoutput/webxml.qdocconf
new file mode 100644
index 000000000..d6e6290b8
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/webxml.qdocconf
@@ -0,0 +1,3 @@
+outputformats = WebXML
+WebXML.quotinginformation = true
+WebXML.nosubdirs = true
diff --git a/tests/auto/qdoc/generatedoutput/webxml_test.qdocconf b/tests/auto/qdoc/generatedoutput/webxml_test.qdocconf
new file mode 100644
index 000000000..bac4f3b4e
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/webxml_test.qdocconf
@@ -0,0 +1,2 @@
+include(test.qdocconf)
+include(webxml.qdocconf)
diff --git a/tests/auto/qdoc/generatedoutput/webxml_testcpp.qdocconf b/tests/auto/qdoc/generatedoutput/webxml_testcpp.qdocconf
new file mode 100644
index 000000000..e242cef27
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/webxml_testcpp.qdocconf
@@ -0,0 +1,2 @@
+include(testcpp.qdocconf)
+include(webxml.qdocconf)
diff --git a/tests/auto/qdoc/generatedoutput/webxml_testqml.qdocconf b/tests/auto/qdoc/generatedoutput/webxml_testqml.qdocconf
new file mode 100644
index 000000000..537685700
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/webxml_testqml.qdocconf
@@ -0,0 +1,2 @@
+include(testqml.qdocconf)
+include(webxml.qdocconf)