Phone Dialpad longpress 0 - directs to +
-
Hi!
import QtQuick 2.7 import QtQuick.Controls 2.1 ApplicationWindow { visible: true width: 640 height: 480 title: qsTr("Hello World") Row { Button { text: "0" onClicked: label.text += "0" onPressAndHold: label.text += "+" } Label { id: label } } } -
Above Abstract Button press and hold available from QtQuick.Controls 2.1 in Qt 5.7 on wards.
Can also use Mouse Area Press and Hold event.
import QtQuick 2.5
import QtQuick.Window 2.2Window {
visible: true
width: 640
height: 480
title: qsTr("Hello World")MainForm { anchors.fill: parent mouseArea.onPressAndHold: { console.log("Press and Hold") } }}
-
In that case, you can use a
Timerand theButton'spressedproperty /onPressedChangedsignal to build your ownonPressAndHold.