title: Qt Swipe Gesture not working
body: <p>I am trying to enable a swipe gesture in my widget, but unfortunately it is not working.
  I followed the documentations and examples that are provided by Qt.</p>
  
  <p>Here is a part of my code:</p>
  
  <pre><code>MainWindow::MainWindow(QWidget *parent) :
      QMainWindow(parent),
      ui(new Ui::MainWindow)
  {
      grabGesture(Qt::SwipeGesture);
  }
  
  bool MainWindow::event(QEvent *event){
      if (event-&gt;type() == QEvent::Gesture)
          return gestureEvent(static_cast&lt;QGestureEvent*&gt;(event));
      return QWidget::event(event);
  }
  
  bool MainWindow::gestureEvent(QGestureEvent *event){
      if (QGesture *swipe = event-&gt;gesture(Qt::SwipeGesture))
          swipeTriggered(static_cast&lt;QSwipeGesture *&gt;(swipe));
      return true;
  }
  
  void MainWindow::swipeTriggered(QSwipeGesture *gesture){
      if (gesture-&gt;state() == Qt::GestureFinished){
          if (gesture-&gt;verticalDirection() == QSwipeGesture::Up)
              goButtomLabel();
          if (gesture-&gt;verticalDirection() == QSwipeGesture::Down)
              goUpperLabel();
          update();
      }
  }
  
  void MainWindow::goButtomLabel(){
      // does something here
  }
  
  void MainWindow::goUpperLabel(){
     // does something here
  }
  </code></pre>
  
  <p>Is there anything wrong? Did I forget something?</p>
  
  <p>I am new to Qt and also a beginner with C++, so I would really appreciate your help.</p>
  
  <p>Thank you so much!</p>