From a26c1cbe326f59162cd6549b8da479c4a7f198da Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Thu, 30 Apr 2009 16:18:50 +1000 Subject: Documentation work. --- doc/src/declarative/basictypes.qdoc | 210 +++++++-------------------------- doc/src/declarative/elements.qdoc | 4 +- doc/src/declarative/index.qdoc | 2 +- doc/src/declarative/qtprogrammers.qdoc | 2 +- doc/src/declarative/tutorial3.qdoc | 2 +- src/declarative/fx/qfxgridview.cpp | 6 +- src/declarative/fx/qfximage.cpp | 2 +- src/declarative/fx/qfxitem.cpp | 2 +- src/declarative/fx/qfxlistview.cpp | 8 +- src/declarative/fx/qfxpathview.cpp | 4 +- src/declarative/fx/qfxtext.cpp | 50 ++++---- tools/qdoc3/test/classic.css | 49 ++++---- tools/qmlviewer/qmlviewer.cpp | 2 +- 13 files changed, 111 insertions(+), 232 deletions(-) diff --git a/doc/src/declarative/basictypes.qdoc b/doc/src/declarative/basictypes.qdoc index a6b9177..0000c37 100644 --- a/doc/src/declarative/basictypes.qdoc +++ b/doc/src/declarative/basictypes.qdoc @@ -1,20 +1,16 @@ /*! - \page basicxmltypes.html + \page basicqmltypes.html \title Common QML Types QML uses a range of property types, which you will see referenced throughout the element documentation. Almost all of them are exactly what you would expect. - \target basicxmlint + \target basicqmlint \raw HTML -
-
- - +
int
+
int
-
-
\endraw ints are whole numbers - things like 0, 10 and -20. The possible int @@ -30,25 +26,16 @@ \endcode - \raw HTML -
-
- \endraw - - \target basicxmlbool + \target basicqmlbool \raw HTML
-
-
- - +
bool
+
bool
-
-
\endraw bools are a binary true/false value, represented by the strings - "true" and "false" in XML. + "true" and "false" in QML. Setting bools looks like this: \code @@ -58,21 +45,12 @@ \note Technically bool treats an empty string, "false" and "0" as false and everything else as true. Seriously, though, use "true" and "false". - \raw HTML -
-
- \endraw - - \target basicxmlreal + \target basicqmlreal \raw HTML
-
-
- - +
real
+
real
-
-
\endraw reals are numbers - either whole numbers like ints, or fractional numbers @@ -85,21 +63,12 @@ \note In QML all reals are stored in single precision, \l {http://en.wikipedia.org/wiki/IEEE_754}{IEEE floating point} format. - \raw HTML -
-
- \endraw - - \target basicxmlstring + \target basicqmlstring \raw HTML
-
-
- - +
string
+
string
-
-
\endraw strings are free form text, like "hello world", "QML is cool" and @@ -111,20 +80,14 @@ \endcode \raw HTML -
-
\endraw - \target basicxmlcolor + \target basicqmlcolor \raw HTML
-
-
- - +
color
+
color
-
-
\endraw Colors are most commonly specified as an \l {http://www.w3.org/TR/SVG/types.html#ColorKeywords}{SVG color name}. These names include colors like @@ -143,21 +106,12 @@ \endcode - \raw HTML -
-
- \endraw - - \target basicxmlpoint + \target basicqmlpoint \raw HTML
-
-
- - +
point
+
point
-
-
\endraw Points are specified in \c "x,y" format. @@ -167,21 +121,12 @@ \endcode - \raw HTML -
-
- \endraw - - \target basicxmlsize + \target basicqmlsize \raw HTML
-
-
- - +
size
+
size
-
-
\endraw Sizes are specified in \c "widthxheight" format. @@ -191,21 +136,12 @@ \endcode - \raw HTML -
-
- \endraw - - \target basicxmlrectangle + \target basicqmlrectangle \raw HTML
-
-
- - +
rectangle
+
rectangle
-
-
\endraw Rectangles are specified in \c "x,y,widthxheight" format. @@ -215,21 +151,12 @@ \endcode - \raw HTML -
-
- \endraw - - \target basicxmldate + \target basicqmldate \raw HTML
-
-
- - +
date
+
date
-
-
\endraw Dates are specified in \c "YYYY-MM-DD" format. @@ -239,21 +166,12 @@ \endcode - \raw HTML -
-
- \endraw - - \target basicxmltime + \target basicqmltime \raw HTML
-
-
- - +
time
+
time
-
-
\endraw Times are specified in \c "hh:mm:ss" format. @@ -263,21 +181,12 @@ \endcode - \raw HTML -
-
- \endraw - - \target basicxmlfont + \target basicqmlfont \raw HTML
-
-
- - +
font
+
font
-
-
\endraw The font type has components: @@ -293,21 +202,12 @@ \endcode - \raw HTML -
-
- \endraw - - \target basicxmlaction + \target basicqmlaction \raw HTML
-
-
- - +
action
+
action
-
-
\endraw The action type has all the properties of QAction, in particular: @@ -325,42 +225,24 @@ \endcode - \raw HTML -
-
- \endraw - - \target basicxmlany + \target basicqmlany \raw HTML
-
-
- - +
any
+
any
-
-
\endraw The any type can accept any basic type, object or list. Generally this is only used in very special cases. The documentation for elements that use the any type will explain the constraints in that particular case. - \raw HTML -
-
- \endraw - - \target basicxmllist + \target basicqmllist \raw HTML
-
-
- - +
Lists
+
Lists
-
-
\endraw While not technically a basic type, QML also supports lists of object @@ -380,8 +262,4 @@ \endcode \c child1, \c child2 and \c child3 will all be added to the children list in the order in which they appear. - \raw HTML -
-
- \endraw */ diff --git a/doc/src/declarative/elements.qdoc b/doc/src/declarative/elements.qdoc index 8955587..3e88e5a 100644 --- a/doc/src/declarative/elements.qdoc +++ b/doc/src/declarative/elements.qdoc @@ -7,7 +7,7 @@ The following table lists the Qml elements provided by the Qt Declarative module \bold {Standard Qt Declarative Elements} -\table +\table 100% \header \o \bold {States} \o \bold {Animation and Transitions} @@ -51,7 +51,7 @@ The following table lists the Qml elements provided by the Qt Declarative module \bold {Fluid UI Primitives} -\table +\table 100% \header \o \bold {Basic Items} \o \bold {Utility} diff --git a/doc/src/declarative/index.qdoc b/doc/src/declarative/index.qdoc index 22195ba..b5e9001 100644 --- a/doc/src/declarative/index.qdoc +++ b/doc/src/declarative/index.qdoc @@ -13,7 +13,7 @@ user-interfaces. Building fluid applications is done declaratively, rather than procedurally. That is, you specify \e what the UI should look like and how it should behave -in an XML-based format called QML instead of specifying step-by-step \e how to +in an declarative format called QML instead of specifying step-by-step \e how to build it in a language like C++ or JavaScript. Specifying a UI declaratively does not just include the layout of the interface items, but also the way each individual item looks and behaves and the overall flow of the application. diff --git a/doc/src/declarative/qtprogrammers.qdoc b/doc/src/declarative/qtprogrammers.qdoc index 92caa3f..b63ebbb 100644 --- a/doc/src/declarative/qtprogrammers.qdoc +++ b/doc/src/declarative/qtprogrammers.qdoc @@ -14,7 +14,7 @@ an application with a UI defined in QML also uses Qt for all the non-UI logic. QML provides direct access to the following concepts from Qt: \list - \o QAction - the \l {basicxmlaction}{action} type + \o QAction - the \l {basicqmlaction}{action} type \o QObject signals and slots - available as functions to call in JavaScript \o QObject properties - available as variables in JavaScript \o QWidget - QFxView is a QML-displaying widget diff --git a/doc/src/declarative/tutorial3.qdoc b/doc/src/declarative/tutorial3.qdoc index 91ab9f0..533e179 100644 --- a/doc/src/declarative/tutorial3.qdoc +++ b/doc/src/declarative/tutorial3.qdoc @@ -52,7 +52,7 @@ Here is the QML code: \endcode -First, we create a new state \e down for our text element. This state will be activated when \l {xmlMouseRegion}{MouseRegion} is pressed, and deactivated when it is released. +First, we create a new state \e down for our text element. This state will be activated when MouseRegion is pressed, and deactivated when it is released. The \e down state includes a set of property changes from our implicit \e {default state} (the items as they were initially defined in the QML). Specifically, we set the \c y property of the text to 160 and the \c color to red. diff --git a/src/declarative/fx/qfxgridview.cpp b/src/declarative/fx/qfxgridview.cpp index c8b8d27..b8acea2 100644 --- a/src/declarative/fx/qfxgridview.cpp +++ b/src/declarative/fx/qfxgridview.cpp @@ -650,12 +650,12 @@ void QFxGridViewPrivate::updateCurrent(int modelIndex) \brief The GridView element provides a grid view of items provided by a model. The model is typically provided by a QAbstractListModel "C++ model object", - but can also be created directly in XML. + but can also be created directly in QML. The items are laid out top to bottom (vertically) or left to right (horizontally) and may be flicked to scroll. - The below example creates a very simple grid, using an XML model. + The below example creates a very simple grid, using a QML model. \code @@ -706,7 +706,7 @@ QFxGridView::~QFxGridView() The C++ model object must be a \l QListModelInterface subclass, a \l VisualModel, or a simple list. - Models can also be created directly in XML, using the \l ListModel element. For example: + Models can also be created directly in QML, using the \l ListModel element. For example: \code diff --git a/src/declarative/fx/qfximage.cpp b/src/declarative/fx/qfximage.cpp index a34cd12..74ba8b8 100644 --- a/src/declarative/fx/qfximage.cpp +++ b/src/declarative/fx/qfximage.cpp @@ -135,7 +135,7 @@ QFxImage::~QFxImage() This property contains the image currently being displayed by this item, which may be an empty pixmap if nothing is currently displayed. If this property is set, the src property will be unset. This property is intended - to be used only in C++, not in XML. + to be used only in C++, not in QML. */ QPixmap QFxImage::pixmap() const { diff --git a/src/declarative/fx/qfxitem.cpp b/src/declarative/fx/qfxitem.cpp index 11b7dd3..38b5713 100644 --- a/src/declarative/fx/qfxitem.cpp +++ b/src/declarative/fx/qfxitem.cpp @@ -1676,7 +1676,7 @@ QmlList* QFxItem::transitions() the item, or giving it a \l Reflection. Some filters may not be available on all canvases; if a filter is not available on a certain canvas, it will simply not be applied for - that canvas (but the XML will still be considered valid). + that canvas (but the QML will still be considered valid). \qml diff --git a/src/declarative/fx/qfxlistview.cpp b/src/declarative/fx/qfxlistview.cpp index 13e5b21..6d11764 100644 --- a/src/declarative/fx/qfxlistview.cpp +++ b/src/declarative/fx/qfxlistview.cpp @@ -797,10 +797,10 @@ void QFxListViewPrivate::fixupX() \inherits Flickable \brief The ListView element provides a list view of items provided by a model. - The model is typically provided by a QAbstractListModel "C++ model object", but can also be created directly in XML. + The model is typically provided by a QAbstractListModel "C++ model object", but can also be created directly in QML. The items are laid out vertically or horizontally and may be flicked to scroll. - The below example creates a very simple vertical list, using an XML model. + The below example creates a very simple vertical list, using a QML model. \image trivialListView.png The user interface defines a delegate to display an item, a highlight, @@ -808,7 +808,7 @@ void QFxListViewPrivate::fixupX() \snippet doc/src/snippets/declarative/listview/listview.qml 3 - The model is defined as a ListModel using XML: + The model is defined as a ListModel using QML: \quotefromfile doc/src/snippets/declarative/listview/dummydata/ContactModel.qml \skipto diff --git a/src/declarative/fx/qfxtext.cpp b/src/declarative/fx/qfxtext.cpp index 5cb31e1..f1aefb9 100644 --- a/src/declarative/fx/qfxtext.cpp +++ b/src/declarative/fx/qfxtext.cpp @@ -67,16 +67,12 @@ QML_DEFINE_TYPE(QFxText,Text); It can display both plain and rich text. For example: \code - - - Hello World!]]]]> - + Text { text: "Hello World!"; font.family: "Helvetica"; font.size: 24; color: "red" } + Text { text: "Hello World!" } \endcode \image declarative-text.png - Additional examples can be found in examples/poc/text.xml - If height and width are not explicitly set, Text will attempt to determine how much room is needed and set it accordingly. Unless \c wrap is set, it will always prefer width to height (all text will be placed on a single line). @@ -99,26 +95,19 @@ QML_DEFINE_TYPE(QFxText,Text); It can display both plain and rich text. For example: \code - - - Hello World!]]> - + Text { text: "Hello World!"; font.family: "Helvetica"; font.size: 24; color: "red" } + Text { text: "Hello World!" } \endcode \image text.png - Note that the 'styling' properties such as color and outline are ignored for rich text, styling - of rich text should be done within the text itself. - - Additional examples can be found in examples/poc/text.xml - If height and width are not explicitly set, Text will attempt to determine how much room is needed and set it accordingly. Unless \c wrap is set, it will always prefer width to height (all text will be placed on a single line). The \c elideMode can alternatively be used to fit a line of plain text to a set width. - A QFxText object can be instantiated in Qml using the tag \c <Text>. + A QFxText object can be instantiated in Qml using the tag \c Text. */ QFxText::QFxText(QFxItem *parent) : QFxItem(*(new QFxTextPrivate), parent) @@ -143,9 +132,14 @@ QFxText::~QFxText() } /*! - \qmlproperty font Text::font + \qmlproperty string Text::font.family + \qmlproperty bool Text::font.bold + \qmlproperty bool Text::font.italic + \qmlproperty real Text::font.size - Set the Text's font attributes. \c font.size sets the font's point size. + Set the Text's font attributes. + + \note \c font.size sets the font's point size (not pixel size). */ /*! @@ -219,11 +213,11 @@ void QFxText::setColor(const QColor &color) The text color. \code - - + //green text using hexadecimal notation + Text { color: "#00FF00"; ... } - - + //steelblue text using SVG color name + Text { color: "steelblue"; ... } \endcode */ @@ -241,12 +235,12 @@ QColor QFxText::color() const Supported text styles are \c Normal, \c Outline, \c Raised and \c Sunken. \code - - - - - - + HorizontalLayout { + Text { font.size: 24; text: "Normal" } + Text { font.size: 24; text: "Raised"; style: "Raised"; styleColor: "#AAAAAA" } + Text { font.size: 24; text: "Outline"; style: "Outline"; styleColor: "red" } + Text { font.size: 24; text: "Sunken"; style: "Sunken"; styleColor: "#AAAAAA" } + } \endcode \image declarative-textstyle.png diff --git a/tools/qdoc3/test/classic.css b/tools/qdoc3/test/classic.css index 92a90d4..757d64e 100644 --- a/tools/qdoc3/test/classic.css +++ b/tools/qdoc3/test/classic.css @@ -139,43 +139,50 @@ span.string,span.char } .qmlitem { - padding: 0; + padding: 0; } .qmlname { - white-space: nowrap; - font-weight: bold; + white-space: nowrap; + font-weight: bold; + font-size: 125%; +} + +.qmltype { + font-weight: bold; + font-size: 125%; } .qmlproto, .qmldoc { - border: 1px solid #84b0c7; + // border-top: 1px solid #84b0c7; } .qmlproto { - padding: 0; - background-color: #d5e1e8; - font-weight: bold; - -webkit-border-top-left-radius: 8px; - -webkit-border-top-right-radius: 8px; - -moz-border-radius-topleft: 8px; - -moz-border-radius-topright: 8px; + padding: 0; + //background-color: #e4e4e4;//#d5e1e8; + //font-weight: bold; + //-webkit-border-top-left-radius: 8px; + //-webkit-border-top-right-radius: 8px; + //-moz-border-radius-topleft: 8px; + //-moz-border-radius-topright: 8px; } .qmldoc { - padding: 2px 5px; - background-color: #eef3f5; - border-top-width: 0; - -webkit-border-bottom-left-radius: 8px; - -webkit-border-bottom-right-radius: 8px; - -moz-border-radius-bottomleft: 8px; - -moz-border-radius-bottomright: 8px; + border-top: 1px solid #e4e4e4; + //padding: 2px 5px; + //background-color: #eef3f5; + //border-top-width: 0; + //-webkit-border-bottom-left-radius: 8px; + //-webkit-border-bottom-right-radius: 8px; + //-moz-border-radius-bottomleft: 8px; + //-moz-border-radius-bottomright: 8px; } .qmldoc p, .qmldoc dl, .qmldoc ul { - margin: 6px 0; + //margin: 6px 0; } *.qmlitem p { - margin-top: 0px; - margin-bottom: 0px; + //margin-top: 0px; + //margin-bottom: 0px; } diff --git a/tools/qmlviewer/qmlviewer.cpp b/tools/qmlviewer/qmlviewer.cpp index 87bebfa..3c52cfe 100644 --- a/tools/qmlviewer/qmlviewer.cpp +++ b/tools/qmlviewer/qmlviewer.cpp @@ -241,7 +241,7 @@ void QmlViewer::keyPressEvent(QKeyEvent *event) << "F2 - toggle GIF recording\n" << "F3 - take PNG snapshot\n" << "F4 - show items and state\n" - << "F5 - reload XML\n" + << "F5 - reload QML\n" << "F6 - show object tree\n" << "F7 - show timing\n" << "F8 - show performance (if available)\n" -- cgit v0.12