summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2009-04-30 06:18:50 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2009-04-30 06:18:50 (GMT)
commita26c1cbe326f59162cd6549b8da479c4a7f198da (patch)
treeab6e2f999d19d7e07d5b4ad2fed48cd30c42063e /src/declarative
parent488d2f6012c13291d2a8fe7907c332e2ab1b1b15 (diff)
downloadQt-a26c1cbe326f59162cd6549b8da479c4a7f198da.zip
Qt-a26c1cbe326f59162cd6549b8da479c4a7f198da.tar.gz
Qt-a26c1cbe326f59162cd6549b8da479c4a7f198da.tar.bz2
Documentation work.
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/fx/qfxgridview.cpp6
-rw-r--r--src/declarative/fx/qfximage.cpp2
-rw-r--r--src/declarative/fx/qfxitem.cpp2
-rw-r--r--src/declarative/fx/qfxlistview.cpp8
-rw-r--r--src/declarative/fx/qfxpathview.cpp4
-rw-r--r--src/declarative/fx/qfxtext.cpp50
6 files changed, 33 insertions, 39 deletions
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
<resources>
<ListModel id="contactModel">
@@ -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
<ListModel id="contactModel">
<Contact>
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<QmlTransition *>* 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
<Item>
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 <ListModel
\printuntil </ListModel
@@ -840,7 +840,7 @@ QFxListView::~QFxListView()
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.
+ Models can also be created directly in QML, using the \l ListModel element.
*/
QVariant QFxListView::model() const
{
diff --git a/src/declarative/fx/qfxpathview.cpp b/src/declarative/fx/qfxpathview.cpp
index c0d3ab2..d07d1bf 100644
--- a/src/declarative/fx/qfxpathview.cpp
+++ b/src/declarative/fx/qfxpathview.cpp
@@ -99,7 +99,7 @@ private:
\brief The PathView element lays out model-provided items on a path.
\inherits Item
- 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 along a path defined by a \l Path and may be flicked to scroll.
@@ -140,7 +140,7 @@ QFxPathView::~QFxPathView()
The model provides a set of data that is used to create the items for the view.
For large or dynamic datasets the model is usually provided by a C++ model object.
- However, models can also be created directly in XML, for example:
+ However, models can also be created directly in QML, for example:
\code
<model>
<ListModel>
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
- <Text text="Hello World!" font.family="Helvetica" font.size="24" color="red"/>
- <Text>
- <![CDATA[<b>Hello</b> <i>World!</i>]]]]><![CDATA[>
- </Text>
+ Text { text: "Hello World!"; font.family: "Helvetica"; font.size: 24; color: "red" }
+ Text { text: "<b>Hello</b> <i>World!</i>" }
\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
- <Text text="Hello World!" font.family="Helvetica" font.size="24" color="red"/>
- <Text>
- <![CDATA[<b>Hello</b> <i>World!</i>]]>
- </Text>
+ Text { text: "Hello World!"; font.family: "Helvetica"; font.size: 24; color: "red" }
+ Text { text: "<b>Hello</b> <i>World!</i>" }
\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 &lt;Text&gt;.
+ 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" .../>
+ //green text using hexadecimal notation
+ Text { color: "#00FF00"; ... }
- <!-- steelblue text using SVG color name-->
- <Text color="steelblue" .../>
+ //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"/>
- </HorizontalLayout>
+ 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