summaryrefslogtreecommitdiffstats
path: root/tools/qdoc3
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2009-09-29 04:09:01 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2009-09-29 04:09:01 (GMT)
commit575ad2c60482b279f828cfa87186b5fbb10f76c6 (patch)
tree101df52cd4b769dc8d10ef60714f25d819636e70 /tools/qdoc3
parenta913e326409062bbc1cad4d5898181c7b81cba23 (diff)
parent638f46a96b68d21137c4903c68015752ebdf58dc (diff)
downloadQt-575ad2c60482b279f828cfa87186b5fbb10f76c6.zip
Qt-575ad2c60482b279f828cfa87186b5fbb10f76c6.tar.gz
Qt-575ad2c60482b279f828cfa87186b5fbb10f76c6.tar.bz2
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into kinetic-declarativeui
Conflicts: configure.exe mkspecs/features/qt.prf
Diffstat (limited to 'tools/qdoc3')
-rw-r--r--tools/qdoc3/atom.cpp2
-rw-r--r--tools/qdoc3/atom.h4
-rw-r--r--tools/qdoc3/doc.cpp23
-rw-r--r--tools/qdoc3/generator.cpp9
-rw-r--r--tools/qdoc3/htmlgenerator.cpp64
-rw-r--r--tools/qdoc3/htmlgenerator.h3
-rw-r--r--tools/qdoc3/main.cpp1
-rw-r--r--tools/qdoc3/test/macros.qdocconf5
-rw-r--r--tools/qdoc3/test/qt-build-docs.qdocconf2
-rw-r--r--tools/qdoc3/test/qt-cpp-ignore.qdocconf1
-rw-r--r--tools/qdoc3/test/qt.qdocconf2
11 files changed, 98 insertions, 18 deletions
diff --git a/tools/qdoc3/atom.cpp b/tools/qdoc3/atom.cpp
index 69204d4..834a5d7 100644
--- a/tools/qdoc3/atom.cpp
+++ b/tools/qdoc3/atom.cpp
@@ -143,6 +143,7 @@ QString Atom::UPPERROMAN_ ("upperroman");
\value SectionHeadingRight
\value SidebarLeft
\value SidebarRight
+ \value SinceList
\value String
\value TableLeft
\value TableRight
@@ -220,6 +221,7 @@ static const struct {
{ "SectionHeadingRight", Atom::SectionHeadingRight },
{ "SidebarLeft", Atom::SidebarLeft },
{ "SidebarRight", Atom::SidebarRight },
+ { "SinceList", Atom::SinceList },
{ "SnippetCommand", Atom::SnippetCommand },
{ "SnippetIdentifier", Atom::SnippetIdentifier },
{ "SnippetLocation", Atom::SnippetLocation },
diff --git a/tools/qdoc3/atom.h b/tools/qdoc3/atom.h
index 95faa8f..99f9b57 100644
--- a/tools/qdoc3/atom.h
+++ b/tools/qdoc3/atom.h
@@ -112,7 +112,9 @@ class Atom
SectionRight,
SectionHeadingLeft,
SectionHeadingRight,
- SidebarLeft, SidebarRight,
+ SidebarLeft,
+ SidebarRight,
+ SinceList,
SnippetCommand,
SnippetIdentifier,
SnippetLocation,
diff --git a/tools/qdoc3/doc.cpp b/tools/qdoc3/doc.cpp
index b918fa5..c202d71 100644
--- a/tools/qdoc3/doc.cpp
+++ b/tools/qdoc3/doc.cpp
@@ -90,10 +90,10 @@ enum {
CMD_PRINTUNTIL, CMD_QUOTATION, CMD_QUOTEFILE,
CMD_QUOTEFROMFILE, CMD_QUOTEFUNCTION, CMD_RAW, CMD_ROW,
CMD_SA, CMD_SECTION1, CMD_SECTION2, CMD_SECTION3,
- CMD_SECTION4, CMD_SIDEBAR, CMD_SKIPLINE, CMD_SKIPTO,
- CMD_SKIPUNTIL, CMD_SNIPPET, CMD_SUB, CMD_SUP, CMD_TABLE,
- CMD_TABLEOFCONTENTS, CMD_TARGET, CMD_TT, CMD_UNDERLINE,
- CMD_UNICODE, CMD_VALUE, CMD_WARNING,
+ CMD_SECTION4, CMD_SIDEBAR, CMD_SINCELIST, CMD_SKIPLINE,
+ CMD_SKIPTO, CMD_SKIPUNTIL, CMD_SNIPPET, CMD_SUB, CMD_SUP,
+ CMD_TABLE, CMD_TABLEOFCONTENTS, CMD_TARGET, CMD_TT,
+ CMD_UNDERLINE, CMD_UNICODE, CMD_VALUE, CMD_WARNING,
#ifdef QDOC_QML
CMD_QML, CMD_ENDQML, CMD_CPP, CMD_ENDCPP, CMD_QMLTEXT,
CMD_ENDQMLTEXT, CMD_CPPTEXT, CMD_ENDCPPTEXT,
@@ -177,6 +177,7 @@ static struct {
{ "section3", CMD_SECTION3, 0 },
{ "section4", CMD_SECTION4, 0 },
{ "sidebar", CMD_SIDEBAR, 0 }, // ### don't document for now
+ { "sincelist", CMD_SINCELIST, 0 },
{ "skipline", CMD_SKIPLINE, 0 },
{ "skipto", CMD_SKIPTO, 0 },
{ "skipuntil", CMD_SKIPUNTIL, 0 },
@@ -727,6 +728,9 @@ void DocParser::parse(const QString& source,
case CMD_ANNOTATEDLIST:
append(Atom::AnnotatedList, getArgument());
break;
+ case CMD_SINCELIST:
+ append(Atom::SinceList, getArgument());
+ break;
case CMD_GENERATELIST:
append(Atom::GeneratedList, getArgument());
break;
@@ -2664,13 +2668,18 @@ Text Doc::trimmedBriefText(const QString &className) const
standardWording = false;
}
- if (!w.isEmpty() && (w.first() == "class" || w.first() == "widget"
- || w.first() == "namespace" || w.first() == "header"))
+ if (!w.isEmpty() && ((w.first() == "class") ||
+ (w.first() == "function") ||
+ (w.first() == "macro") ||
+ (w.first() == "widget") ||
+ (w.first() == "namespace") ||
+ (w.first() == "header")))
w.removeFirst();
else {
location().warning(
tr("Nonstandard wording in '\\%1' text for '%2' ("
- "expected 'class', 'widget', 'namespace' or 'header')")
+ "expected 'class', 'function', 'macro', 'widget', "
+ "'namespace' or 'header')")
.arg(COMMAND_BRIEF).arg(className));
standardWording = false;
}
diff --git a/tools/qdoc3/generator.cpp b/tools/qdoc3/generator.cpp
index 2d03860..47fe4b5 100644
--- a/tools/qdoc3/generator.cpp
+++ b/tools/qdoc3/generator.cpp
@@ -562,24 +562,21 @@ void Generator::generateModuleWarning(const ClassNode *classe,
QString module = classe->moduleName();
if (!module.isEmpty()) {
Text text;
- if (Tokenizer::isTrue("defined(consoleedition)")
- && !editionModuleMap["Console"].contains(module)) {
+ if (!editionModuleMap["Console"].contains(module)) {
text << Atom::ParaLeft
<< Atom(Atom::FormattingLeft, ATOM_FORMATTING_BOLD)
<< "This class is not part of the Qt Console Edition."
<< Atom(Atom::FormattingRight, ATOM_FORMATTING_BOLD)
<< Atom::ParaRight;
}
- else if (Tokenizer::isTrue("defined(desktoplightedition)")
- && !editionModuleMap["DesktopLight"].contains(module)) {
+ else if (!editionModuleMap["DesktopLight"].contains(module)) {
text << Atom::ParaLeft
<< Atom(Atom::FormattingLeft, ATOM_FORMATTING_BOLD)
<< "This class is not part of the Qt Desktop Light Edition."
<< Atom(Atom::FormattingRight, ATOM_FORMATTING_BOLD)
<< Atom::ParaRight;
}
- else if (module == "Qt3Support" &&
- Tokenizer::isTrue("defined(opensourceedition)")) {
+ else if (module == "Qt3Support") {
text << Atom::ParaLeft
<< Atom(Atom::FormattingLeft, ATOM_FORMATTING_BOLD)
<< "Note to Qt Desktop Light Edition users:"
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index b7ed702..5406017 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -330,6 +330,7 @@ void HtmlGenerator::generateTree(const Tree *tree, CodeMarker *marker)
#ifdef ZZZ_QDOC_QML
findAllQmlClasses(tree->root());
#endif
+ findAllSince(tree->root(),tree->version());
PageGenerator::generateTree(tree, marker);
@@ -539,7 +540,6 @@ int HtmlGenerator::generateAtom(const Atom *atom,
break;
case Atom::AnnotatedList:
{
- //qDebug() << "ANNOTATED LIS:";
QList<Node*> values = tre->groups().values(atom->string());
QMap<QString, const Node*> nodeMap;
for (int i = 0; i < values.size(); ++i) {
@@ -653,7 +653,26 @@ int HtmlGenerator::generateAtom(const Atom *atom,
}
}
break;
- case Atom::Image:
+ case Atom::SinceList:
+ {
+ QList<Node*> values;
+ if (atom->string() == "classes") {
+ values = sinceClasses.values();
+ }
+ else if (atom->string() == "functions") {
+ values = sinceFunctions.values();
+ }
+ if (!values.isEmpty()) {
+ QMap<QString, const Node*> nodeMap;
+ for (int i=0; i<values.size(); ++i) {
+ const Node* n = values.at(i);
+ nodeMap.insert(n->nameForLists(),n);
+ }
+ generateAnnotatedList(relative, marker, nodeMap);
+ }
+ }
+ break;
+case Atom::Image:
case Atom::InlineImage:
{
QString fileName = imageFileName(relative, atom->string());
@@ -1475,7 +1494,7 @@ void HtmlGenerator::generateHeader(const QString& title,
if ((project != "Qtopia") && (project != "Qt Extended")) {
shortVersion = project + " " + shortVersion + ": ";
if (node && !node->doc().location().isEmpty())
- out() << "<!-- " << node->doc().location().filePath() << " -->\n";
+ out() << "<!-- " << node->doc().location().fileName() << " -->\n";
shortVersion = tre->version();
if (shortVersion.count(QChar('.')) == 2)
@@ -3495,6 +3514,45 @@ void HtmlGenerator::findAllClasses(const InnerNode *node)
}
}
+/*!
+ For generating the "Since x.y" page.
+ */
+void HtmlGenerator::findAllSince(const InnerNode *node, QString version)
+{
+ const QRegExp versionSeparator("[\\-\\.]");
+ const int minorIndex = version.indexOf(versionSeparator);
+ const int patchIndex = version.indexOf(versionSeparator, minorIndex+1);
+ version = version.left(patchIndex);
+
+ NodeList::const_iterator c = node->childNodes().constBegin();
+ while (c != node->childNodes().constEnd()) {
+ if (((*c)->access() != Node::Private) && ((*c)->since() == version)) {
+ if ((*c)->type() == Node::Function) {
+ FunctionNode *func = static_cast<FunctionNode *>(*c);
+ if ((func->status() > Node::Obsolete) &&
+ (func->metaness() != FunctionNode::Ctor) &&
+ (func->metaness() != FunctionNode::Dtor)) {
+ sinceFunctions.insert(func->name(), func);
+ }
+ }
+ else if ((*c)->url().isEmpty()) {
+ if ((*c)->type() == Node::Class && !(*c)->doc().isEmpty()) {
+ QString className = (*c)->name();
+ if ((*c)->parent() &&
+ (*c)->parent()->type() == Node::Namespace &&
+ !(*c)->parent()->name().isEmpty())
+ className = (*c)->parent()->name()+"::"+className;
+ sinceClasses.insert(className, *c);
+ }
+ }
+ if ((*c)->isInnerNode()) {
+ findAllSince(static_cast<InnerNode *>(*c),version);
+ }
+ }
+ ++c;
+ }
+}
+
void HtmlGenerator::findAllFunctions(const InnerNode *node)
{
NodeList::ConstIterator c = node->childNodes().begin();
diff --git a/tools/qdoc3/htmlgenerator.h b/tools/qdoc3/htmlgenerator.h
index fabe585..24e2986 100644
--- a/tools/qdoc3/htmlgenerator.h
+++ b/tools/qdoc3/htmlgenerator.h
@@ -216,6 +216,7 @@ class HtmlGenerator : public PageGenerator
#ifdef ZZZ_QDOC_QML
void findAllQmlClasses(const InnerNode *node);
#endif
+ void findAllSince(const InnerNode *node, QString version);
static int hOffset(const Node *node);
static bool isThreeColumnEnumValueTable(const Atom *atom);
virtual QString getLink(const Atom *atom,
@@ -285,6 +286,8 @@ class HtmlGenerator : public PageGenerator
#endif
QMap<QString, QMap<QString, const Node *> > funcIndex;
QMap<Text, const Node *> legaleseTexts;
+ QMap<QString, Node*> sinceClasses;
+ QMap<QString, Node*> sinceFunctions;
};
#define HTMLGENERATOR_ADDRESS "address"
diff --git a/tools/qdoc3/main.cpp b/tools/qdoc3/main.cpp
index aac4ee8..8658428 100644
--- a/tools/qdoc3/main.cpp
+++ b/tools/qdoc3/main.cpp
@@ -336,7 +336,6 @@ static void processQdocconfFile(const QString &fileName)
/*
Generate the XML tag file, if it was requested.
*/
-
QString tagFile = config.getString(CONFIG_TAGFILE);
if (!tagFile.isEmpty())
tree->generateTagFile(tagFile);
diff --git a/tools/qdoc3/test/macros.qdocconf b/tools/qdoc3/test/macros.qdocconf
index f7dcdc0..dbb8ab8 100644
--- a/tools/qdoc3/test/macros.qdocconf
+++ b/tools/qdoc3/test/macros.qdocconf
@@ -28,3 +28,8 @@ macro.begincomment = "\\c{/*}"
macro.endcomment = "\\c{*/}"
macro.uuml.HTML = "&uuml;"
macro.mdash.HTML = "&mdash;"
+
+macro.beginfloatleft.HTML = "<div style=\"float: left; margin-right: 2em\">"
+macro.beginfloatright.HTML = "<div style=\"float: right; margin-left: 2em\">"
+macro.endfloat.HTML = "</div>"
+macro.clearfloat.HTML = "<div style=\"clear: both\">"
diff --git a/tools/qdoc3/test/qt-build-docs.qdocconf b/tools/qdoc3/test/qt-build-docs.qdocconf
index deaf8a8..c0b8334 100644
--- a/tools/qdoc3/test/qt-build-docs.qdocconf
+++ b/tools/qdoc3/test/qt-build-docs.qdocconf
@@ -112,3 +112,5 @@ imagedirs = $QT_SOURCE_TREE/doc/src/images \
outputdir = $QT_BUILD_TREE/doc/html
tagfile = $QT_BUILD_TREE/doc/html/qt.tags
base = file:$QT_BUILD_TREE/doc/html
+
+HTML.generatemacrefs = "true"
diff --git a/tools/qdoc3/test/qt-cpp-ignore.qdocconf b/tools/qdoc3/test/qt-cpp-ignore.qdocconf
index 5be9fa5..dcf33dc 100644
--- a/tools/qdoc3/test/qt-cpp-ignore.qdocconf
+++ b/tools/qdoc3/test/qt-cpp-ignore.qdocconf
@@ -26,6 +26,7 @@ Cpp.ignoretokens = QAXFACTORY_EXPORT \
QT_WIDGET_PLUGIN_EXPORT \
Q_COMPAT_EXPORT \
Q_CORE_EXPORT \
+ Q_CORE_EXPORT_INLINE \
Q_EXPLICIT \
Q_EXPORT \
Q_EXPORT_CODECS_CN \
diff --git a/tools/qdoc3/test/qt.qdocconf b/tools/qdoc3/test/qt.qdocconf
index 7bd4e52..9b5937d 100644
--- a/tools/qdoc3/test/qt.qdocconf
+++ b/tools/qdoc3/test/qt.qdocconf
@@ -114,3 +114,5 @@ imagedirs = $QTDIR/doc/src/images \
outputdir = $QTDIR/doc/html
tagfile = $QTDIR/doc/html/qt.tags
base = file:$QTDIR/doc/html
+
+HTML.generatemacrefs = "true"