Guesture for widgets



  • Hello,
    I develop a app for a tablet. Until now I use only the click-event of the widgets (buttons). Now I need a more advanced user interface : Processing of Long-touch and swipe left/right events.
    It is not really clear form me how to implement this. I found that I must overwrite the event function like below.

    bool MyWidget::event(QEvent *event)
     {
         if (event->type() == QEvent::Gesture)
             return gestureEvent(static_cast<QGestureEvent*>(event));
         return QWidget::event(event);
     }
    

    Does this mean that the standard widgets do not support gestures in general and I must subclass all widgets and take this new widget for my projects?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.