summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Smith <msmith@trolltech.com>2009-08-04 11:30:00 (GMT)
committerMartin Smith <msmith@trolltech.com>2009-08-04 11:31:28 (GMT)
commit40d7153ad17d6eca96cb4718486e8e2654b72f00 (patch)
treefadc667efb069ec55d45ef8d3f29adb55124e98a
parentdc0088949822f846983c9a2d8f7dca59433ec555 (diff)
downloadQt-40d7153ad17d6eca96cb4718486e8e2654b72f00.zip
Qt-40d7153ad17d6eca96cb4718486e8e2654b72f00.tar.gz
Qt-40d7153ad17d6eca96cb4718486e8e2654b72f00.tar.bz2
qdoc: Added \annotated list command to qdoc3.
Now you can put "\annotatedlist xxx" anywhere in a qdoc comment, and it will generate the class list for the xxx group at that location. xxx must be a group name.
-rw-r--r--tools/qdoc3/atom.cpp2
-rw-r--r--tools/qdoc3/atom.h1
-rw-r--r--tools/qdoc3/cppcodeparser.cpp3
-rw-r--r--tools/qdoc3/doc.cpp32
-rw-r--r--tools/qdoc3/htmlgenerator.cpp14
-rw-r--r--tools/qdoc3/tree.cpp2
6 files changed, 40 insertions, 14 deletions
diff --git a/tools/qdoc3/atom.cpp b/tools/qdoc3/atom.cpp
index a82a783..da32735 100644
--- a/tools/qdoc3/atom.cpp
+++ b/tools/qdoc3/atom.cpp
@@ -93,6 +93,7 @@ QString Atom::UPPERROMAN_ ("upperroman");
\value AbstractLeft
\value AbstractRight
+ \value AnnotatedList
\value AutoLink
\value BaseName
\value BriefLeft
@@ -163,6 +164,7 @@ static const struct {
} atms[] = {
{ "AbstractLeft", Atom::AbstractLeft },
{ "AbstractRight", Atom::AbstractRight },
+ { "AnnotatedList", Atom::AnnotatedList },
{ "AutoLink", Atom::AutoLink },
{ "BaseName", Atom::BaseName },
{ "BriefLeft", Atom::BriefLeft },
diff --git a/tools/qdoc3/atom.h b/tools/qdoc3/atom.h
index 6d5af0a..941ac70 100644
--- a/tools/qdoc3/atom.h
+++ b/tools/qdoc3/atom.h
@@ -58,6 +58,7 @@ class Atom
enum Type {
AbstractLeft,
AbstractRight,
+ AnnotatedList,
AutoLink,
BaseName,
BriefLeft,
diff --git a/tools/qdoc3/cppcodeparser.cpp b/tools/qdoc3/cppcodeparser.cpp
index 4563f65..562684b 100644
--- a/tools/qdoc3/cppcodeparser.cpp
+++ b/tools/qdoc3/cppcodeparser.cpp
@@ -1724,6 +1724,9 @@ bool CppCodeParser::matchProperty(InnerNode *parent)
value = "?";
}
+ /*
+ Task 259071 requires work here. See gui/widgets/qdatetime.h, for example.
+ */
if (key == "READ")
tre->addPropertyFunction(property, value, PropertyNode::Getter);
else if (key == "WRITE")
diff --git a/tools/qdoc3/doc.cpp b/tools/qdoc3/doc.cpp
index d5aca0e..e2f3525 100644
--- a/tools/qdoc3/doc.cpp
+++ b/tools/qdoc3/doc.cpp
@@ -73,20 +73,20 @@ struct Macro
};
enum {
- CMD_A, CMD_ABSTRACT, CMD_BADCODE, CMD_BASENAME, CMD_BOLD,
- CMD_BRIEF, CMD_C, CMD_CAPTION, CMD_CHAPTER, CMD_CODE,
- CMD_CODELINE, CMD_DOTS, CMD_ELSE, CMD_ENDABSTRACT,
- CMD_ENDCHAPTER, CMD_ENDCODE, CMD_ENDFOOTNOTE, CMD_ENDIF,
- CMD_ENDLEGALESE, CMD_ENDLINK, CMD_ENDLIST, CMD_ENDOMIT,
- CMD_ENDPART, CMD_ENDQUOTATION, CMD_ENDRAW, CMD_ENDSECTION1,
- CMD_ENDSECTION2, CMD_ENDSECTION3, CMD_ENDSECTION4,
- CMD_ENDSIDEBAR, CMD_ENDTABLE, CMD_EXPIRE, CMD_FOOTNOTE,
- CMD_GENERATELIST, CMD_GRANULARITY, CMD_HEADER, CMD_I,
- CMD_IF, CMD_IMAGE, CMD_INCLUDE, CMD_INLINEIMAGE, CMD_INDEX,
- CMD_KEYWORD, CMD_L, CMD_LEGALESE, CMD_LINK, CMD_LIST,
- CMD_META, CMD_NEWCODE, CMD_O, CMD_OLDCODE, CMD_OMIT,
- CMD_OMITVALUE, CMD_OVERLOAD,
- CMD_PART, CMD_PRINTLINE, CMD_PRINTTO,
+ CMD_A, CMD_ABSTRACT, CMD_ANNOTATEDLIST, CMD_BADCODE,
+ CMD_BASENAME, CMD_BOLD, CMD_BRIEF, CMD_C, CMD_CAPTION,
+ CMD_CHAPTER, CMD_CODE, CMD_CODELINE, CMD_DOTS, CMD_ELSE,
+ CMD_ENDABSTRACT, CMD_ENDCHAPTER, CMD_ENDCODE,
+ CMD_ENDFOOTNOTE, CMD_ENDIF, CMD_ENDLEGALESE, CMD_ENDLINK,
+ CMD_ENDLIST, CMD_ENDOMIT, CMD_ENDPART, CMD_ENDQUOTATION,
+ CMD_ENDRAW, CMD_ENDSECTION1, CMD_ENDSECTION2,
+ CMD_ENDSECTION3, CMD_ENDSECTION4, CMD_ENDSIDEBAR,
+ CMD_ENDTABLE, CMD_EXPIRE, CMD_FOOTNOTE, CMD_GENERATELIST,
+ CMD_GRANULARITY, CMD_HEADER, CMD_I, CMD_IF, CMD_IMAGE,
+ CMD_INCLUDE, CMD_INLINEIMAGE, CMD_INDEX, CMD_KEYWORD,
+ CMD_L, CMD_LEGALESE, CMD_LINK, CMD_LIST, CMD_META,
+ CMD_NEWCODE, CMD_O, CMD_OLDCODE, CMD_OMIT, CMD_OMITVALUE,
+ CMD_OVERLOAD, CMD_PART, CMD_PRINTLINE, CMD_PRINTTO,
CMD_PRINTUNTIL, CMD_QUOTATION, CMD_QUOTEFILE,
CMD_QUOTEFROMFILE, CMD_QUOTEFUNCTION, CMD_RAW, CMD_ROW,
CMD_SA, CMD_SECTION1, CMD_SECTION2, CMD_SECTION3,
@@ -108,6 +108,7 @@ static struct {
} cmds[] = {
{ "a", CMD_A, 0 },
{ "abstract", CMD_ABSTRACT, 0 },
+ { "annotatedlist", CMD_ANNOTATEDLIST, 0 },
{ "badcode", CMD_BADCODE, 0 },
{ "basename", CMD_BASENAME, 0 }, // ### don't document for now
{ "bold", CMD_BOLD, 0 },
@@ -723,6 +724,9 @@ void DocParser::parse(const QString& source,
paraState = OutsidePara; // ###
}
break;
+ case CMD_ANNOTATEDLIST:
+ append(Atom::AnnotatedList, getArgument());
+ break;
case CMD_GENERATELIST:
append(Atom::GeneratedList, getArgument());
break;
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index 6590114..425c50b 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -537,6 +537,20 @@ int HtmlGenerator::generateAtom(const Atom *atom,
out() << formattingRightMap()[atom->string()];
}
break;
+ case Atom::AnnotatedList:
+ {
+ const FakeNode *fake = static_cast<const FakeNode *>(relative);
+ if (fake && !fake->groupMembers().isEmpty()) {
+ QList<Node*> values = tre->groups().values(atom->string());
+ QMap<QString, const Node*> nodeMap;
+ for (int i = 0; i < values.size(); ++i) {
+ const Node* n = values.at(i);
+ nodeMap.insert(n->name(),n);
+ }
+ generateAnnotatedList(fake, marker, nodeMap);
+ }
+ }
+ break;
case Atom::GeneratedList:
if (atom->string() == "annotatedclasses") {
generateAnnotatedList(relative, marker, nonCompatClasses);
diff --git a/tools/qdoc3/tree.cpp b/tools/qdoc3/tree.cpp
index e6dd084..d75af70 100644
--- a/tools/qdoc3/tree.cpp
+++ b/tools/qdoc3/tree.cpp
@@ -419,6 +419,8 @@ void Tree::addPropertyFunction(PropertyNode *property,
}
/*!
+ This function adds the \a node to the \a group. The group
+ can be listed anywhere using the \e{annotated list} command.
*/
void Tree::addToGroup(Node *node, const QString &group)
{