Last active
January 25, 2016 15:55
-
-
Save zymtx5g79k/7190e7bb7dbb26e66be2 to your computer and use it in GitHub Desktop.
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
color: Qt.rgba(Qt.random(), Qt.random(), Qt.random(), 1) | |
Button { | |
id: button | |
signal pressAndHold() | |
Timer { | |
id: longPressTimer | |
interval: 2000 //your press-and-hold interval here | |
repeat: false | |
running: false | |
onTriggered: { | |
button.pressAndHold() | |
} | |
} | |
onPressedChanged: { | |
if ( pressed ) { | |
longPressTimer.running = true; | |
} else { | |
longPressTimer.running = false; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment