summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qnamespace.h
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>2016-02-10 11:30:33 -0800
committerShawn Rutledge <shawn.rutledge@theqtcompany.com>2016-02-29 08:19:51 +0000
commitf253f4c3310655933266f62e90f46fd12b5c49e4 (patch)
treeaba0126c188cb5d31db5850040f13f498d8055c4 /src/corelib/global/qnamespace.h
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 <shawn.rutledge@theqtcompany.com>
Diffstat (limited to 'src/corelib/global/qnamespace.h')
-rw-r--r--src/corelib/global/qnamespace.h3
1 files changed, 2 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,
ScrollUpdate,
ScrollEnd
};