Unsolved Qt DoubleSpin Box value changed slot has called twice
The double call to slot happened in my case only with a breakpoint in the slot function, otherwise it is called once only. The second call was triggered by a timer event
JonB last edited by JonB
For anyone reading this: This is known behaviour, which I stumbled across a long time ago and it was infuriating.
QSpinboxQt Internal code uses a timer on clicks/presses. If you step through in debugger you exceed the timeout and get bad/double behaviour.
Simplest: change all
QSpinboxclick/key to pass
Qt::QueuedConnectionas last parameter for connection type, not default
Qt::DirectConnection. Now you can use debugger breakpoints and all will be well. I wrote a method to connect all my spinboxes like this.