diff options
author | Tasuku Suzuki <tasuku.suzuki@nokia.com> | 2010-07-21 08:02:37 (GMT) |
---|---|---|
committer | Bjørn Erik Nilsen <bjorn.nilsen@nokia.com> | 2010-07-21 08:02:37 (GMT) |
commit | 17ae405bd4ff4a96c2e431d76e6bfabf5c1058e6 (patch) | |
tree | d68591423a8d0e0f6e4ad58d0aef8201b3d26d7f /src | |
parent | 656933462ccc4db33d92145c13d9b3d63d638775 (diff) | |
download | Qt-17ae405bd4ff4a96c2e431d76e6bfabf5c1058e6.zip Qt-17ae405bd4ff4a96c2e431d76e6bfabf5c1058e6.tar.gz Qt-17ae405bd4ff4a96c2e431d76e6bfabf5c1058e6.tar.bz2 |
Fix compilation with QT_NO_GRAPHICSVIEW
Merge-request: 751
Reviewed-by: Bjørn Erik Nilsen <bjorn.nilsen@nokia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/kernel/qstandardgestures.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gui/kernel/qstandardgestures.cpp b/src/gui/kernel/qstandardgestures.cpp index e05f8cc..127e150 100644 --- a/src/gui/kernel/qstandardgestures.cpp +++ b/src/gui/kernel/qstandardgestures.cpp @@ -515,11 +515,14 @@ QTapAndHoldGestureRecognizer::recognize(QGesture *state, QObject *object, const QTouchEvent *ev = static_cast<const QTouchEvent *>(event); const QMouseEvent *me = static_cast<const QMouseEvent *>(event); +#ifndef QT_NO_GRAPHICSVIEW const QGraphicsSceneMouseEvent *gsme = static_cast<const QGraphicsSceneMouseEvent *>(event); +#endif enum { TapRadius = 40 }; switch (event->type()) { +#ifndef QT_NO_GRAPHICSVIEW case QEvent::GraphicsSceneMousePress: d->position = gsme->screenPos(); q->setHotSpot(d->position); @@ -527,6 +530,7 @@ QTapAndHoldGestureRecognizer::recognize(QGesture *state, QObject *object, q->killTimer(d->timerId); d->timerId = q->startTimer(QTapAndHoldGesturePrivate::Timeout); return QGestureRecognizer::MayBeGesture; // we don't show a sign of life until the timeout +#endif case QEvent::MouseButtonPress: d->position = me->globalPos(); q->setHotSpot(d->position); @@ -541,7 +545,9 @@ QTapAndHoldGestureRecognizer::recognize(QGesture *state, QObject *object, q->killTimer(d->timerId); d->timerId = q->startTimer(QTapAndHoldGesturePrivate::Timeout); return QGestureRecognizer::MayBeGesture; // we don't show a sign of life until the timeout +#ifndef QT_NO_GRAPHICSVIEW case QEvent::GraphicsSceneMouseRelease: +#endif case QEvent::MouseButtonRelease: case QEvent::TouchEnd: return QGestureRecognizer::CancelGesture; // get out of the MayBeGesture state @@ -559,12 +565,14 @@ QTapAndHoldGestureRecognizer::recognize(QGesture *state, QObject *object, return QGestureRecognizer::MayBeGesture; return QGestureRecognizer::CancelGesture; } +#ifndef QT_NO_GRAPHICSVIEW case QEvent::GraphicsSceneMouseMove: { QPoint delta = gsme->screenPos() - d->position.toPoint(); if (d->timerId && delta.manhattanLength() <= TapRadius) return QGestureRecognizer::MayBeGesture; return QGestureRecognizer::CancelGesture; } +#endif default: return QGestureRecognizer::Ignore; } |