QDoubleSpinBox, why isn't valueChanged signal fired when content is empty?
-
I have a QDoubleSpinBox on a form, I have a button on the form and I am trying to enable or disable the button based on the content of the spin box.
I use the slot valueChanged and this works fine whilst there is content in the spin box, in the slot I enable the button if the spin box has content, but the signal is emitted when the spin box is empty, why?
It is still a change in state, very frustrating and I cannot see any other way of doing this.
What I mean is, lets say I add some content to the spin box, then delete the content, for every key stroke the valueChanged signal is emitted, but when the last byte is removed from the control, no signal is emitted.
-
An empty string is no valid value so no value changed signal.
-
@SPlatten said in QDoubleSpinBox, why isn't valueChanged signal fired when content is empty?:
I use the slot valueChanged
Is the string version of the signal any different than the double version?
void valueChanged(double d) void valueChanged(const QString &text)
-
... which is exactly what I mentioned - an empty string is no valid number.