summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-10-22 06:51:34 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-10-22 06:51:34 (GMT)
commit2b1438567cd570f02e70486f7fa173b11b571843 (patch)
tree72c77190a4a581748926308563a44d067ca8d6fb /src/declarative
parent1ec93e68c36902a14545fc02af80821131c52d57 (diff)
parente45f70af3270bd756cef872e5b3ebc00ef9db838 (diff)
downloadQt-2b1438567cd570f02e70486f7fa173b11b571843.zip
Qt-2b1438567cd570f02e70486f7fa173b11b571843.tar.gz
Qt-2b1438567cd570f02e70486f7fa173b11b571843.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/extra/qmldatetimeformatter.cpp4
-rw-r--r--src/declarative/extra/qmlfontloader.cpp12
-rw-r--r--src/declarative/extra/qmlnumberformatter.cpp4
-rw-r--r--src/declarative/extra/qmlxmllistmodel.cpp4
-rw-r--r--src/declarative/fx/qfxanchors.cpp8
-rw-r--r--src/declarative/fx/qfxgridview.cpp59
-rw-r--r--src/declarative/fx/qfxitem.cpp47
-rw-r--r--src/declarative/fx/qfxlistview.cpp28
-rw-r--r--src/declarative/fx/qfxloader.cpp10
-rw-r--r--src/declarative/qml/qmlcomponent.cpp6
-rw-r--r--src/declarative/qml/qmldom.cpp8
-rw-r--r--src/declarative/qml/qmlengine.cpp4
-rw-r--r--src/declarative/qml/qmlexpression.cpp4
-rw-r--r--src/declarative/util/qmlanimation.cpp8
-rw-r--r--src/declarative/util/qmleasefollow.cpp14
-rw-r--r--src/declarative/util/qmllistmodel.cpp16
-rw-r--r--src/declarative/util/qmlspringfollow.cpp10
-rw-r--r--src/declarative/util/qmlsystempalette.cpp6
-rw-r--r--src/declarative/util/qmltimer.cpp4
19 files changed, 180 insertions, 76 deletions
diff --git a/src/declarative/extra/qmldatetimeformatter.cpp b/src/declarative/extra/qmldatetimeformatter.cpp
index 3542657..9b3d37a 100644
--- a/src/declarative/extra/qmldatetimeformatter.cpp
+++ b/src/declarative/extra/qmldatetimeformatter.cpp
@@ -75,8 +75,8 @@ public:
\brief The DateTimeFormatter allows you to control the format of a date string.
\code
- DateTimeFormatter { id: Formatter; date: System.date }
- Text { text: Formatter.dateText }
+ DateTimeFormatter { id: formatter; date: System.date }
+ Text { text: formatter.dateText }
\endcode
By default, the text properties (dateText, timeText, and dateTimeText) will return the
diff --git a/src/declarative/extra/qmlfontloader.cpp b/src/declarative/extra/qmlfontloader.cpp
index 2193b68..f9857f6 100644
--- a/src/declarative/extra/qmlfontloader.cpp
+++ b/src/declarative/extra/qmlfontloader.cpp
@@ -76,11 +76,11 @@ QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,FontLoader,QmlFontLoader)
Example:
\qml
- FontLoader { id: FixedFont; name: "Courier" }
- FontLoader { id: WebFont; source: "http://www.mysite.com/myfont.ttf" }
+ FontLoader { id: fixedFont; name: "Courier" }
+ FontLoader { id: webFont; source: "http://www.mysite.com/myfont.ttf" }
- Text { text: "Fixed-size font"; font.family: FixedFont.name }
- Text { text: "Fancy font"; font.family: WebFont.name }
+ Text { text: "Fixed-size font"; font.family: fixedFont.name }
+ Text { text: "Fancy font"; font.family: webFont.name }
\endqml
*/
QmlFontLoader::QmlFontLoader(QObject *parent)
@@ -146,8 +146,8 @@ void QmlFontLoader::setSource(const QUrl &url)
Example:
\qml
- FontLoader { id: WebFont; source: "http://www.mysite.com/myfont.ttf" }
- Text { text: "Fancy font"; font.family: WebFont.name }
+ FontLoader { id: webFont; source: "http://www.mysite.com/myfont.ttf" }
+ Text { text: "Fancy font"; font.family: webFont.name }
\endqml
*/
QString QmlFontLoader::name() const
diff --git a/src/declarative/extra/qmlnumberformatter.cpp b/src/declarative/extra/qmlnumberformatter.cpp
index e937905..5b76e45 100644
--- a/src/declarative/extra/qmlnumberformatter.cpp
+++ b/src/declarative/extra/qmlnumberformatter.cpp
@@ -72,8 +72,8 @@ public:
In the following example, the text element will display the text "1,234.57".
\code
- NumberFormatter { id: Formatter; number: 1234.5678; format: "##,##0.##" }
- Text { text: Formatter.text }
+ NumberFormatter { id: formatter; number: 1234.5678; format: "##,##0.##" }
+ Text { text: formatter.text }
\endcode
*/
diff --git a/src/declarative/extra/qmlxmllistmodel.cpp b/src/declarative/extra/qmlxmllistmodel.cpp
index fb26915..df89f56 100644
--- a/src/declarative/extra/qmlxmllistmodel.cpp
+++ b/src/declarative/extra/qmlxmllistmodel.cpp
@@ -76,7 +76,7 @@ QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,XmlListModel,QmlXmlListModel)
...
Component {
- id: Delegate
+ id: myDelegate
Text { text: title }
}
\endqml
@@ -416,7 +416,7 @@ void QmlXmlRoleList::insert(int i, QmlXmlListModelRole *role)
The following is an example of a model containing news from a Yahoo RSS feed:
\qml
XmlListModel {
- id: FeedModel
+ id: feedModel
source: "http://rss.news.yahoo.com/rss/oceania"
query: "/rss/channel/item"
XmlRole { name: "title"; query: "title/string()" }
diff --git a/src/declarative/fx/qfxanchors.cpp b/src/declarative/fx/qfxanchors.cpp
index 09776e5..085bbc7 100644
--- a/src/declarative/fx/qfxanchors.cpp
+++ b/src/declarative/fx/qfxanchors.cpp
@@ -181,6 +181,9 @@ void QFxAnchorsPrivate::centerInChanged()
void QFxAnchorsPrivate::clearItem(QFxItem *item)
{
+ Q_Q(QFxAnchors);
+ if (!item)
+ return;
if (fill == item)
fill = 0;
if (centerIn == item)
@@ -213,6 +216,9 @@ void QFxAnchorsPrivate::clearItem(QFxItem *item)
baseline.item = 0;
usedAnchors &= ~QFxAnchors::HasBaselineAnchor;
}
+ QFxItemPrivate *p =
+ static_cast<QFxItemPrivate *>(QGraphicsItemPrivate::get(item));
+ p->dependantAnchors.removeAll(q);
}
void QFxAnchorsPrivate::addDepend(QFxItem *item)
@@ -232,7 +238,7 @@ void QFxAnchorsPrivate::remDepend(QFxItem *item)
return;
QFxItemPrivate *p =
static_cast<QFxItemPrivate *>(QGraphicsItemPrivate::get(item));
- p->dependantAnchors.removeAll(q);
+ p->dependantAnchors.removeOne(q);
}
bool QFxAnchorsPrivate::isItemComplete() const
diff --git a/src/declarative/fx/qfxgridview.cpp b/src/declarative/fx/qfxgridview.cpp
index 6abe88e..36c06a4 100644
--- a/src/declarative/fx/qfxgridview.cpp
+++ b/src/declarative/fx/qfxgridview.cpp
@@ -679,8 +679,6 @@ void QFxGridViewPrivate::updateCurrent(int modelIndex)
In this case ListModel is a handy way for us to test our UI. In practice
the model would be implemented in C++, or perhaps via a SQL data source.
-
-
*/
QFxGridView::QFxGridView(QFxItem *parent)
: QFxFlickable(*(new QFxGridViewPrivate), parent)
@@ -698,6 +696,59 @@ QFxGridView::~QFxGridView()
}
/*!
+ \qmlattachedproperty bool GridView::isCurrentItem
+ This attched property is true if this delegate is the current item; otherwise false.
+
+ It is attached to each instance of the delegate.
+*/
+
+/*!
+ \qmlattachedproperty GridView GridView::view
+ This attached property holds the view that manages this delegate instance.
+
+ It is attached to each instance of the delegate.
+*/
+
+/*!
+ \qmlattachedproperty bool GridView::delayRemove
+ This attached property holds whether the delegate may be destroyed.
+
+ It is attached to each instance of the delegate.
+
+ It is sometimes necessary to delay the destruction of an item
+ until an animation completes.
+
+ The example below ensures that the animation completes before
+ the item is removed from the grid.
+
+ \code
+ Component {
+ id: myDelegate
+ Item {
+ id: wrapper
+ GridView.onRemove: SequentialAnimation {
+ PropertyAction { target: wrapper.GridView; property: "delayRemove"; value: true }
+ NumberAnimation { target: wrapper; property: "scale"; to: 0; duration: 250; easing: "easeInOutQuad" }
+ PropertyAction { target: wrapper.GridView; property: "delayRemove"; value: false }
+ }
+ }
+ }
+ \endcode
+*/
+
+//XXX change to \qmlattachedsignal when it exists.
+/*!
+ \qmlattachedproperty void GridView::onAdd
+ This attached handler is called immediately after an item is added to the view.
+*/
+
+/*!
+ \qmlattachedproperty void GridView::onRemove
+ This attached handler is called immediately before an item is removed from the view.
+*/
+
+
+/*!
\qmlproperty model GridView::model
This property holds the model providing data for the grid.
@@ -871,9 +922,9 @@ void QFxGridView::setHighlight(QmlComponent *highlight)
\code
Component {
- id: Highlight
+ id: myHighlight
Rectangle {
- id: Wrapper; color: "lightsteelblue"; radius: 4; width: 320; height: 60 >
+ id: wrapper; color: "lightsteelblue"; radius: 4; width: 320; height: 60 >
y: SpringFollow { source: Wrapper.GridView.view.currentItem.y; spring: 3; damping: 0.2 }
x: SpringFollow { source: Wrapper.GridView.view.currentItem.x; spring: 3; damping: 0.2 }
}
diff --git a/src/declarative/fx/qfxitem.cpp b/src/declarative/fx/qfxitem.cpp
index bd94b8c..317a284 100644
--- a/src/declarative/fx/qfxitem.cpp
+++ b/src/declarative/fx/qfxitem.cpp
@@ -610,9 +610,9 @@ void QFxKeyNavigationAttached::keyReleased(QKeyEvent *event)
This example forwards key events to two lists:
\qml
- ListView { id: List1 ... }
- ListView { id: List2 ... }
- Keys.forwardTo: [List1, List2]
+ ListView { id: list1 ... }
+ ListView { id: list2 ... }
+ Keys.forwardTo: [list1, list2]
focus: true
\endqml
*/
@@ -876,6 +876,7 @@ void QFxKeyNavigationAttached::keyReleased(QKeyEvent *event)
parameter provides information about the event.
*/
+
class QFxKeysAttachedPrivate : public QObjectPrivate
{
public:
@@ -1194,19 +1195,13 @@ QFxKeysAttached *QFxKeysAttached::qmlAttachedProperties(QObject *obj)
/*!
\qmlclass Item QFxItem
\brief The Item is the most basic of all visual items in QML.
- */
-/*!
- \class QFxItem Item
- \brief The QFxItem class is a generic QmlView item. It is the base class for all other view items.
-
- \qmltext
- All visual items in Qt Declarative inherit from QFxItem. Although QFxItem
+ All visual items in Qt Declarative inherit from Item. Although Item
has no visual appearance, it defines all the properties that are
- common across visual items - like the x and y position, and the
- width and height. \l {Keys}{Key handling} is also provided by Item.
+ common across visual items - such as the x and y position, the
+ width and height, \l {anchor-layout}{anchoring} and key handling.
- QFxItem is also useful for grouping items together.
+ Item is also useful for grouping items together.
\qml
Item {
@@ -1229,7 +1224,31 @@ QFxKeysAttached *QFxKeysAttached::qmlAttachedProperties(QObject *obj)
}
\endqml
- \endqmltext
+ \section1 Key Handling
+
+ Key handling is available to all Item-based visual elements via the \l {Keys}{Keys}
+ attached property. The \e Keys attached property provides basic handlers such
+ as \l {Keys::onPressed(event)}{onPressed} and \l {Keys::onReleased(event)}{onReleased},
+ as well as handlers for specific keys, such as
+ \l {Keys::onCancelPressed(event)}{onCancelPressed}. The example below
+ assigns \l {qmlfocus}{focus} to the item and handles
+ the Left key via the general \e onPressed handler and the Select key via the
+ onSelectPressed handler:
+
+ \qml
+ Item {
+ focus: true
+ Keys.onPressed: {
+ if (event.key == Qt.Key_Left) {
+ print("move left");
+ event.accepted = true;
+ }
+ }
+ Keys.onSelectPressed: print("Selected");
+ }
+ \endqml
+
+ See the \l {Keys}{Keys} attached property for detailed documentation.
\ingroup group_coreitems
*/
diff --git a/src/declarative/fx/qfxlistview.cpp b/src/declarative/fx/qfxlistview.cpp
index 2ea1cb7..23bf573 100644
--- a/src/declarative/fx/qfxlistview.cpp
+++ b/src/declarative/fx/qfxlistview.cpp
@@ -907,6 +907,34 @@ QFxListView::~QFxListView()
It is sometimes necessary to delay the destruction of an item
until an animation completes.
+
+ The example below ensures that the animation completes before
+ the item is removed from the list.
+
+ \code
+ Component {
+ id: myDelegate
+ Item {
+ id: wrapper
+ ListView.onRemove: SequentialAnimation {
+ PropertyAction { target: wrapper.ListView; property: "delayRemove"; value: true }
+ NumberAnimation { target: wrapper; property: "scale"; to: 0; duration: 250; easing: "easeInOutQuad" }
+ PropertyAction { target: wrapper.ListView; property: "delayRemove"; value: false }
+ }
+ }
+ }
+ \endcode
+*/
+
+//XXX change to \qmlattachedsignal when it exists.
+/*!
+ \qmlattachedproperty void ListView::onAdd
+ This attached handler is called immediately after an item is added to the view.
+*/
+
+/*!
+ \qmlattachedproperty void ListView::onRemove
+ This attached handler is called immediately before an item is removed from the view.
*/
/*!
diff --git a/src/declarative/fx/qfxloader.cpp b/src/declarative/fx/qfxloader.cpp
index d0c2690..d60c135 100644
--- a/src/declarative/fx/qfxloader.cpp
+++ b/src/declarative/fx/qfxloader.cpp
@@ -69,9 +69,9 @@ QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Loader,QFxLoader)
It is also an effective means of delaying the creation of a component
until it is required:
\code
- Loader { id: PageLoader }
+ Loader { id: pageLoader }
Rectangle {
- MouseRegion { anchors.fill: parent; onClicked: PageLoader.source = "Page1.qml" }
+ MouseRegion { anchors.fill: parent; onClicked: pageLoader.source = "Page1.qml" }
}
\endcode
*/
@@ -155,12 +155,12 @@ void QFxLoader::setSource(const QUrl &url)
\qml
Item {
Component {
- id: RedSquare
+ id: redSquare
Rectangle { color: "red"; width: 10; height: 10 }
}
- Loader { sourceComponent: RedSquare }
- Loader { sourceComponent: RedSquare; x: 10 }
+ Loader { sourceComponent: redSquare }
+ Loader { sourceComponent: redSquare; x: 10 }
}
\endqml
diff --git a/src/declarative/qml/qmlcomponent.cpp b/src/declarative/qml/qmlcomponent.cpp
index dc71989..0c85574 100644
--- a/src/declarative/qml/qmlcomponent.cpp
+++ b/src/declarative/qml/qmlcomponent.cpp
@@ -84,15 +84,15 @@ int statusId = qRegisterMetaType<QmlComponent::Status>("QmlComponent::Status");
\qml
Item {
Component {
- id: RedSquare
+ id: redSquare
Rectangle {
color: "red"
width: 10
height: 10
}
}
- Loader { sourceComponent: RedSquare }
- Loader { sourceComponent: RedSquare; x: 20 }
+ Loader { sourceComponent: redSquare }
+ Loader { sourceComponent: redSquare; x: 20 }
}
\endqml
diff --git a/src/declarative/qml/qmldom.cpp b/src/declarative/qml/qmldom.cpp
index ce1bb93..a0601d7 100644
--- a/src/declarative/qml/qmldom.cpp
+++ b/src/declarative/qml/qmldom.cpp
@@ -764,7 +764,7 @@ int QmlDomObject::objectTypeMinorVersion() const
For example, the object id of this object would be "MyText".
\qml
-Text { id: MyText }
+Text { id: myText }
\endqml
*/
QString QmlDomObject::objectId() const
@@ -1599,12 +1599,12 @@ QList<int> QmlDomList:: commaPositions() const
Sub-components are QmlComponents defined within a QML document. The
following example shows the definition of a sub-component with the id
- "ListDelegate".
+ "listDelegate".
\qml
Item {
Component {
- id: ListDelegate
+ id: listDelegate
Text {
text: modelData.text
}
@@ -1653,7 +1653,7 @@ QmlDomComponent &QmlDomComponent::operator=(const QmlDomComponent &other)
\qml
Item {
Component {
- id: ListDelegate
+ id: listDelegate
Text {
text: modelData.text
}
diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp
index 9fad80b..354114a 100644
--- a/src/declarative/qml/qmlengine.cpp
+++ b/src/declarative/qml/qmlengine.cpp
@@ -747,7 +747,7 @@ QScriptValue QmlEnginePrivate::createQmlObject(QScriptContext *ctxt, QScriptEngi
\code
transform: Rotation {
- id: Rotation
+ id: rotation
origin.x: Container.width / 2;
axis: vector(0, 1, 1)
}
@@ -757,7 +757,7 @@ QScriptValue QmlEnginePrivate::createQmlObject(QScriptContext *ctxt, QScriptEngi
\code
transform: Rotation {
- id: Rotation
+ id: rotation
origin.x: Container.width / 2;
axis.x: 0; axis.y: 1; axis.z: 0
}
diff --git a/src/declarative/qml/qmlexpression.cpp b/src/declarative/qml/qmlexpression.cpp
index b07ee4c..d2bf4a8 100644
--- a/src/declarative/qml/qmlexpression.cpp
+++ b/src/declarative/qml/qmlexpression.cpp
@@ -109,7 +109,7 @@ void QmlExpressionPrivate::init(QmlContext *ctxt, void *expr, QmlRefCount *rc,
QmlEngine *engine = ctxt->engine();
QmlEnginePrivate *ep = QmlEnginePrivate::get(engine);
QScriptEngine *scriptEngine = QmlEnginePrivate::getScriptEngine(engine);
-#ifndef Q_OS_SYMBIAN //XXX Why doesn't this work?
+#if !defined(Q_OS_SYMBIAN) && !defined(Q_OS_WIN32) //XXX Why doesn't this work?
if (!dd->programs.at(progIdx)) {
dd->programs[progIdx] =
new QScriptProgram(scriptEngine->compile(data->expression, data->fileName, data->line));
@@ -119,7 +119,7 @@ void QmlExpressionPrivate::init(QmlContext *ctxt, void *expr, QmlRefCount *rc,
QScriptContext *scriptContext = scriptEngine->pushCleanContext();
scriptContext->pushScope(ep->contextClass->newContext(ctxt, me));
-#ifndef Q_OS_SYMBIAN
+#if !defined(Q_OS_SYMBIAN) && !defined(Q_OS_WIN32)
data->expressionFunction = scriptEngine->evaluate(*dd->programs[progIdx]);
#else
data->expressionFunction = scriptEngine->evaluate(data->expression);
diff --git a/src/declarative/util/qmlanimation.cpp b/src/declarative/util/qmlanimation.cpp
index f42aa4e..c5a7f38 100644
--- a/src/declarative/util/qmlanimation.cpp
+++ b/src/declarative/util/qmlanimation.cpp
@@ -179,10 +179,10 @@ QmlAbstractAnimation::QmlAbstractAnimation(QmlAbstractAnimationPrivate &dd, QObj
Rectangle {
width: 100; height: 100
x: NumberAnimation {
- running: MyMouse.pressed
+ running: myMouse.pressed
from: 0; to: 100
}
- MouseRegion { id: MyMouse }
+ MouseRegion { id: myMouse }
}
\endcode
@@ -191,8 +191,8 @@ QmlAbstractAnimation::QmlAbstractAnimation(QmlAbstractAnimationPrivate &dd, QObj
or not the animation is running.
\code
- NumberAnimation { id: MyAnimation }
- Text { text: MyAnimation.running ? "Animation is running" : "Animation is not running" }
+ NumberAnimation { id: myAnimation }
+ Text { text: myAnimation.running ? "Animation is running" : "Animation is not running" }
\endcode
Animations can also be started and stopped imperatively from JavaScript
diff --git a/src/declarative/util/qmleasefollow.cpp b/src/declarative/util/qmleasefollow.cpp
index 860c63a..f020395 100644
--- a/src/declarative/util/qmleasefollow.cpp
+++ b/src/declarative/util/qmleasefollow.cpp
@@ -225,21 +225,21 @@ Rectangle {
color: "green"
width: 60; height: 60;
x: -5; y: -5;
- x: EaseFollow { source: Rect1.x - 5; velocity: 200 }
- y: EaseFollow { source: Rect1.y - 5; velocity: 200 }
+ x: EaseFollow { source: rect1.x - 5; velocity: 200 }
+ y: EaseFollow { source: rect1.y - 5; velocity: 200 }
}
Rectangle {
- id: Rect1
+ id: rect1
color: "red"
width: 50; height: 50;
}
focus: true
- Keys.onRightPressed: Rect1.x = Rect1.x + 100
- Keys.onLeftPressed: Rect1.x = Rect1.x - 100
- Keys.onUpPressed: Rect1.y = Rect1.y - 100
- Keys.onDownPressed: Rect1.y = Rect1.y + 100
+ Keys.onRightPressed: rect1.x = rect1.x + 100
+ Keys.onLeftPressed: rect1.x = rect1.x - 100
+ Keys.onUpPressed: rect1.y = rect1.y - 100
+ Keys.onDownPressed: rect1.y = rect1.y + 100
}
\endcode
diff --git a/src/declarative/util/qmllistmodel.cpp b/src/declarative/util/qmllistmodel.cpp
index 4dc9bc5..7ccccec 100644
--- a/src/declarative/util/qmllistmodel.cpp
+++ b/src/declarative/util/qmllistmodel.cpp
@@ -82,7 +82,7 @@ static void dump(ModelNode *node, int ind);
\code
ListModel {
- id: FruitModel
+ id: fruitModel
ListElement {
name: "Apple"
cost: 2.45
@@ -104,7 +104,7 @@ static void dump(ModelNode *node, int ind);
The defined model can be used in views such as ListView:
\code
Component {
- id: FruitDelegate
+ id: fruitDelegate
Item {
width: 200; height: 50
Text { text: name }
@@ -113,8 +113,8 @@ static void dump(ModelNode *node, int ind);
}
ListView {
- model: FruitModel
- delegate: FruitDelegate
+ model: fruitModel
+ delegate: fruitDelegate
anchors.fill: parent
}
\endcode
@@ -123,7 +123,7 @@ static void dump(ModelNode *node, int ind);
\code
ListModel {
- id: FruitModel
+ id: fruitModel
ListElement {
name: "Apple"
cost: 2.45
@@ -153,7 +153,7 @@ static void dump(ModelNode *node, int ind);
The delegate below will list all the fruit attributes:
\code
Component {
- id: FruitDelegate
+ id: fruitDelegate
Item {
width: 200; height: 50
Text { id: Name; text: name }
@@ -176,7 +176,7 @@ static void dump(ModelNode *node, int ind);
\code
Component {
- id: FruitDelegate
+ id: fruitDelegate
Item {
width: 200; height: 50
Text { text: name }
@@ -185,7 +185,7 @@ static void dump(ModelNode *node, int ind);
// Double the price when clicked.
MouseRegion {
anchors.fill: parent
- onClicked: FruitModel.set(index, "cost", cost*2)
+ onClicked: fruitModel.set(index, "cost", cost*2)
}
}
}
diff --git a/src/declarative/util/qmlspringfollow.cpp b/src/declarative/util/qmlspringfollow.cpp
index 2dae448..34ec976 100644
--- a/src/declarative/util/qmlspringfollow.cpp
+++ b/src/declarative/util/qmlspringfollow.cpp
@@ -210,10 +210,10 @@ void QmlSpringFollowPrivate::stop()
\qmlclass SpringFollow QmlSpringFollow
\brief The SpringFollow element allows a property to track a value.
- In example below, Rect2 will follow Rect1 moving with a velocity of up to 200:
+ In example below, \e rect2 will follow \e rect1 moving with a velocity of up to 200:
\code
Rectangle {
- id: Rect1
+ id: rect1
width: 20; height: 20
color: "#00ff00"
y: 200 //initial value
@@ -229,11 +229,11 @@ void QmlSpringFollowPrivate::stop()
}
}
Rectangle {
- id: Rect2
- x: Rect1.width
+ id: rect2
+ x: rect1.width
width: 20; height: 20
color: "#ff0000"
- y: SpringFollow { source: Rect1.y; velocity: 200 }
+ y: SpringFollow { source: rect1.y; velocity: 200 }
}
\endcode
diff --git a/src/declarative/util/qmlsystempalette.cpp b/src/declarative/util/qmlsystempalette.cpp
index 88278c3..014eca8 100644
--- a/src/declarative/util/qmlsystempalette.cpp
+++ b/src/declarative/util/qmlsystempalette.cpp
@@ -62,14 +62,14 @@ QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,SystemPalette,QmlSystemPalette)
Example:
\qml
- SystemPalette { id: MyPalette; colorGroup: Qt.Active }
+ SystemPalette { id: myPalette; colorGroup: Qt.Active }
Rectangle {
width: 640; height: 480
- color: MyPalette.window
+ color: myPalette.window
Text {
anchors.fill: parent
- text: "Hello!"; color: MyPalette.windowText
+ text: "Hello!"; color: myPalette.windowText
}
}
\endqml
diff --git a/src/declarative/util/qmltimer.cpp b/src/declarative/util/qmltimer.cpp
index 3fbe15c..f1991f5 100644
--- a/src/declarative/util/qmltimer.cpp
+++ b/src/declarative/util/qmltimer.cpp
@@ -75,10 +75,10 @@ public:
\qml
Timer {
interval: 500; running: true; repeat: true
- onTriggered: Time.text = Date().toString()
+ onTriggered: time.text = Date().toString()
}
Text {
- id: Time
+ id: time
}
\endqml