diff --git a/src/widgets/widgets/qabstractspinbox.cpp b/src/widgets/widgets/qabstractspinbox.cpp index c2b04ce..cd7514f 100644 --- a/src/widgets/widgets/qabstractspinbox.cpp +++ b/src/widgets/widgets/qabstractspinbox.cpp @@ -1155,6 +1155,7 @@ void QAbstractSpinBox::timerEvent(QTimerEvent *event) bool doStep = false; if (event->timerId() == d->spinClickThresholdTimerId) { + qDebug() << __FUNCTION__ << "spinClickThresholdTimerId"; killTimer(d->spinClickThresholdTimerId); d->spinClickThresholdTimerId = -1; d->effectiveSpinRepeatRate = d->buttonState & Keyboard @@ -1163,6 +1164,7 @@ void QAbstractSpinBox::timerEvent(QTimerEvent *event) d->spinClickTimerId = startTimer(d->effectiveSpinRepeatRate); doStep = true; } else if (event->timerId() == d->spinClickTimerId) { + qDebug() << __FUNCTION__ << "spinClickTimerId"; if (d->accelerate) { d->acceleration = d->acceleration + (int)(d->effectiveSpinRepeatRate * 0.05); if (d->effectiveSpinRepeatRate - d->acceleration >= 10) { @@ -1545,6 +1547,7 @@ void QAbstractSpinBoxPrivate::reset() q->killTimer(spinClickTimerId); if (spinClickThresholdTimerId != -1) q->killTimer(spinClickThresholdTimerId); + qDebug() << "reset killed timers"; spinClickTimerId = spinClickThresholdTimerId = -1; acceleration = 0; q->update(); @@ -1565,7 +1568,9 @@ void QAbstractSpinBoxPrivate::updateState(bool up, bool fromKeyboard /* = false reset(); if (q && (q->stepEnabled() & (up ? QAbstractSpinBox::StepUpEnabled : QAbstractSpinBox::StepDownEnabled))) { + spinClickThresholdTimerId = q->startTimer(spinClickThresholdTimerInterval); + qDebug() << __FUNCTION__ << spinClickThresholdTimerId; buttonState = (up ? Up : Down) | (fromKeyboard ? Keyboard : Mouse); q->stepBy(up ? 1 : -1); #ifndef QT_NO_ACCESSIBILITY