diff options
author | Ian Walters <ian.walters@nokia.com> | 2009-04-28 05:02:58 (GMT) |
---|---|---|
committer | Ian Walters <ian.walters@nokia.com> | 2009-04-28 05:02:58 (GMT) |
commit | 9471fd6c870be0c855f6fc33479ce81ae911f721 (patch) | |
tree | 4cf37b92712f1239eff624faf18ab7fcd3aeba92 /examples/declarative | |
parent | 07233ff591197c3d7eb206251c72352b85b7aa73 (diff) | |
parent | c139630bb792e3d0e364c05c7be3e190bfd90b64 (diff) | |
download | Qt-9471fd6c870be0c855f6fc33479ce81ae911f721.zip Qt-9471fd6c870be0c855f6fc33479ce81ae911f721.tar.gz Qt-9471fd6c870be0c855f6fc33479ce81ae911f721.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'examples/declarative')
-rw-r--r-- | examples/declarative/connections/connections.qml | 6 | ||||
-rw-r--r-- | examples/declarative/dial/DialLibrary/Dial.qml | 6 | ||||
-rw-r--r-- | examples/declarative/dial/dial.qml | 2 | ||||
-rw-r--r-- | examples/declarative/listview/listview.qml | 2 | ||||
-rw-r--r-- | examples/declarative/minehunt/minehunt.qml | 10 | ||||
-rw-r--r-- | examples/declarative/minehunt/pics/back.png | bin | 0 -> 558 bytes | |||
-rw-r--r-- | examples/declarative/minehunt/pics/cachepix-black.png | bin | 1658 -> 0 bytes | |||
-rw-r--r-- | examples/declarative/minehunt/pics/cachepix-black.sci | 5 | ||||
-rw-r--r-- | examples/declarative/minehunt/pics/cachepix-boxless.png | bin | 1819 -> 0 bytes | |||
-rw-r--r-- | examples/declarative/minehunt/pics/cachepix-boxless.sci | 5 | ||||
-rw-r--r-- | examples/declarative/minehunt/pics/front.png | bin | 0 -> 580 bytes | |||
-rw-r--r-- | examples/declarative/mouseregion/mouse.qml | 12 |
12 files changed, 19 insertions, 29 deletions
diff --git a/examples/declarative/connections/connections.qml b/examples/declarative/connections/connections.qml index 3146338..45c0e99 100644 --- a/examples/declarative/connections/connections.qml +++ b/examples/declarative/connections/connections.qml @@ -1,9 +1,9 @@ <Rect id="rect" color="blue" width="40" height="30"> <Rect id="dot" color="red" width="3" height="3" x="{rect.width/2}" y="{rect.height/2}"/> <MouseRegion id="mr" anchors.fill="{rect}"/> - <Connection sender="{mr}" signal="clicked(x,y)"> + <Connection sender="{mr}" signal="clicked(mouse)"> color="green"; - dot.x = x-1; - dot.y = y-1; + dot.x = mouse.x-1; + dot.y = mouse.y-1; </Connection> </Rect> diff --git a/examples/declarative/dial/DialLibrary/Dial.qml b/examples/declarative/dial/DialLibrary/Dial.qml index e1b9f18..e2a11b1 100644 --- a/examples/declarative/dial/DialLibrary/Dial.qml +++ b/examples/declarative/dial/DialLibrary/Dial.qml @@ -1,12 +1,12 @@ <Item width="210" height="210"> <properties><Property name="value" type="real" value="0"/></properties> <Image id="Background" src="background.svg"/> + <Item x="104" y="102" rotation="{Needle.rotation}"> + <Image src="needle_shadow.svg" x="-104" y="-102"/> + </Item> <Item id="Needle" x="102" y="98" rotation="-130"> <rotation><Follow spring="1.4" damping=".15" source="{Math.min(Math.max(-130, value*2.2 - 130), 133)}"/></rotation> <Image src="needle.svg" x="-102" y="-98"/> </Item> - <Item x="104" y="102" rotation="{Needle.rotation}"> - <Image src="needle_shadow.svg" x="-104" y="-102"/> - </Item> <Image src="overlay.svg"/> </Item> diff --git a/examples/declarative/dial/dial.qml b/examples/declarative/dial/dial.qml index ce43b01..bda9b41 100644 --- a/examples/declarative/dial/dial.qml +++ b/examples/declarative/dial/dial.qml @@ -3,7 +3,7 @@ <!-- Dial with a slider to adjust it --> <Dial id="Dial" value="{Slider.x-2}"/> <Rect anchors.top="{Dial.bottom}" x="20" width="160" height="16" color="steelblue" gradientColor="lightsteelblue" radius="8" opacity="0.7"> - <Rect id="Slider" anchors.top="{Dial.bottom}" x="2" y="2" width="30" height="12" color="lightgray" gradientColor="gray" radius="6"> + <Rect id="Slider" x="2" y="2" width="30" height="12" color="lightgray" gradientColor="gray" radius="6"> <MouseRegion anchors.fill="{parent}" drag.target="{parent}" drag.axis="x" diff --git a/examples/declarative/listview/listview.qml b/examples/declarative/listview/listview.qml index 08c8f18..6cacdd1 100644 --- a/examples/declarative/listview/listview.qml +++ b/examples/declarative/listview/listview.qml @@ -74,7 +74,7 @@ Note that we specify the 'children' property. This is because the default property of a ListView is 'delegate'. --> - <Rect y="{List3.yPosition+125}" width="200" height="50" color="#FFFF88" z="0"/> + <Rect y="125" width="200" height="50" color="#FFFF88" z="-1"/> </children> </ListView> diff --git a/examples/declarative/minehunt/minehunt.qml b/examples/declarative/minehunt/minehunt.qml index 9cde164..20c3874 100644 --- a/examples/declarative/minehunt/minehunt.qml +++ b/examples/declarative/minehunt/minehunt.qml @@ -7,10 +7,10 @@ <Component id="tile"> <Flipable id="flipable" width="40" height="40"> <transform> - <Axis id="axis" xStart="20" xEnd="20" yStart="20" yEnd="0" /> + <AxisRotation id="axis" axis.startX="20" axis.endX="20" axis.startY="20" axis.endY="0" /> </transform> <front> - <Image src="pics/cachepix-boxless.sci" width="40" height="40"> + <Image src="pics/front.png" width="40" height="40"> <Image anchors.horizontalCenter="{parent.horizontalCenter}" anchors.verticalCenter="{parent.verticalCenter}" src="pics/flag.png" opacity="{modelData.hasFlag}"> @@ -23,7 +23,7 @@ </Image> </front> <back> - <Image src="pics/cachepix-black.sci" width="40" height="40"> + <Image src="pics/back.png" width="40" height="40"> <Text anchors.horizontalCenter="{parent.horizontalCenter}" anchors.verticalCenter="{parent.verticalCenter}" text="{modelData.hint}" color="white" font.bold="true" opacity="{modelData.hasMine == false && modelData.hint > 0}"/> @@ -34,14 +34,14 @@ </back> <states> <State name="back" when="{modelData.flipped == true}"> - <SetProperty target="{axis}" property="rotation" value="180" /> + <SetProperty target="{axis}" property="angle" value="180" /> </State> </states> <transitions> <Transition> <SequentialAnimation> <PauseAnimation duration="{var ret = Math.abs(flipable.parent.x-field.clickx) + Math.abs(flipable.parent.y-field.clicky); if (ret > 0) {if(modelData.hasMine==true && modelData.flipped==true){ret*3;}else{ret;}} else {0}}"/> - <NumericAnimation easing="easeInOutQuad" properties="rotation"/> + <NumericAnimation easing="easeInOutQuad" properties="angle"/> </SequentialAnimation> </Transition> </transitions> diff --git a/examples/declarative/minehunt/pics/back.png b/examples/declarative/minehunt/pics/back.png Binary files differnew file mode 100644 index 0000000..f6b3f0b --- /dev/null +++ b/examples/declarative/minehunt/pics/back.png diff --git a/examples/declarative/minehunt/pics/cachepix-black.png b/examples/declarative/minehunt/pics/cachepix-black.png Binary files differdeleted file mode 100644 index 53db3ae..0000000 --- a/examples/declarative/minehunt/pics/cachepix-black.png +++ /dev/null diff --git a/examples/declarative/minehunt/pics/cachepix-black.sci b/examples/declarative/minehunt/pics/cachepix-black.sci deleted file mode 100644 index 21d5436..0000000 --- a/examples/declarative/minehunt/pics/cachepix-black.sci +++ /dev/null @@ -1,5 +0,0 @@ -gridLeft: 10 -gridTop: 10 -gridBottom: 10 -gridRight: 10 -imageFile: cachepix-black.png diff --git a/examples/declarative/minehunt/pics/cachepix-boxless.png b/examples/declarative/minehunt/pics/cachepix-boxless.png Binary files differdeleted file mode 100644 index 288e0e4..0000000 --- a/examples/declarative/minehunt/pics/cachepix-boxless.png +++ /dev/null diff --git a/examples/declarative/minehunt/pics/cachepix-boxless.sci b/examples/declarative/minehunt/pics/cachepix-boxless.sci deleted file mode 100644 index d224fd9..0000000 --- a/examples/declarative/minehunt/pics/cachepix-boxless.sci +++ /dev/null @@ -1,5 +0,0 @@ -gridLeft: 10 -gridTop: 10 -gridBottom: 10 -gridRight: 10 -imageFile: cachepix-boxless.png diff --git a/examples/declarative/minehunt/pics/front.png b/examples/declarative/minehunt/pics/front.png Binary files differnew file mode 100644 index 0000000..834331b --- /dev/null +++ b/examples/declarative/minehunt/pics/front.png diff --git a/examples/declarative/mouseregion/mouse.qml b/examples/declarative/mouseregion/mouse.qml index f0f22ac..7aaf51a 100644 --- a/examples/declarative/mouseregion/mouse.qml +++ b/examples/declarative/mouseregion/mouse.qml @@ -1,10 +1,10 @@ <Rect color="white" width="200" height="200"> <Rect width="50" height="50" color="red"> <Text text="Click" anchors.centeredIn="{parent}"/> - <MouseRegion onPressed="print('press (x: ' + x + ' y: ' + y + ')')" - onReleased="print('release (x: ' + x + ' y: ' + y + ' isClick: ' + isClick + ' followsPressAndHold: ' + followsPressAndHold + ')')" - onClicked="print('click (x: ' + x + ' y: ' + y + ' followsPressAndHold: ' + followsPressAndHold + ')')" - onDoubleClicked="print('double click (x: ' + x + ' y: ' + y + ')')" + <MouseRegion onPressed="print('press (x: ' + mouse.x + ' y: ' + mouse.y + ' button: ' + (mouse.button == Qt.RightButton ? 'right' : 'left') + ' Shift: ' + (mouse.modifiers & Qt.ShiftModifier ? 'true' : 'false') + ')')" + onReleased="print('release (x: ' + mouse.x + ' y: ' + mouse.y + ' isClick: ' + mouse.isClick + ' wasHeld: ' + mouse.wasHeld + ')')" + onClicked="print('click (x: ' + mouse.x + ' y: ' + mouse.y + ' wasHeld: ' + mouse.wasHeld + ')')" + onDoubleClicked="print('double click (x: ' + mouse.x + ' y: ' + mouse.y + ')')" onPressAndHold="print('press and hold')" onExitedWhilePressed="print('exiting while pressed')" onReenteredWhilePressed="print('reentering while pressed')" anchors.fill="{parent}"/> @@ -14,8 +14,8 @@ <MouseRegion drag.target="{parent}" drag.axis="x" drag.xmin="0" drag.xmax="150" onPressed="print('press')" - onReleased="print('release (isClick: ' + isClick + ') (followsPressAndHold: ' + followsPressAndHold + ')')" - onClicked="print('click' + '(followsPressAndHold: ' + followsPressAndHold + ')')" + onReleased="print('release (isClick: ' + mouse.isClick + ') (wasHeld: ' + mouse.wasHeld + ')')" + onClicked="print('click' + '(wasHeld: ' + mouse.wasHeld + ')')" onDoubleClicked="print('double click')" onPressAndHold="print('press and hold')" onExitedWhilePressed="print('exiting while pressed')" |