summaryrefslogtreecommitdiffstats
path: root/examples/declarative/tutorials/t3/tutorial3.qml
diff options
context:
space:
mode:
Diffstat (limited to 'examples/declarative/tutorials/t3/tutorial3.qml')
-rw-r--r--examples/declarative/tutorials/t3/tutorial3.qml27
1 files changed, 27 insertions, 0 deletions
diff --git a/examples/declarative/tutorials/t3/tutorial3.qml b/examples/declarative/tutorials/t3/tutorial3.qml
new file mode 100644
index 0000000..f9f1415
--- /dev/null
+++ b/examples/declarative/tutorials/t3/tutorial3.qml
@@ -0,0 +1,27 @@
+<Rect id="Page" width="480" height="200" color="white">
+ <Text id="HelloText" text="Hello world!" font.size="24" font.bold="true" y="30" anchors.horizontalCenter="{Page.horizontalCenter}">
+ <states>
+ <State name="down" when="{MouseRegion.pressed == true}">
+ <SetProperty target="{HelloText}" property="y" value="160"/>
+ <SetProperty target="{HelloText}" property="color" value="red"/>
+ </State>
+ </states>
+ <transitions>
+ <Transition fromState="*" toState="down" reversible="true">
+ <ParallelAnimation>
+ <NumericAnimation properties="y" duration="500" easing="easeOutBounce"/>
+ <ColorAnimation duration="500"/>
+ </ParallelAnimation>
+ </Transition>
+ </transitions>
+ </Text>
+ <MouseRegion id="MouseRegion" anchors.fill="{HelloText}"/>
+ <GridLayout id="ColorPicker" x="0" anchors.bottom="{Page.bottom}" width="120" height="50" columns="3" rows="2">
+ <Cell color="#ff0000"/>
+ <Cell color="#00ff00"/>
+ <Cell color="#0000ff"/>
+ <Cell color="#ffff00"/>
+ <Cell color="#00ffff"/>
+ <Cell color="#ff00ff"/>
+ </GridLayout>
+</Rect>