Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import QtQuick 1.0
- Rectangle {
- id: wholeScreen
- width: 400
- height: 300
- color: "lightyellow"
- property bool transformationActive: false
- Rectangle {
- id:poly
- x:0; y:0;
- width: 100; height: 100;
- color: "#0000cc"
- Scale {
- id: scaleItem
- origin.x: 25; origin.y: 25; xScale: 3
- }
- function scaleMe(polyVar) {
- polyVar.transform = scaleItem
- }
- states: State {
- name: "active"; when: transformationActive
- StateChangeScript {
- name: "scaleChange";
- script: {
- console.log("went to scaleChange state")
- poly.scaleMe(poly);
- }
- }
- }
- }
- MouseArea {
- id: wholeScreenArea
- anchors.fill: parent
- onClicked: {
- transformationActive = !transformationActive
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement