Question

I need to capture whole changed value just when the widget loses focus.

I know I have valueChanged() and editingFinished() signals. The problem with valueChanged() signal is that it will be fired for each pressed key and the problem with editingFinished() is that it is fired even when his value don't change.

The question is: Is possible to have a signal fired for each lost focus just when the value changes?

If don't, comes a new question: Is there a way to get the widget's old value inside a slot connected at editingFinished() for comparison against current value and decision if the value change occurred?

Was it helpful?

Solution

You can try extend the QSpinBox and then reimplement focusOutEvent()
http://qt-project.org/doc/qt-5.0/qtwidgets/qwidget.html#focusOutEvent

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top