PDA

View Full Version : QSpinBox better value change notification?



akos.maroy
12th July 2008, 12:20
I'm trying to use a QDoubleSpinBox, and I'm having some trouble reacting on the value change of the box. What I want to do is to react on the event of any of the arrows of the spinbox being pressed, and on the event of number being replaced by the user in the box. The problem is, that neither of the currently available signals permits me to do this.

the valueChanged() signal fires every time one of the arrows is passed, but it also fires whever a single digit is rewritten in the box. which makes it practically un-usable, as if the user is entereing the value 125, it will fire three times, with the following values: 1, 12, 125.

the editingFinished() event does what I'd need in terms of user input, but then I'm losing the ability to react on the pressing of the arrows.

maybe I should go for valueChanged(), and somehow determine if it was fired as a response to a button press or keyboard input? or maybe I could connect directly to the buttons of the spinbox?

any help would be appreciated...