diff options
author | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-10-30 16:14:53 (GMT) |
---|---|---|
committer | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-11-03 10:26:05 (GMT) |
commit | 54db3afc9797a3adf5a38f35f6338960924e9e1a (patch) | |
tree | 7ef984555683aeeba5e8963ae9206786181d08f1 /examples/gestures/imagegestures | |
parent | b7b4df9c87805be372fa6f74422e0f4648a5d520 (diff) | |
download | Qt-54db3afc9797a3adf5a38f35f6338960924e9e1a.zip Qt-54db3afc9797a3adf5a38f35f6338960924e9e1a.tar.gz Qt-54db3afc9797a3adf5a38f35f6338960924e9e1a.tar.bz2 |
Implemented pinch gesture recognizer.
Reviewed-by: trustme
Diffstat (limited to 'examples/gestures/imagegestures')
-rw-r--r-- | examples/gestures/imagegestures/imagewidget.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/examples/gestures/imagegestures/imagewidget.cpp b/examples/gestures/imagegestures/imagewidget.cpp index 28de6da..c798fcc 100644 --- a/examples/gestures/imagegestures/imagewidget.cpp +++ b/examples/gestures/imagegestures/imagewidget.cpp @@ -102,17 +102,13 @@ void ImageWidget::mouseDoubleClickEvent(QMouseEvent *) //! [gesture event handler] bool ImageWidget::gestureEvent(QGestureEvent *event) { - if (QGesture *pan = event->gesture(Qt::PanGesture)) { - panTriggered(static_cast<QPanGesture*>(pan)); - return true; - } else if (QGesture *pinch = event->gesture(Qt::PinchGesture)) { - pinchTriggered(static_cast<QPinchGesture*>(pinch)); - return true; - } else if (QGesture *swipe = event->gesture(Qt::SwipeGesture)) { - swipeTriggered(static_cast<QSwipeGesture*>(swipe)); - return true; - } - return false; + if (QGesture *pan = event->gesture(Qt::PanGesture)) + panTriggered(static_cast<QPanGesture *>(pan)); + if (QGesture *pinch = event->gesture(Qt::PinchGesture)) + pinchTriggered(static_cast<QPinchGesture *>(pinch)); + if (QGesture *swipe = event->gesture(Qt::SwipeGesture)) + swipeTriggered(static_cast<QSwipeGesture *>(swipe)); + return true; } //! [gesture event handler] |