mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
components: Fix ExtendedAbstractButton pressAndHold
This commit is contained in:
parent
9922c8d5d2
commit
304ba155b6
1 changed files with 0 additions and 26 deletions
|
|
@ -19,36 +19,10 @@ QQC2.AbstractButton {
|
|||
*/
|
||||
property alias cursorShape: mouseArea.cursorShape
|
||||
|
||||
/**
|
||||
* This property holds the elapsed time in milliseconds before pressAndHold is emitted.
|
||||
*/
|
||||
property real pressAndHoldInterval: 1000
|
||||
|
||||
/**
|
||||
* Signal that is emitted when the button has been held for a certain amount of time.
|
||||
*/
|
||||
signal pressAndHold()
|
||||
|
||||
/**
|
||||
* Signal that is emitted when the right click button is pressed.
|
||||
*/
|
||||
signal rightClickPressed()
|
||||
|
||||
Timer {
|
||||
id: timer
|
||||
interval: pressAndHoldInterval
|
||||
repeat: false
|
||||
running: false
|
||||
onTriggered: root.pressAndHold()
|
||||
}
|
||||
|
||||
onPressedChanged: {
|
||||
if (pressed) {
|
||||
timer.restart();
|
||||
} else {
|
||||
timer.stop();
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: mouseArea
|
||||
|
|
|
|||
Loading…
Reference in a new issue