path: root/src/corelib
diff options
authorGabriel de Dietrich <>2016-02-10 11:30:33 -0800
committerShawn Rutledge <>2016-02-29 08:19:51 +0000
commitf253f4c3310655933266f62e90f46fd12b5c49e4 (patch)
treeaba0126c188cb5d31db5850040f13f498d8055c4 /src/corelib
parenta17a7d37c2d9a77446911a1836b9f511be7c9934 (diff)
Track target widget when wheel events are received
This issue is reproducible on OS X when using a Magic Mouse or a combination of Magic Trackpad and regular mouse. In these cases it's possible to start a scrolling gesture on one widget and move the mouse cursor over another widget. Although we send the wheel event phase information, we never made any use of it. This means that a widget would start scrolling even though it never received a ScrollBegin event. In this patch, we make sure the scrolling cycle is respected and that once a widget starts scrolling, it'll be recieving all the wheel events until a ScrollEnd event reaches the application. For those input devices not supporting a proper phase cycle, we introduce a new (undocumented) phase value, NoScrollPhase. If the wheel event phase is NoScrollPhase, then we ignore the current scroll widget and proceed as usual. This value is the default for wheel events. It's up to the platform plugin to set the proper phase value according to the data received from the OS. Finally, we fix a few of QWheelEvent constructors to properly initialize the phase and source properties. Task-number: QTBUG-50199 Change-Id: I3773729a9c757e2d2fcc5100dcd79f0ed26cb808 Reviewed-by: Shawn Rutledge <>
Diffstat (limited to 'src/corelib')
2 files changed, 4 insertions, 1 deletions
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index c4f5415a01..4d0bd6903d 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -1626,7 +1626,8 @@ public:
enum ScrollPhase {
- ScrollBegin = 1,
+ NoScrollPhase = 0, // Make public in 5.7 or asap
+ ScrollBegin,
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index 7c5263ddbd..527bded3c2 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -3070,6 +3070,8 @@
This enum describes the phase of scrolling.
+ \omitvalue NoScrollPhase The input device doesn't support scroll phase.
\value ScrollBegin Scrolling is about to begin, but the scrolling
distance did not yet change.