Swipe gesture not recognized
Hi! I'm trying to enable a swipe gesture. I created a test class like this following the documentation and the example:
Code:
GestureLabel
::GestureLabel(QWidget *parent
) :{
grabGesture(Qt::SwipeGesture);
}
bool GestureLabel
::event(QEvent *e
) {
if (e
->type
() == QEvent::Gesture) return gestureEvent(static_cast<QGestureEvent*>(e));
}
bool GestureLabel::gestureEvent(QGestureEvent *event)
{
if (QGesture *swipe = event->gesture(Qt::SwipeGesture))
swipeTriggered(static_cast<QSwipeGesture *>(swipe));
return true;
}
void GestureLabel::swipeTriggered(QSwipeGesture *gesture)
{
QMessageBox::information(this,
"Gesture!",
"Gesture!");
}
Seems not to recognize swipes. I tried to put a breakpoint in line:
Code:
return gestureEvent(static_cast<QGestureEvent*>(e));
and seems the execution doesn't stop there. Is there anything I'm doing wrong? Am I lacking anything?
Thanks for any advice!
Re: Swipe gesture not recognized
sorry for bumping. I have the same problem: no swipe gesture detection at all. Tap, tapandhold, pan, pinch works ok ..
did you find solution?
Re: Swipe gesture not recognized
hi,
i want to make pinch gesture but i d'ont know how can i begin ? did sommeone to help me please ?
hi,
i want to make pinch gesture but i d'ont know how can i begin ? did sommeone to help me please ?