Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import QtQuick 1.0
- Rectangle {
- id: r0
- x: 100
- y: 0
- z: 1
- color: "green"
- width: parent.width/2
- height: parent.height/2
- property int myLuckyNumber: 10;
- function foo(num){
- return ("Wyslano: " + num + "")
- }
- signal sig(int num)
- onSig: tx1.text = foo(num)
- Text {
- id: tx1
- text: "text"
- }
- MouseArea{
- anchors.fill: parent
- drag.target: parent
- drag.axis: Drag.XandYAxis
- drag.minimumX: 0
- drag.minimumY: 0
- drag.maximumX: root.width - parent.width
- drag.maximumY: root.height - parent.height
- onClicked: parent.sig(parent.myLuckyNumber++)
- onPressed: r0.state = "pressed"
- onReleased: r0.state = ""
- }
- states: State {
- name: "pressed";
- PropertyChanges {
- target: r0
- color: "black"
- }
- PropertyChanges {
- target: r0
- radius: 200
- }
- }
- // Behavior on color {
- // PropertyAnimation { duration: 250 }
- // }
- transitions: [
- Transition {
- from: "pressed"
- PropertyAnimation {
- target: r0
- properties: "color"
- duration: 1000
- }
- PropertyAnimation {
- target: r0
- properties: "radius"
- duration: 1000
- }
- },
- Transition {
- to: "pressed"
- PropertyAnimation {
- target: r0
- properties: "color"
- duration: 10
- }
- PropertyAnimation {
- target: r0
- properties: "radius"
- duration: 10
- }
- }
- ]
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement