Hope this reply will be attached automatically to my previous question
Solution is here;
Item {
id: container
width: 1290; height: 650
Scale {
id: scaleItem
origin.x: 25; origin.y: 25; xScale: 3
}
function scaleMe(polyVar) {
polyVar.transform = scaleItem
}
Polygon {
id:poly
x:0; y:0;
width: 0; height: 0;
name: aPolygon
color: "#0000cc"
vertices:[
Point{x:20;y:20},
Point{x:20;y:40},
Point{x:40;y:20}
]
states: State {
name: active; when:
poly.activeFocus;
StateChangeScript {
name:
"scaleChange";
script: {
console.log("went to scaleChange state")
container.scaleMe(poly);
}
}
}
}
Polygon {
id:poly2
x:0; y:0;
width: 0; height: 0;
name: bPolygon
color: "#0000cc"
vertices:[
Point{x:80;y:80},
Point{x:80;y:100},
Point{x:100;y:80}
]
}
}
2011/8/20 <[email protected]>
> Send Qt-qml mailing list submissions to
> [email protected]
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://lists.qt.nokia.com/mailman/listinfo/qt-qml
> or, via email, send a message with subject or body 'help' to
> [email protected]
>
> You can reach the person managing the list at
> [email protected]
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Qt-qml digest..."
>
>
> Today's Topics:
>
> 1. Scale Element (merve t)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 19 Aug 2011 20:50:37 +0300
> From: merve t <[email protected]>
> Subject: [Qt-qml] Scale Element
> To: [email protected]
> Message-ID:
> <cafh_+nkmlp5ekvk14tpxblrwtyj7wuc3uytws8jzfag04um...@mail.gmail.com
> >
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hello,
>
> I can write lines below and got it work:
>
> states: State {
> name: "active"; when:myitem.activeFocus;
> PropertyChanges { target:
> myitem; z:1000; *scale: 1.2* }
> }
> transitions: Transition {
> NumberAnimation { properties:
> scale; duration: 1000 }
> }
>
>
> But in these lines i can not give specific origin to scale property.
>
> I found Scale Elment, like this:
>
> transform: Scale { origin.x: 25; origin.y: 25; xScale: 3}
>
> How can i inject this into state property above, because i want to use
> "when" property of state,
> i want scaling to run on that "when" condition.
>
> Thanks for any idea.
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://lists.qt.nokia.com/pipermail/qt-qml/attachments/20110819/b8e6cb70/attachment-0001.html
>
> ------------------------------
>
> _______________________________________________
> Qt-qml mailing list
> [email protected]
> http://lists.qt.nokia.com/mailman/listinfo/qt-qml
>
>
> End of Qt-qml Digest, Vol 9, Issue 26
> *************************************
>
_______________________________________________
Qt-qml mailing list
[email protected]
http://lists.qt.nokia.com/mailman/listinfo/qt-qml