Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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