summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwinnativepangesturerecognizer_win.cpp
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-11-03 11:55:19 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-11-03 12:25:44 (GMT)
commit51c9b68425c1d3fe64a08e6ef0357fbd6bdd8f8a (patch)
tree9ca3474ae5b9f051c3414dcbb40d8efb9fff14b9 /src/gui/kernel/qwinnativepangesturerecognizer_win.cpp
parent14a1a9af8ae1b3d2379e6f8c24536afb20b39509 (diff)
downloadQt-51c9b68425c1d3fe64a08e6ef0357fbd6bdd8f8a.zip
Qt-51c9b68425c1d3fe64a08e6ef0357fbd6bdd8f8a.tar.gz
Qt-51c9b68425c1d3fe64a08e6ef0357fbd6bdd8f8a.tar.bz2
Compile fix after the last gesture api change
Reviewed-by: trustme
Diffstat (limited to 'src/gui/kernel/qwinnativepangesturerecognizer_win.cpp')
-rw-r--r--src/gui/kernel/qwinnativepangesturerecognizer_win.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/gui/kernel/qwinnativepangesturerecognizer_win.cpp b/src/gui/kernel/qwinnativepangesturerecognizer_win.cpp
index c3c8a28..5fceb13 100644
--- a/src/gui/kernel/qwinnativepangesturerecognizer_win.cpp
+++ b/src/gui/kernel/qwinnativepangesturerecognizer_win.cpp
@@ -56,7 +56,7 @@ QWinNativePanGestureRecognizer::QWinNativePanGestureRecognizer()
{
}
-QGesture *QWinNativePanGestureRecognizer::createGesture(QObject *target)
+QGesture *QWinNativePanGestureRecognizer::create(QObject *target)
{
if (!target)
return new QPanGesture; // a special case
@@ -73,7 +73,9 @@ QGesture *QWinNativePanGestureRecognizer::createGesture(QObject *target)
return new QPanGesture;
}
-QGestureRecognizer::Result QWinNativePanGestureRecognizer::filterEvent(QGesture *state, QObject *, QEvent *event)
+QGestureRecognizer::Result QWinNativePanGestureRecognizer::recognize(QGesture *state,
+ QObject *,
+ QEvent *event)
{
QPanGesture *q = static_cast<QPanGesture*>(state);
QPanGesturePrivate *d = q->d_func();
@@ -85,26 +87,25 @@ QGestureRecognizer::Result QWinNativePanGestureRecognizer::filterEvent(QGesture
case QNativeGestureEvent::GestureBegin:
break;
case QNativeGestureEvent::Pan:
- result = QGestureRecognizer::GestureTriggered;
+ result = QGestureRecognizer::TriggerGesture;
event->accept();
break;
case QNativeGestureEvent::GestureEnd:
if (q->state() == Qt::NoGesture)
return QGestureRecognizer::Ignore; // some other gesture has ended
- result = QGestureRecognizer::GestureFinished;
+ result = QGestureRecognizer::FinishGesture;
break;
default:
return QGestureRecognizer::Ignore;
}
if (q->state() == Qt::NoGesture) {
- d->lastOffset = d->totalOffset = d->offset = QPointF();
+ d->lastOffset = d->offset = QPointF();
+ d->startPosition = ev->position;
} else {
d->lastOffset = d->offset;
- d->offset = QPointF(ev->position.x() - d->lastPosition.x(),
- ev->position.y() - d->lastPosition.y());
- d->totalOffset += d->offset;
+ d->offset = QPointF(ev->position.x() - d->startPosition.x(),
+ ev->position.y() - d->startPosition.y());
}
- d->lastPosition = ev->position;
}
return result;
}
@@ -114,8 +115,8 @@ void QWinNativePanGestureRecognizer::reset(QGesture *state)
QPanGesture *pan = static_cast<QPanGesture*>(state);
QPanGesturePrivate *d = pan->d_func();
- d->totalOffset = d->lastOffset = d->offset = QPointF();
- d->lastPosition = QPoint();
+ d->lastOffset = d->offset = QPointF();
+ d->startPosition = QPoint();
d->acceleration = 0;
QGestureRecognizer::reset(state);