summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2009-11-24 01:02:53 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2009-11-24 01:02:53 (GMT)
commit3639261fb803c25af17bf8c1563521477da7d1a6 (patch)
tree2500afb14e5cc031486a100f9d28e68a98f3027d /src/declarative
parent3a54043bc2c9640a2ab0fe003937d0af1bf67c7b (diff)
downloadQt-3639261fb803c25af17bf8c1563521477da7d1a6.zip
Qt-3639261fb803c25af17bf8c1563521477da7d1a6.tar.gz
Qt-3639261fb803c25af17bf8c1563521477da7d1a6.tar.bz2
Doc.
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/util/qmlpropertychanges.cpp17
-rw-r--r--src/declarative/util/qmlstateoperations.cpp21
2 files changed, 34 insertions, 4 deletions
diff --git a/src/declarative/util/qmlpropertychanges.cpp b/src/declarative/util/qmlpropertychanges.cpp
index 28c8e4f..6a393ee 100644
--- a/src/declarative/util/qmlpropertychanges.cpp
+++ b/src/declarative/util/qmlpropertychanges.cpp
@@ -57,7 +57,8 @@ QT_BEGIN_NAMESPACE
\brief The PropertyChanges element describes new property values for a state.
PropertyChanges changes the properties of an item. It allows you to specify the property
- names and values similar to how you normally would specify them for the actual item:
+ names and values for a state similar to how you normally would specify them for the
+ actual item:
\code
PropertyChanges {
@@ -67,6 +68,20 @@ QT_BEGIN_NAMESPACE
width: 48
}
\endcode
+
+ State-specific script for signal handlers can also be specified:
+
+ \qml
+ PropertyChanges {
+ target: myMouseRegion
+ onClicked: doSomethingDifferent()
+ }
+ \endqml
+
+ Changes to an Item's parent or anchors should be done using the associated change elements
+ (ParentChange and AnchorChanges, respectively) rather than PropertyChanges.
+
+ \sa {qmlstate}{States}
*/
/*!
diff --git a/src/declarative/util/qmlstateoperations.cpp b/src/declarative/util/qmlstateoperations.cpp
index e2933b2..9727ca7 100644
--- a/src/declarative/util/qmlstateoperations.cpp
+++ b/src/declarative/util/qmlstateoperations.cpp
@@ -153,6 +153,9 @@ void QmlParentChangePrivate::doChange(QmlGraphicsItem *targetParent, QmlGraphics
More specifically, it will not work if the transform property has been set for any
Items involved in the reparenting (defined as any Items in the common ancestor tree
for the original and new parent).
+
+ You can specify at which point in a transition you want a ParentChange to occur by
+ using a ParentAction.
*/
QML_DEFINE_TYPE(Qt,4,6,ParentChange,QmlParentChange)
@@ -166,7 +169,7 @@ QmlParentChange::~QmlParentChange()
}
/*!
- \qmlproperty Object ParentChange::target
+ \qmlproperty Item ParentChange::target
This property holds the item to be reparented
*/
@@ -310,6 +313,10 @@ public:
/*!
\qmlclass StateChangeScript QmlStateChangeScript
\brief The StateChangeScript element allows you to run a script in a state.
+
+ The script specified will be run immediately when the state is made current.
+ Alternatively you can use a ScriptAction to specify at which point in the transition
+ you want the StateChangeScript to be run.
*/
QML_DEFINE_TYPE(Qt,4,6,StateChangeScript,QmlStateChangeScript)
QmlStateChangeScript::QmlStateChangeScript(QObject *parent)
@@ -385,8 +392,16 @@ QString QmlStateChangeScript::typeName() const
\qmlclass AnchorChanges QmlAnchorChanges
\brief The AnchorChanges element allows you to change the anchors of an item in a state.
+ In the following example we change the top and bottom anchors of an item:
\snippet examples/declarative/anchors/anchor-changes.qml 0
+ AnchorChanges will 'inject' \c x, \c y, \c width, and \c height changes into the transition,
+ so you can animate them as you would normally changes to these properties:
+ \qml
+ //animate our anchor changes
+ NumberAnimation { matchTargets: content; matchProperties: "x,y,width,height" }
+ \endqml
+
For more information on anchors see \l {anchor-layout}{Anchor Layouts}.
*/
@@ -432,8 +447,8 @@ public:
};
/*!
- \qmlproperty Object AnchorChanges::target
- This property holds the object that the anchors to change belong to
+ \qmlproperty Item AnchorChanges::target
+ This property holds the Item whose anchors will change
*/
QmlAnchorChanges::QmlAnchorChanges(QObject *parent)