summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets/qabstractslider.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets/qabstractslider.cpp')
-rw-r--r--src/gui/widgets/qabstractslider.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gui/widgets/qabstractslider.cpp b/src/gui/widgets/qabstractslider.cpp
index 522d472..6a01d68 100644
--- a/src/gui/widgets/qabstractslider.cpp
+++ b/src/gui/widgets/qabstractslider.cpp
@@ -764,12 +764,12 @@ void QAbstractSlider::keyPressEvent(QKeyEvent *ev)
SliderAction action = SliderNoAction;
#ifdef QT_KEYPAD_NAVIGATION
if (ev->isAutoRepeat()) {
- if (d->firstRepeat.isNull())
- d->firstRepeat = QTime::currentTime();
+ if (!d->firstRepeat.isValid())
+ d->firstRepeat.start();
else if (1 == d->repeatMultiplier) {
// This is the interval in milli seconds which one key repetition
// takes.
- const int repeatMSecs = d->firstRepeat.msecsTo(QTime::currentTime());
+ const int repeatMSecs = d->firstRepeat.elapsed();
/**
* The time it takes to currently navigate the whole slider.
@@ -787,8 +787,8 @@ void QAbstractSlider::keyPressEvent(QKeyEvent *ev)
}
}
- else if (!d->firstRepeat.isNull()) {
- d->firstRepeat = QTime();
+ else if (!d->firstRepeat.isValid()) {
+ d->firstRepeat.invalidate();
d->repeatMultiplier = 1;
}