Advertisement
artemmarchenko

Untitled

Aug 20th, 2011
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import QtQuick 1.0
  2.  
  3. Rectangle {
  4.     id: wholeScreen
  5.     width:  400
  6.     height: 300
  7.     color: "lightyellow"
  8.  
  9.     property bool transformationActive: false
  10.  
  11.     Rectangle {
  12.         id:poly
  13.         x:0; y:0;
  14.         width: 100; height: 100;
  15.         color: "#0000cc"
  16.  
  17.         Scale {
  18.             id: scaleItem
  19.             origin.x: 25; origin.y: 25; xScale: 3
  20.         }
  21.  
  22.         function scaleMe(polyVar) {
  23.             polyVar.transform = scaleItem
  24.         }
  25.        
  26.         states: State {
  27.             name: "active"; when: transformationActive
  28.             StateChangeScript {
  29.                 name: "scaleChange";
  30.                 script: {
  31.                     console.log("went to scaleChange state")
  32.                     poly.scaleMe(poly);
  33.                 }
  34.             }
  35.         }
  36.  
  37.     }
  38.  
  39.     MouseArea {
  40.         id: wholeScreenArea
  41.         anchors.fill: parent
  42.         onClicked: {
  43.             transformationActive = !transformationActive
  44.         }
  45.     }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement