Created
January 4, 2015 22:58
-
-
Save raek/e47929ca6776028b52ec to your computer and use it in GitHub Desktop.
Bouncy buttons in Qt Quick / QML
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import QtQuick 2.0 | |
Rectangle { | |
width: 500 | |
height: 500 | |
Row { | |
spacing: 25 | |
anchors.centerIn: parent | |
Button { | |
color: "red" | |
} | |
Button { | |
color: "lime" | |
text: "Click me!" | |
MouseArea { | |
anchors.fill: parent | |
onClicked: { | |
parent.bounce() | |
} | |
} | |
} | |
Button { | |
color: "blue" | |
text: "Clock me!" | |
Timer { | |
interval: 3000 | |
repeat: true | |
running: true | |
onTriggered: { | |
parent.bounce() | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment