summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorZeno Albisser <zeno.albisser@nokia.com>2011-01-20 13:54:06 (GMT)
committerZeno Albisser <zeno.albisser@nokia.com>2011-01-26 14:59:32 (GMT)
commit1d85e1ce92e6df1af97bde7542467f40f7003975 (patch)
tree44e53bd3719d8c58f2e13f66b1f325addefa1d3d /src
parentf34e2b62b03e35015b0eaa6b96dc982caf0f230d (diff)
downloadQt-1d85e1ce92e6df1af97bde7542467f40f7003975.zip
Qt-1d85e1ce92e6df1af97bde7542467f40f7003975.tar.gz
Qt-1d85e1ce92e6df1af97bde7542467f40f7003975.tar.bz2
Fix: define hotSpot for Gestures on Mac
If there is no hotSpot defined for a gesture it cannot be propagated propperly within GraphicsView. Task-number: QTBUG-16618 Reviewed-by: Denis Dzyubenko
Diffstat (limited to 'src')
-rw-r--r--src/gui/kernel/qmacgesturerecognizer_mac.mm6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gui/kernel/qmacgesturerecognizer_mac.mm b/src/gui/kernel/qmacgesturerecognizer_mac.mm
index 0e432f3..6a4f0bb 100644
--- a/src/gui/kernel/qmacgesturerecognizer_mac.mm
+++ b/src/gui/kernel/qmacgesturerecognizer_mac.mm
@@ -69,6 +69,7 @@ QMacSwipeGestureRecognizer::recognize(QGesture *gesture, QObject *obj, QEvent *e
case QNativeGestureEvent::Swipe: {
QSwipeGesture *g = static_cast<QSwipeGesture *>(gesture);
g->setSwipeAngle(ev->angle);
+ g->setHotSpot(ev->position);
return QGestureRecognizer::FinishGesture | QGestureRecognizer::ConsumeEventHint;
break; }
default:
@@ -110,6 +111,7 @@ QMacPinchGestureRecognizer::recognize(QGesture *gesture, QObject *obj, QEvent *e
g->setCenterPoint(g->startCenterPoint());
g->setChangeFlags(QPinchGesture::CenterPointChanged);
g->setTotalChangeFlags(g->totalChangeFlags() | g->changeFlags());
+ g->setHotSpot(ev->position);
return QGestureRecognizer::MayBeGesture | QGestureRecognizer::ConsumeEventHint;
case QNativeGestureEvent::Rotate: {
g->setLastScaleFactor(g->scaleFactor());
@@ -117,6 +119,7 @@ QMacPinchGestureRecognizer::recognize(QGesture *gesture, QObject *obj, QEvent *e
g->setRotationAngle(g->rotationAngle() + ev->percentage);
g->setChangeFlags(QPinchGesture::RotationAngleChanged);
g->setTotalChangeFlags(g->totalChangeFlags() | g->changeFlags());
+ g->setHotSpot(ev->position);
return QGestureRecognizer::TriggerGesture | QGestureRecognizer::ConsumeEventHint;
}
case QNativeGestureEvent::Zoom:
@@ -125,6 +128,7 @@ QMacPinchGestureRecognizer::recognize(QGesture *gesture, QObject *obj, QEvent *e
g->setScaleFactor(g->scaleFactor() * (1 + ev->percentage));
g->setChangeFlags(QPinchGesture::ScaleFactorChanged);
g->setTotalChangeFlags(g->totalChangeFlags() | g->changeFlags());
+ g->setHotSpot(ev->position);
return QGestureRecognizer::TriggerGesture | QGestureRecognizer::ConsumeEventHint;
case QNativeGestureEvent::GestureEnd:
return QGestureRecognizer::FinishGesture | QGestureRecognizer::ConsumeEventHint;
@@ -221,6 +225,7 @@ QMacPanGestureRecognizer::recognize(QGesture *gesture, QObject *target, QEvent *
const QPointF posOffset = p - _startPos;
g->setLastOffset(g->offset());
g->setOffset(QPointF(posOffset.x(), posOffset.y()));
+ g->setHotSpot(_startPos);
return QGestureRecognizer::TriggerGesture;
}
} else if (_panTimer.isActive()) {
@@ -239,6 +244,7 @@ QMacPanGestureRecognizer::recognize(QGesture *gesture, QObject *target, QEvent *
break;
// Begin new pan session!
_startPos = QCursor::pos();
+ g->setHotSpot(_startPos);
return QGestureRecognizer::TriggerGesture | QGestureRecognizer::ConsumeEventHint;
}
break; }