summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets/qabstractslider_p.h
diff options
context:
space:
mode:
authorFrans Englich <frans.englich@nokia.com>2009-11-19 17:00:47 (GMT)
committerFrans Englich <frans.englich@nokia.com>2009-11-19 18:25:55 (GMT)
commit9f6eec91ce4a2a2ac7aae0779e238c0b2c90d0d1 (patch)
tree5c24febe7f44b45de863cfbf5c94ff9f2ff62b95 /src/gui/widgets/qabstractslider_p.h
parent593ea5ec3f08a8f39a8487161106cc0b28c1511f (diff)
downloadQt-9f6eec91ce4a2a2ac7aae0779e238c0b2c90d0d1.zip
Qt-9f6eec91ce4a2a2ac7aae0779e238c0b2c90d0d1.tar.gz
Qt-9f6eec91ce4a2a2ac7aae0779e238c0b2c90d0d1.tar.bz2
QAbstractSlider: keypad navigation is slow.
Add logic to make keypad navigation faster when auto repeating. Task-number: QTBUG-5988 Reviewed-by: Gareth Stockwell
Diffstat (limited to 'src/gui/widgets/qabstractslider_p.h')
-rw-r--r--src/gui/widgets/qabstractslider_p.h33
1 files changed, 32 insertions, 1 deletions
diff --git a/src/gui/widgets/qabstractslider_p.h b/src/gui/widgets/qabstractslider_p.h
index 9324d44..6591981 100644
--- a/src/gui/widgets/qabstractslider_p.h
+++ b/src/gui/widgets/qabstractslider_p.h
@@ -68,7 +68,13 @@ public:
void setSteps(int single, int page);
- int minimum, maximum, singleStep, pageStep, value, position, pressValue;
+ int minimum, maximum, pageStep, value, position, pressValue;
+
+ /**
+ * Call effectiveSingleStep() when changing the slider value.
+ */
+ int singleStep;
+
float offset_accumulated;
uint tracking : 1;
uint blocktracking :1;
@@ -83,8 +89,33 @@ public:
#ifdef QT_KEYPAD_NAVIGATION
int origValue;
+
+ /**
+ */
+ bool isAutoRepeating;
+
+ /**
+ * When we're auto repeating, we multiply singleStep with this value to
+ * get our effective step.
+ */
+ qreal repeatMultiplier;
+
+ /**
+ * The time of when the first auto repeating key press event occurs.
+ */
+ QTime firstRepeat;
+
#endif
+ inline int effectiveSingleStep() const
+ {
+ return singleStep
+#ifdef QT_KEYPAD_NAVIGATION
+ * repeatMultiplier
+#endif
+ ;
+ }
+
inline int bound(int val) const { return qMax(minimum, qMin(maximum, val)); }
inline int overflowSafeAdd(int add) const
{