Commit de91a792 authored by Leena Miettinen's avatar Leena Miettinen

Doc: update example and screen shot

Reviewed-by: Niels Weber
parent 9a7e4865
......@@ -4962,13 +4962,40 @@
\o Click the empty slot in the \gui States pane to create State1.
\o Drag and drop the Qt logo on top of middleRightRect.
\o Click the empty slot in the \gui States pane to create State2.
\image qmldesigner-tutorial-state1.png "State 1"
\o In the code editor, bind the position of the Qt logo to the rectangle
to make sure that the logo is displayed within the rectangle when the view
is scaled on different sizes of screens. Set expressions for the x and y
properties, as illustrated by the following code snippet:
\o Click the empty slot in the \gui States pane to create State2.
\code
states: [
State {
name: "State1"
PropertyChanges {
target: icon
x: middleRightRect.x
y: middleRightRect.y
}
},
State {
name: "State2"
PropertyChanges {
target: icon
x: bottomLeftRect.x
y: bottomLeftRect.y
}
}
]
\endcode
\image qmldesigner-tutorial-state1.png "States"
\o Drag and drop the Qt logo on top of bottomLeftRect.
\note When you set the expressions, drag and drop is disabled for
the icon in \QMLD.
\o Press \key {Ctrl+R} to run the application in the QML Viewer.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment