summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2009-08-19 01:45:19 (GMT)
committerAlan Alpert <alan.alpert@nokia.com>2009-08-19 01:45:19 (GMT)
commit5251ff993bdc1cdb94847c4223b348205b4d49a1 (patch)
treea8b7810a6a9666c6bc11bff6ebfc818d682bc5d3
parent4b4015f960ee94a7e244a7ca49297c68446984b0 (diff)
parent26badb44f436329f60193761eaba95d78fb5369d (diff)
downloadQt-5251ff993bdc1cdb94847c4223b348205b4d49a1.zip
Qt-5251ff993bdc1cdb94847c4223b348205b4d49a1.tar.gz
Qt-5251ff993bdc1cdb94847c4223b348205b4d49a1.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
-rw-r--r--doc/src/declarative/pics/BorderImage.pngbin0 -> 8094 bytes
-rw-r--r--examples/declarative/border-image/example.qml31
-rw-r--r--src/declarative/fx/qfxborderimage.cpp26
-rw-r--r--src/declarative/fx/qfxpath.cpp38
-rw-r--r--src/declarative/fx/qfxpathview.cpp35
-rw-r--r--src/declarative/fx/qfxrepeater.cpp31
-rw-r--r--src/declarative/fx/qfxtext.cpp29
7 files changed, 56 insertions, 134 deletions
diff --git a/doc/src/declarative/pics/BorderImage.png b/doc/src/declarative/pics/BorderImage.png
new file mode 100644
index 0000000..651dd8a
--- /dev/null
+++ b/doc/src/declarative/pics/BorderImage.png
Binary files differ
diff --git a/examples/declarative/border-image/example.qml b/examples/declarative/border-image/example.qml
new file mode 100644
index 0000000..10daf47
--- /dev/null
+++ b/examples/declarative/border-image/example.qml
@@ -0,0 +1,31 @@
+import Qt 4.6
+
+Rect {
+ id: Page
+ color: "white"
+ width: 520; height: 280
+
+ HorizontalPositioner {
+ anchors.centerIn: parent
+ spacing: 50
+//! [0]
+ BorderImage {
+ width: 180; height: 180
+ border.left: 30; border.top: 30
+ border.right: 30; border.bottom: 30
+ horizontalTileMode: "Stretch"
+ verticalTileMode: "Stretch"
+ source: "colors.png"
+ }
+
+ BorderImage {
+ width: 180; height: 180
+ border.left: 30; border.top: 30
+ border.right: 30; border.bottom: 30
+ horizontalTileMode: "Round"
+ verticalTileMode: "Round"
+ source: "colors.png"
+ }
+//! [0]
+ }
+}
diff --git a/src/declarative/fx/qfxborderimage.cpp b/src/declarative/fx/qfxborderimage.cpp
index 67b05fd..16677e0 100644
--- a/src/declarative/fx/qfxborderimage.cpp
+++ b/src/declarative/fx/qfxborderimage.cpp
@@ -52,32 +52,20 @@ QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,BorderImage,QFxBorderImage)
/*!
\qmlclass BorderImage QFxBorderImage
- \brief The BorderImage element allows you use an image as a border.
+ \brief The BorderImage element provides an image that can be used as a border.
\inherits Item
- Example:
- \qml
- BorderImage { border.left: 20; border.right: 10
- border.top: 14; border.bottom: 14
- width: 160; height: 160
- source: "pics/qtlogo.png"
- }
- \endqml
+ \snippet examples/declarative/border-image/example.qml 0
+
+ \image BorderImage.png
+
+ \sa examples/declarative/border-image
*/
/*!
\internal
\class QFxBorderImage BorderImage
\brief The QFxBorderImage class provides an image item that you can add to a QFxView.
-
- \ingroup group_coreitems
-
- Example:
- \qml
- BorderImage { source: "pics/star.png" }
- \endqml
-
- A QFxBorderImage object can be instantiated in Qml using the tag \l BorderImage.
*/
QFxBorderImage::QFxBorderImage(QFxItem *parent)
@@ -272,8 +260,6 @@ QFxScaleGrid *QFxBorderImage::border()
\o Repeat - Tile the image until there is no more space. May crop the last image.
\o Round - Like Repeat, but scales the images down to ensure that the last image is not cropped.
\endlist
-
- \sa examples/declarative/border-image
*/
QFxBorderImage::TileMode QFxBorderImage::horizontalTileMode() const
{
diff --git a/src/declarative/fx/qfxpath.cpp b/src/declarative/fx/qfxpath.cpp
index aff8a6d..26fafc5 100644
--- a/src/declarative/fx/qfxpath.cpp
+++ b/src/declarative/fx/qfxpath.cpp
@@ -114,12 +114,6 @@ QFxPath::~QFxPath()
\qmlproperty real Path::startY
This property holds the starting position of the path.
*/
-
-/*!
- \property QFxPath::startX
- \brief the starting x position of the path.
-*/
-
qreal QFxPath::startX() const
{
Q_D(const QFxPath);
@@ -132,12 +126,6 @@ void QFxPath::setStartX(qreal x)
d->startX = x;
}
-
-/*!
- \property QFxPath::startY
- \brief the starting y position of the path.
-*/
-
qreal QFxPath::startY() const
{
Q_D(const QFxPath);
@@ -292,7 +280,7 @@ void QFxPath::componentComplete()
QSet<QString> attrs;
// First gather up all the attributes
foreach (QFxPathElement *pathElement, d->_pathElements) {
- if (QFxPathAttribute *attribute =
+ if (QFxPathAttribute *attribute =
qobject_cast<QFxPathAttribute *>(pathElement))
attrs.insert(attribute->name());
}
@@ -304,7 +292,7 @@ void QFxPath::componentComplete()
connect(pathElement, SIGNAL(changed()), this, SLOT(processPath()));
}
-QPainterPath QFxPath::path() const
+QPainterPath QFxPath::path() const
{
Q_D(const QFxPath);
return d->_path;
@@ -431,9 +419,9 @@ qreal QFxPath::attributeAt(const QString &name, qreal percent) const
if (point.percent == percent) {
return point.values.value(name);
} else if (point.percent > percent) {
- qreal lastValue =
+ qreal lastValue =
ii?(d->_attributePoints.at(ii - 1).values.value(name)):0;
- qreal lastPercent =
+ qreal lastPercent =
ii?(d->_attributePoints.at(ii - 1).percent):0;
qreal curValue = point.values.value(name);
qreal curPercent = point.percent;
@@ -723,11 +711,6 @@ void QFxPathQuad::addToPath(QPainterPath &path)
Defines the position of the first control point.
*/
-
-/*!
- \property QFxPathCubic::control1X
- \brief the x position of the first control point.
-*/
qreal QFxPathCubic::control1X() const
{
return _control1X;
@@ -741,10 +724,6 @@ void QFxPathCubic::setControl1X(qreal x)
}
}
-/*!
- \property QFxPathCubic::control1Y
- \brief the y position of the first control point.
-*/
qreal QFxPathCubic::control1Y() const
{
return _control1Y;
@@ -764,11 +743,6 @@ void QFxPathCubic::setControl1Y(qreal y)
Defines the position of the second control point.
*/
-
-/*!
- \property QFxPathCubic::control2X
- \brief the x position of the second control point.
-*/
qreal QFxPathCubic::control2X() const
{
return _control2X;
@@ -782,10 +756,6 @@ void QFxPathCubic::setControl2X(qreal x)
}
}
-/*!
- \property QFxPathCubic::control2Y
- \brief the y position of the second control point.
-*/
qreal QFxPathCubic::control2Y() const
{
return _control2Y;
diff --git a/src/declarative/fx/qfxpathview.cpp b/src/declarative/fx/qfxpathview.cpp
index 45ff51c..469e9f3 100644
--- a/src/declarative/fx/qfxpathview.cpp
+++ b/src/declarative/fx/qfxpathview.cpp
@@ -70,9 +70,9 @@ public:
QFxPathView::attachedProperties.remove(parent());
}
- QVariant value(const QByteArray &name) const
- {
- return mo->value(name);
+ QVariant value(const QByteArray &name) const
+ {
+ return mo->value(name);
}
void setValue(const QByteArray &name, const QVariant &val)
{
@@ -138,14 +138,6 @@ QFxPathView::~QFxPathView()
For large or dynamic datasets the model is usually provided by a C++ model object.
Models can also be created directly in XML, using the ListModel element.
*/
-
-/*!
- \property QFxPathView::model
- \brief the model providing data for the view.
-
- The model must be either a \l QListModelInterface or
- \l QFxVisualModel subclass.
-*/
QVariant QFxPathView::model() const
{
Q_D(const QFxPathView);
@@ -282,14 +274,8 @@ void QFxPathViewPrivate::setOffset(qreal o)
/*!
\qmlproperty real PathView::snapPosition
- This property holds the position (0-100) the current item snaps to.
-*/
-
-/*!
- \property QFxPathView::snapPosition
- \brief sets the position (0-100) the current item snaps to.
- This property determines the position the nearest item will snap to.
+ This property determines the position (0-100) the nearest item will snap to.
*/
qreal QFxPathView::snapPosition() const
{
@@ -332,15 +318,6 @@ void QFxPathView::setDragMargin(qreal dragMargin)
Here is an example delegate:
\snippet doc/src/snippets/declarative/pathview/pathview.qml 1
*/
-
-/*!
- \property QFxPathView::delegate
- \brief the component to use to render the items.
-
- The delegate is a component that the view will instantiate and destroy
- as needed to display the items.
-
-*/
QmlComponent *QFxPathView::delegate() const
{
Q_D(const QFxPathView);
@@ -366,10 +343,6 @@ void QFxPathView::setDelegate(QmlComponent *c)
}
/*!
- \property QFxPathView::pathItemCount
- \brief the number of items visible on the path at any one time
- */
-/*!
\qmlproperty int PathView::pathItemCount
This property holds the number of items visible on the path at any one time
*/
diff --git a/src/declarative/fx/qfxrepeater.cpp b/src/declarative/fx/qfxrepeater.cpp
index 8f30324..a9d9977 100644
--- a/src/declarative/fx/qfxrepeater.cpp
+++ b/src/declarative/fx/qfxrepeater.cpp
@@ -80,7 +80,7 @@ QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Repeater,QFxRepeater)
\brief The Repeater item allows you to repeat a component based on a data source.
- The Repeater item is used when you want to create a large number of
+ The Repeater item is used when you want to create a large number of
similar items. For each entry in the data source, an item is instantiated
in a context seeded with data from the data source. If the repeater will
be instantiating a large number of instances, it may be more efficient to
@@ -93,11 +93,11 @@ QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Repeater,QFxRepeater)
or object) is available as the \c modelData property. In the case of a Qt model,
all roles are available as named properties just like in the view classes.
- Items instantiated by the Repeater are inserted, in order, as
+ Items instantiated by the Repeater are inserted, in order, as
children of the Repeater's parent. The insertion starts immediately after
the repeater's position in its parent stacking list. This is to allow
you to use a Repeater inside a layout. The following QML example shows how
- the instantiated items would visually appear stacked between the red and
+ the instantiated items would visually appear stacked between the red and
blue rectangles.
\snippet doc/src/snippets/declarative/repeater.qml 0
@@ -115,10 +115,10 @@ QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Repeater,QFxRepeater)
\ingroup group_utility
\qmlclass Repeater
- \brief The QFxRepeater class allows you to repeat a component based on a
+ \brief The QFxRepeater class allows you to repeat a component based on a
data source.
- The QFxRepeater class is used when you want to create a large number of
+ The QFxRepeater class is used when you want to create a large number of
similar items. For each entry in the data source, an item is instantiated
in a context seeded with data from the data source.
@@ -133,11 +133,11 @@ QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Repeater,QFxRepeater)
create that many instances of the component. They will also be assigned an index
based on the order they are created.
- Items instantiated by the QFxRepeater class are inserted, in order, as
+ Items instantiated by the QFxRepeater class are inserted, in order, as
children of the repeater's parent. The insertion starts immediately after
the repeater's position in its parent stacking list. This is to allow
you to use a repeater inside a layout. The following QML example shows how
- the instantiated items would visually appear stacked between the red and
+ the instantiated items would visually appear stacked between the red and
blue rectangles.
\snippet doc/src/snippets/declarative/repeater.qml 0
@@ -161,7 +161,7 @@ QFxRepeater::QFxRepeater(QFxItem *parent)
}
/*!
- \internal
+ \internal
*/
QFxRepeater::QFxRepeater(QFxRepeaterPrivate &dd, QFxItem *parent)
: QFxItem(dd, parent)
@@ -169,7 +169,7 @@ QFxRepeater::QFxRepeater(QFxRepeaterPrivate &dd, QFxItem *parent)
}
/*!
- Destroy the repeater instance. All items it instantiated are also
+ Destroy the repeater instance. All items it instantiated are also
destroyed.
*/
QFxRepeater::~QFxRepeater()
@@ -192,11 +192,6 @@ QFxRepeater::~QFxRepeater()
create that many instances of the component. They will also be assigned an index
based on the order they are created.
*/
-
-/*!
- \property QFxRepeater::dataSource
- \brief The source of data for the repeater.
- */
QVariant QFxRepeater::dataSource() const
{
return QVariant();
@@ -215,10 +210,6 @@ void QFxRepeater::setDataSource(const QVariant &v)
The component to repeat.
*/
-/*!
- \property QFxRepeater::component
- \brief The component to repeat.
- */
QmlComponent *QFxRepeater::component() const
{
Q_D(const QFxRepeater);
@@ -261,8 +252,8 @@ QVariant QFxRepeater::itemChange(GraphicsItemChange change,
void QFxRepeater::regenerate()
{
Q_D(QFxRepeater);
-
- qDeleteAll(d->deletables);
+
+ qDeleteAll(d->deletables);
d->deletables.clear();
if (!d->component || !parentItem() || !isComponentComplete())
return;
diff --git a/src/declarative/fx/qfxtext.cpp b/src/declarative/fx/qfxtext.cpp
index cd34aa0..272102c 100644
--- a/src/declarative/fx/qfxtext.cpp
+++ b/src/declarative/fx/qfxtext.cpp
@@ -132,12 +132,6 @@ QFxText::~QFxText()
\note \c font.size sets the font's point size (not pixel size).
*/
-
-/*!
- \property QFxText::font
- \brief the font used to display the text.
-*/
-
QFont QFxText::font() const
{
Q_D(const QFxText);
@@ -245,16 +239,6 @@ QColor QFxText::color() const
\image declarative-textstyle.png
*/
-
-/*!
- \property QFxText::style
- \brief an additional style of the text to display.
-
- By default, the text style is Normal.
-
- \note This property is used to support text styles not natively
- handled by QFont or QPainter::drawText().
-*/
QFxText::TextStyle QFxText::style() const
{
Q_D(const QFxText);
@@ -309,13 +293,6 @@ QColor QFxText::styleColor() const
\c AlignHCenter. The valid values for \c vAlign are \c AlignTop, \c AlignBottom
and \c AlignVCenter.
*/
-
-/*!
- \property QFxText::hAlign
- \brief the horizontal alignment of the text.
-
- Valid values are \c AlignLeft, \c AlignRight, and \c AlignHCenter. The default value is \c AlignLeft.
-*/
QFxText::HAlignment QFxText::hAlign() const
{
Q_D(const QFxText);
@@ -328,12 +305,6 @@ void QFxText::setHAlign(HAlignment align)
d->hAlign = align;
}
-/*!
- \property QFxText::vAlign
- \brief the vertical alignment of the text.
-
- Valid values are \c AlignTop, \c AlignBottom, and \c AlignVCenter. The default value is \c AlignTop.
-*/
QFxText::VAlignment QFxText::vAlign() const
{
Q_D(const QFxText);