diff --git a/gestures.cc b/gestures.cc index 6b807e66..c0c07b73 100644 --- a/gestures.cc +++ b/gestures.cc @@ -45,7 +45,8 @@ QSwipeGesture::SwipeDirection getVerticalDirection( qreal angle ) return QSwipeGesture::NoDirection; } -GDPinchGesture::GDPinchGesture() : +GDPinchGesture::GDPinchGesture( QObject * parent ) : +QGesture( parent ), isNewSequence( true ) { } @@ -55,7 +56,7 @@ QGesture * GDPinchGestureRecognizer::create( QObject * pTarget ) if ( pTarget && pTarget->isWidgetType()) { static_cast< QWidget * >( pTarget )->setAttribute( Qt::WA_AcceptTouchEvents ); } - QGesture *pGesture = new GDPinchGesture; + QGesture *pGesture = new GDPinchGesture( pTarget ); return pGesture; } @@ -161,7 +162,8 @@ QGestureRecognizer::Result GDPinchGestureRecognizer::recognize( QGesture * state } -GDSwipeGesture::GDSwipeGesture() : +GDSwipeGesture::GDSwipeGesture( QObject * parent ) : +QGesture( parent ), vertDirection( QSwipeGesture::NoDirection ), horizDirection( QSwipeGesture::NoDirection ), started( false ) @@ -173,7 +175,7 @@ QGesture * GDSwipeGestureRecognizer::create( QObject * pTarget ) if ( pTarget && pTarget->isWidgetType() ) { static_cast< QWidget * >( pTarget )->setAttribute( Qt::WA_AcceptTouchEvents ); } - QGesture *pGesture = new GDSwipeGesture; + QGesture *pGesture = new GDSwipeGesture( pTarget ); return pGesture; } diff --git a/gestures.hh b/gestures.hh index fa57fa23..35011618 100644 --- a/gestures.hh +++ b/gestures.hh @@ -36,7 +36,7 @@ class GDPinchGestureRecognizer; class GDPinchGesture : public QGesture { public: - GDPinchGesture(); + GDPinchGesture( QObject * parent ); bool isScaleChanged() const { return scaleChanged; } @@ -65,7 +65,7 @@ class GDSwipeGestureRecognizer; class GDSwipeGesture : public QGesture { public: - GDSwipeGesture(); + GDSwipeGesture( QObject * parent ); QSwipeGesture::SwipeDirection getHorizDirection() const { return horizDirection; } QSwipeGesture::SwipeDirection getVertDirection() const diff --git a/mainwindow.cc b/mainwindow.cc index ea3ecc1d..ce0c9956 100644 --- a/mainwindow.cc +++ b/mainwindow.cc @@ -982,7 +982,7 @@ MainWindow::~MainWindow() #if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) ui.centralWidget->ungrabGesture( Gestures::GDPinchGestureType ); ui.centralWidget->ungrabGesture( Gestures::GDSwipeGestureType ); - Gestures::unregisterRecognizers(); +// Gestures::unregisterRecognizers(); #endif // Close all tabs -- they should be destroyed before network managers