OnPressAndHold emit signal every 'n' ms?
-
wrote on 12 Dec 2010, 19:56 last edited by
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?
-
wrote on 12 Dec 2010, 20:06 last edited by
Why not to use pair of onPressed and onReleased?
-
wrote on 12 Dec 2010, 20:06 last edited by
Start repeating timer and stop the timer if the button release event occurs.
-
wrote on 12 Dec 2010, 20:08 last edited by
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)?
-
wrote on 12 Dec 2010, 20:10 last edited by
onPressAndHold is a MouseArea event not a key event
-
wrote on 12 Dec 2010, 20:16 last edited by
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! -
wrote on 12 Dec 2010, 20:17 last edited by
I know, I just wanted to catch the idea behind with a kind of synonim.
-
wrote on 13 Dec 2010, 00:06 last edited by
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.
4/8