From f803b62b4526f0f81693a59bdf4b07e36f3900c9 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 13 Jan 2011 10:14:15 +0100 Subject: qdoc: Added the \caption command. And removed some \raw cases. Only 13 raw-html uses remaining. Added the figCaption clause to style.css. --- doc/src/template/style/style.css | 17 ++++++++++++----- src/gui/dialogs/qabstractprintdialog.cpp | 18 +++++------------- src/gui/widgets/qmenu.cpp | 7 +++---- tools/qdoc3/ditaxmlgenerator.cpp | 6 ++++++ tools/qdoc3/ditaxmlgenerator.h | 1 + tools/qdoc3/doc.cpp | 2 +- tools/qdoc3/htmlgenerator.cpp | 17 +++++++++++++++-- 7 files changed, 43 insertions(+), 25 deletions(-) diff --git a/doc/src/template/style/style.css b/doc/src/template/style/style.css index 5f60199..de9e76c 100755 --- a/doc/src/template/style/style.css +++ b/doc/src/template/style/style.css @@ -135,10 +135,11 @@ font-size: 11px; margin-bottom: 25px; } - pre.highlightedCode { - display: block; - overflow:hidden; - } + pre.highlightedCode + { + display: block; + overflow:hidden; + } thead { margin-top: 5px; @@ -283,7 +284,13 @@ background: #c0c0c0; color: #000000; } - + .figCaption + { + color:#363534; + font:italic 11px/1.2 Verdana; + text-align: center; + padding-top:0; + } span.comment { color: #008B00; diff --git a/src/gui/dialogs/qabstractprintdialog.cpp b/src/gui/dialogs/qabstractprintdialog.cpp index 641419f..7e0b924 100644 --- a/src/gui/dialogs/qabstractprintdialog.cpp +++ b/src/gui/dialogs/qabstractprintdialog.cpp @@ -381,19 +381,11 @@ void QAbstractPrintDialogPrivate::setPrinter(QPrinter *newPrinter) If the dialog is accepted by the user, the QPrinter object is correctly configured for printing. - \raw HTML - - -
- \endraw - \inlineimage plastique-printdialog.png - \raw HTML - - \endraw - \inlineimage plastique-printdialog-properties.png - \raw HTML -
- \endraw + \table + \row + \o \inlineimage plastique-printdialog.png + \o \inlineimage plastique-printdialog-properties.png + \endtable The printer dialog (shown above in Plastique style) enables access to common printing properties. On X11 platforms that use the CUPS printing system, the diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp index 56ca004..9c8ddbb 100644 --- a/src/gui/widgets/qmenu.cpp +++ b/src/gui/widgets/qmenu.cpp @@ -1247,16 +1247,15 @@ void QMenu::initStyleOption(QStyleOptionMenuItem *option, const QAction *action) response to button presses; these are just like context menus except for how they are invoked. - \table + \table 100% \row \o \inlineimage plastique-menu.png \o \inlineimage windowsxp-menu.png \o \inlineimage macintosh-menu.png - \row - \o {3,1} A menu shown in \l{Plastique Style Widget Gallery}{Plastique widget style}, + \endtable + \caption Fig. A menu shown in \l{Plastique Style Widget Gallery}{Plastique widget style}, \l{Windows XP Style Widget Gallery}{Windows XP widget style}, and \l{Macintosh Style Widget Gallery}{Macintosh widget style}. - \endtable \section1 Actions diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index e99af42..24ecea5 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -225,6 +225,7 @@ QString DitaXmlGenerator::ditaTags[] = "tgroup", "thead", "title", + "tm", "topic", "topicmeta", "topicref", @@ -1293,6 +1294,11 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, writeCharacters("*"); writeEndTag(); // } + else if (atom->string() == "®") { + writeStartTag(DT_tm); + xmlWriter().writeAttribute("tmtype","reg"); + writeEndTag(); // + } else { writeStartTag(DT_pre); xmlWriter().writeAttribute("outputclass","raw-html"); diff --git a/tools/qdoc3/ditaxmlgenerator.h b/tools/qdoc3/ditaxmlgenerator.h index 599844f..785b10a 100644 --- a/tools/qdoc3/ditaxmlgenerator.h +++ b/tools/qdoc3/ditaxmlgenerator.h @@ -216,6 +216,7 @@ class DitaXmlGenerator : public PageGenerator DT_tgroup, DT_thead, DT_title, + DT_tm, DT_topic, DT_topicmeta, DT_topicref, diff --git a/tools/qdoc3/doc.cpp b/tools/qdoc3/doc.cpp index f7f537c..b7dba8a 100644 --- a/tools/qdoc3/doc.cpp +++ b/tools/qdoc3/doc.cpp @@ -541,7 +541,7 @@ void DocParser::parse(const QString& source, break; case CMD_CAPTION: leavePara(); - /* ... */ + enterPara(Atom::CaptionLeft, Atom::CaptionRight); break; case CMD_CHAPTER: startSection(Doc::Chapter, cmd); diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 1ddc0b9..7b6ec16 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -482,6 +482,17 @@ int HtmlGenerator::generateAtom(const Atom *atom, } out() << formattingRightMap()[ATOM_FORMATTING_TELETYPE]; break; + case Atom::CaptionLeft: + out() << "

"; + in_para = true; + break; + case Atom::CaptionRight: + endLink(); + if (in_para) { + out() << "" << trimmedTrailing(highlightedCode(indent(codeIndent,atom->string()), @@ -1063,8 +1074,10 @@ int HtmlGenerator::generateAtom(const Atom *atom, in_para = false; } if (!atom->string().isEmpty()) { - if (atom->string().contains("%")) - out() << "\n "; // width=\"" << atom->string() << "\">\n "; + if (atom->string().contains("%")) { + out() << "
string() << "\">\n "; + } else { out() << "
\n"; } -- cgit v0.12