diff options
author | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2009-08-26 11:23:10 (GMT) |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2009-08-27 12:06:13 (GMT) |
commit | 220bb878d78eadfdfd390ca51c1a24378859d4ba (patch) | |
tree | 3eceaae87c66cef9915c0fca2f2784995ee42e4e /examples/gestures | |
parent | 2391ed9690cca78249744a768cf955d89b0221fc (diff) | |
download | Qt-220bb878d78eadfdfd390ca51c1a24378859d4ba.zip Qt-220bb878d78eadfdfd390ca51c1a24378859d4ba.tar.gz Qt-220bb878d78eadfdfd390ca51c1a24378859d4ba.tar.bz2 |
Cocoa: Implement single touch pan
Diffstat (limited to 'examples/gestures')
-rw-r--r-- | examples/gestures/imageviewer/imagewidget.cpp | 9 | ||||
-rw-r--r-- | examples/gestures/imageviewer/tapandholdgesture.cpp | 2 |
2 files changed, 6 insertions, 5 deletions
diff --git a/examples/gestures/imageviewer/imagewidget.cpp b/examples/gestures/imageviewer/imagewidget.cpp index 1285e9a..7d06303 100644 --- a/examples/gestures/imageviewer/imagewidget.cpp +++ b/examples/gestures/imageviewer/imagewidget.cpp @@ -63,11 +63,14 @@ ImageWidget::ImageWidget(QWidget *parent) verticalOffset = 0; panGesture = new QPanGesture(this); + connect(panGesture, SIGNAL(started()), this, SLOT(gestureTriggered())); + connect(panGesture, SIGNAL(finished()), this, SLOT(gestureTriggered())); + connect(panGesture, SIGNAL(cancelled()), this, SLOT(gestureTriggered())); connect(panGesture, SIGNAL(triggered()), this, SLOT(gestureTriggered())); - tapAndHoldGesture = new TapAndHoldGesture(this); - connect(tapAndHoldGesture, SIGNAL(triggered()), this, SLOT(gestureTriggered())); - connect(tapAndHoldGesture, SIGNAL(finished()), this, SLOT(gestureTriggered())); +// tapAndHoldGesture = new TapAndHoldGesture(this); +// connect(tapAndHoldGesture, SIGNAL(triggered()), this, SLOT(gestureTriggered())); +// connect(tapAndHoldGesture, SIGNAL(finished()), this, SLOT(gestureTriggered())); } void ImageWidget::paintEvent(QPaintEvent*) diff --git a/examples/gestures/imageviewer/tapandholdgesture.cpp b/examples/gestures/imageviewer/tapandholdgesture.cpp index 27458ce..fffe10f 100644 --- a/examples/gestures/imageviewer/tapandholdgesture.cpp +++ b/examples/gestures/imageviewer/tapandholdgesture.cpp @@ -72,8 +72,6 @@ TapAndHoldGesture::TapAndHoldGesture(QWidget *parent) /*! \internal */ bool TapAndHoldGesture::filterEvent(QEvent *event) { - if (!event->spontaneous()) - return false; const QTouchEvent *ev = static_cast<const QTouchEvent*>(event); switch (event->type()) { case QEvent::TouchBegin: { |