A guess: QSpinBox inherits a signal editingFinished, which is not emitted until focus changes, say if the user keys the ‘enter’ key. So the valueChanged signal is not emitted until then. Maybe value() reports the old value until then also? But then, if you comment out your line, why does it work? Have you tried: keyClicks(…, ’34\n’ ) with a newline?