diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2009-04-29 05:09:07 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2009-04-29 05:09:07 (GMT) |
commit | 012bf05b8c5e37bb102406d79023cb5d875deaac (patch) | |
tree | 344813cafa06bb2bf6293a2fe167d57c5a2503c3 /examples | |
parent | 3acc614737ab2ac5d15c4d4f38066c417065a843 (diff) | |
download | Qt-012bf05b8c5e37bb102406d79023cb5d875deaac.zip Qt-012bf05b8c5e37bb102406d79023cb5d875deaac.tar.gz Qt-012bf05b8c5e37bb102406d79023cb5d875deaac.tar.bz2 |
API improvements for Flipable.
You can now specify an axis and rotation, rather than using transform.
The tranform behavior has been preserved, however, to allow for cases
where you want a more complex transform when rotating.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/declarative/minehunt/minehunt.qml | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/declarative/minehunt/minehunt.qml b/examples/declarative/minehunt/minehunt.qml index 20c3874..5c1b071 100644 --- a/examples/declarative/minehunt/minehunt.qml +++ b/examples/declarative/minehunt/minehunt.qml @@ -6,9 +6,9 @@ <resources> <Component id="tile"> <Flipable id="flipable" width="40" height="40"> - <transform> - <AxisRotation id="axis" axis.startX="20" axis.endX="20" axis.startY="20" axis.endY="0" /> - </transform> + <axis> + <Axis startX="20" startY="20" endX="20" endY="0" /> + </axis> <front> <Image src="pics/front.png" width="40" height="40"> <Image anchors.horizontalCenter="{parent.horizontalCenter}" @@ -34,19 +34,19 @@ </back> <states> <State name="back" when="{modelData.flipped == true}"> - <SetProperty target="{axis}" property="angle" value="180" /> + <SetProperty target="{flipable}" property="rotation" 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="angle"/> + <NumericAnimation easing="easeInOutQuad" properties="rotation"/> </SequentialAnimation> </Transition> </transitions> <MouseRegion anchors.fill="{parent}" - onClicked="field.clickx = flipable.parent.x; field.clicky = flipable.parent.y; row = Math.floor(index/9); col = index - (Math.floor(index/9) * 9); if(mouseButton==undefined || mouseButton=='Right'){flag(row,col);}else{flip(row,col);}" /> + onClicked="field.clickx = flipable.parent.x; field.clicky = flipable.parent.y; row = Math.floor(index/9); col = index - (Math.floor(index/9) * 9); if(mouse.button==undefined || mouse.button==Qt.RightButton){flag(row,col);}else{flip(row,col);}" /> </Flipable> </Component> </resources> |