summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qtabbar_p.h
diff options
context:
space:
mode:
authorNoah Davis <noahadvs@gmail.com>2022-01-15 14:51:34 -0500
committerShawn Rutledge <shawn.rutledge@qt.io>2022-01-20 18:01:27 +0000
commitf0371487ce4398e99943bd7dae0944941ef0d505 (patch)
tree2ff190c2a71cb37099c91639bcca755dcc0a2b16 /src/widgets/widgets/qtabbar_p.h
parent9ac323f7cd4b34b7dff25d64251b4cd8c5ef60a4 (diff)
QTabBar: Improve scrolling with high resolution mouse wheels
The current behavior for handling the angle delta of a wheel event changes index the instant there is a change in angle delta. This works fine for mouse wheels that send events with 120 angle delta units and there is also already behavior defined for devices with pixel deltas, but there is nothing good for handling events from high resolution mouse wheels that don't have pixel deltas. This patch makes it so that the current index doesn't change until the accumulated angle delta for the X or Y axis reaches 120. [ChangeLog][QtWidgets][QTabBar] Scrolling with a high resolution mouse wheel changes the current index at a rate more like a normal mouse wheel. Task-number: QTBUG-97844 Pick-to: 6.3 Change-Id: I2e7fd88984a253f6ef8a0008deb7233e4cb4d84a Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/widgets/widgets/qtabbar_p.h')
-rw-r--r--src/widgets/widgets/qtabbar_p.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/widgets/widgets/qtabbar_p.h b/src/widgets/widgets/qtabbar_p.h
index 5135839f89..5bc4c15293 100644
--- a/src/widgets/widgets/qtabbar_p.h
+++ b/src/widgets/widgets/qtabbar_p.h
@@ -102,6 +102,9 @@ public:
QRect hoverRect;
QPoint dragStartPosition;
QPoint mousePosition = {-1, -1};
+#if QT_CONFIG(wheelevent)
+ QPoint accumulatedAngleDelta;
+#endif
QSize iconSize;
QToolButton* rightB = nullptr; // right or bottom
QToolButton* leftB = nullptr; // left or top