mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-29 15:03: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,37 +19,11 @@ QQC2.AbstractButton {
|
||||||
*/
|
*/
|
||||||
property alias cursorShape: mouseArea.cursorShape
|
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 that is emitted when the right click button is pressed.
|
||||||
*/
|
*/
|
||||||
signal rightClickPressed()
|
signal rightClickPressed()
|
||||||
|
|
||||||
Timer {
|
|
||||||
id: timer
|
|
||||||
interval: pressAndHoldInterval
|
|
||||||
repeat: false
|
|
||||||
running: false
|
|
||||||
onTriggered: root.pressAndHold()
|
|
||||||
}
|
|
||||||
|
|
||||||
onPressedChanged: {
|
|
||||||
if (pressed) {
|
|
||||||
timer.restart();
|
|
||||||
} else {
|
|
||||||
timer.stop();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
id: mouseArea
|
id: mouseArea
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue