PDA

View Full Version : Custom spinner - fast increment/decrement



MrGarbage
11th October 2007, 17:32
Hi,

I am implementing a custom spinner control built using 2 small
buttons and a QLineEdit. Everything is in place and working. One
button increments the linedit, the other decrements it.

I would like to add functionality where if you click and hold
one of the buttons then after 2 secs or so the increment/decrement
speed is much faster.

I have some ideas using a timer and so forth, but perhaps there
is some already available functionality I am not aware of.

Any suggestions?

Many thanks!

Mark

wysota
11th October 2007, 17:50
What's wrong with using QSpinBox?

jpn
11th October 2007, 17:53
Notice also QAsbtractSpinBox::accelerated (http://doc.trolltech.com/latest/qabstractspinbox.html#accelerated-prop).