summaryrefslogtreecommitdiffstats
path: root/tests/auto/qabstractslider
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@nokia.com>2009-10-27 08:14:28 (GMT)
committerRichard Moe Gustavsen <richard.gustavsen@nokia.com>2009-10-27 09:25:49 (GMT)
commit0fd6390800969d174dba819c54c4183a99e8f83c (patch)
tree79e6d0a1d2beb61d0afa988607db018f92447503 /tests/auto/qabstractslider
parent5a4909d9f87b9abf471908a085c0e9f31b7e0a50 (diff)
downloadQt-0fd6390800969d174dba819c54c4183a99e8f83c.zip
Qt-0fd6390800969d174dba819c54c4183a99e8f83c.tar.gz
Qt-0fd6390800969d174dba819c54c4183a99e8f83c.tar.bz2
Implement support for wheel delta with finer resolution than 15 deg.
At the moment, Qt, in many places, does not really understand that a mouse wheel, or touch pad, might operate on a much higher granularity than 15 degrees (that is, a delta of 120). This is clear disadvantage on mac, since the mighty mouse, and track pad, got a resolution that is close to 1 degree. This is called pixel scrolling. This patch first and formost changes the implementation of QAbstractSlider::wheelEvent to _really_ understand what to do when delta is less than 120. Rather than accumulate delta until 120 is reached, then scroll with a value equal to: offset * step * QApplication::wheelScrollLines (default = 3), we multiply offset directly, before waiting for 120. This means that event tough offset is below 120, multiplying it with wheelScrollLines and step will very often give a value over 120, menaing we can scroll much earlier and _much more_ fined grained. This also fixes some auto tests that was ifdeffed out because of specialised mac code written inside this function from before. (NB: we still plan to introduce a new event for pixel scrolling, perhaps for Qt-4.7) Rev-By: Andreas Rev-By: denis
Diffstat (limited to 'tests/auto/qabstractslider')
-rw-r--r--tests/auto/qabstractslider/tst_qabstractslider.cpp16
1 files changed, 0 insertions, 16 deletions
diff --git a/tests/auto/qabstractslider/tst_qabstractslider.cpp b/tests/auto/qabstractslider/tst_qabstractslider.cpp
index 5c70bde..d9574df 100644
--- a/tests/auto/qabstractslider/tst_qabstractslider.cpp
+++ b/tests/auto/qabstractslider/tst_qabstractslider.cpp
@@ -714,11 +714,7 @@ void tst_QAbstractSlider::wheelEvent_data()
<< 1 // delta
<< int(Qt::Vertical) // orientation of slider
<< int(Qt::Vertical) // orientation of wheel
-#ifdef Q_WS_MAC
- << 1 // expected position after
-#else
<< 20 // expected position after
-#endif
<< QPoint(0,0);
QTest::newRow("Normal data page") << 0 // initial position
@@ -777,11 +773,7 @@ void tst_QAbstractSlider::wheelEvent_data()
<< 1 // delta
<< int(Qt::Horizontal) // orientation of slider
<< int(Qt::Horizontal) // orientation of wheel
-#ifdef Q_WS_MAC
- << 49 // expected position after
-#else
<< 30 // expected position after
-#endif
<< QPoint(1,1);
QTest::newRow("Past end") << 50 // initial position
@@ -792,11 +784,7 @@ void tst_QAbstractSlider::wheelEvent_data()
<< false // inverted controls
<< 1 // wheel scroll lines
<< false // with modifiers
-#ifdef Q_WS_MAC
- << 60 // delta
-#else
<< 2 // delta
-#endif
<< int(Qt::Horizontal) // orientation of slider
<< int(Qt::Horizontal) // orientation of wheel
<< 100 // expected position after
@@ -810,11 +798,7 @@ void tst_QAbstractSlider::wheelEvent_data()
<< false // inverted controls
<< 1 // wheel scroll lines
<< false // with modifiers
-#ifdef Q_WS_MAC
- << -60 // delta
-#else
<< -2 // delta
-#endif
<< int(Qt::Horizontal) // orientation of slider
<< int(Qt::Horizontal) // orientation of wheel
<< 0 // expected position after