OnPressAndHold emit signal every 'n' ms?
-
following problem, imagine an user would press a button for a few seconds to fast-forward the current song.
how could I solve this problem?if the user presses the button, the signal is only emitted once.
any suggestions?
-
Why not to use pair of onPressed and onReleased?
-
Start repeating timer and stop the timer if the button release event occurs.
-
Just to better understand: do you want to have a kind of key repetation feature (eg. emitting signal in every half seconds if the user holds the key pressed)?
-
onPressAndHold is a MouseArea event not a key event
-
wow, in 7 minutes 4 replies. nice :P
I'm sorry, with button I meant a custom widget.
so the timer suggestion is a nice idea. are there any other ideas ?
if not, thanks Bradley! -
I know, I just wanted to catch the idea behind with a kind of synonim.
-
Take a look at the example in examples/declarative/modelviews/listview/dynamic.qml (also online at http://doc.qt.nokia.com/4.7-snapshot/declarative-modelviews-listview-dynamiclist-qml.html). The example uses a "PressAndHold" button (defined in a subdirectory, content/PressAndHold.qml) that emits clicked() multiple times when the mouse button is held down.