diff options
author | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2009-06-22 12:49:09 (GMT) |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2009-06-22 13:02:05 (GMT) |
commit | 3ead3dff7e713057b03cd2b969896f196b7ca2f0 (patch) | |
tree | d4e6f44e3720b8d1f03b88336bdcc1c3fa900aa9 /src/gui/kernel/qcocoaview_mac.mm | |
parent | f31240c216e19fe02547f078608fa8c0a2aaca7d (diff) | |
download | Qt-3ead3dff7e713057b03cd2b969896f196b7ca2f0.zip Qt-3ead3dff7e713057b03cd2b969896f196b7ca2f0.tar.gz Qt-3ead3dff7e713057b03cd2b969896f196b7ca2f0.tar.bz2 |
Multitouch, Cocoa: Added Qt::WA_TouchPadAcceptSingleTouchEvents
By default this is set to false, meaning you will only get multitouch
events. The reason why this is important is that we use the first
touch of a new touch sequence to find out which widget to send
the subsequent touches to. And on a touchpad, you normally want
this to be the widget under the cursor when more than one finger
is pressed on the pad.
Diffstat (limited to 'src/gui/kernel/qcocoaview_mac.mm')
-rw-r--r-- | src/gui/kernel/qcocoaview_mac.mm | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm index e8e52f9..827094d 100644 --- a/src/gui/kernel/qcocoaview_mac.mm +++ b/src/gui/kernel/qcocoaview_mac.mm @@ -873,22 +873,26 @@ extern "C" { #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 - (void)touchesBeganWithEvent:(NSEvent *)event; { - qt_translateRawTouchEvent(QCocoaTouch::getCurrentTouchPointList(event, true), qwidget); + bool all = qwidget->testAttribute(Qt::WA_TouchPadAcceptSingleTouchEvents); + qt_translateRawTouchEvent(QCocoaTouch::getCurrentTouchPointList(event, all), qwidget); } - (void)touchesMovedWithEvent:(NSEvent *)event; { - qt_translateRawTouchEvent(QCocoaTouch::getCurrentTouchPointList(event, true), qwidget); + bool all = qwidget->testAttribute(Qt::WA_TouchPadAcceptSingleTouchEvents); + qt_translateRawTouchEvent(QCocoaTouch::getCurrentTouchPointList(event, all), qwidget); } - (void)touchesEndedWithEvent:(NSEvent *)event; { - qt_translateRawTouchEvent(QCocoaTouch::getCurrentTouchPointList(event, true), qwidget); + bool all = qwidget->testAttribute(Qt::WA_TouchPadAcceptSingleTouchEvents); + qt_translateRawTouchEvent(QCocoaTouch::getCurrentTouchPointList(event, all), qwidget); } - (void)touchesCancelledWithEvent:(NSEvent *)event; { - qt_translateRawTouchEvent(QCocoaTouch::getCurrentTouchPointList(event, true), qwidget); + bool all = qwidget->testAttribute(Qt::WA_TouchPadAcceptSingleTouchEvents); + qt_translateRawTouchEvent(QCocoaTouch::getCurrentTouchPointList(event, all), qwidget); } - (void)magnifyWithEvent:(NSEvent *)event; |