summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qstandardgestures.cpp
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2010-06-04 09:13:19 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2010-06-07 16:09:42 (GMT)
commitc28da4dd467c2763bed5c6b31471f078ac26cee6 (patch)
tree1520152ff01d86c31c72411b8b8542d63f7a80fd /src/gui/kernel/qstandardgestures.cpp
parentd0a27b157c6a5d3cf4b75c6b1b71de399733f553 (diff)
downloadQt-c28da4dd467c2763bed5c6b31471f078ac26cee6.zip
Qt-c28da4dd467c2763bed5c6b31471f078ac26cee6.tar.gz
Qt-c28da4dd467c2763bed5c6b31471f078ac26cee6.tar.bz2
Added setting a hotspot on standard gestures
In order for gestures to work in graphicsview the hotspot should be set. The fix adds the hotspot to standard gestures that are shipped with Qt. Task-number: QTBUG-10967 Task-number: QT-3406 Reviewed-by: trustme
Diffstat (limited to 'src/gui/kernel/qstandardgestures.cpp')
-rw-r--r--src/gui/kernel/qstandardgestures.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gui/kernel/qstandardgestures.cpp b/src/gui/kernel/qstandardgestures.cpp
index a575717..bfcfa86 100644
--- a/src/gui/kernel/qstandardgestures.cpp
+++ b/src/gui/kernel/qstandardgestures.cpp
@@ -110,6 +110,7 @@ QGestureRecognizer::Result QPanGestureRecognizer::recognize(QGesture *state,
p1.pos().y() - p1.startPos().y() + p2.pos().y() - p2.startPos().y()) / 2;
if (d->offset.x() > 10 || d->offset.y() > 10 ||
d->offset.x() < -10 || d->offset.y() < -10) {
+ q->setHotSpot(p1.startScreenPos());
result = QGestureRecognizer::TriggerGesture;
} else {
result = QGestureRecognizer::MayBeGesture;
@@ -439,6 +440,7 @@ QGestureRecognizer::Result QTapGestureRecognizer::recognize(QGesture *state,
switch (event->type()) {
case QEvent::TouchBegin: {
d->position = ev->touchPoints().at(0).pos();
+ q->setHotSpot(ev->touchPoints().at(0).screenPos());
result = QGestureRecognizer::TriggerGesture;
break;
}
@@ -521,6 +523,7 @@ QTapAndHoldGestureRecognizer::recognize(QGesture *state, QObject *object,
if (d->timerId)
q->killTimer(d->timerId);
d->timerId = q->startTimer(TimerInterval);
+ q->setHotSpot(ev->touchPoints().at(0).startScreenPos());
result = QGestureRecognizer::TriggerGesture;
break;
case QEvent::TouchEnd: