Friends,
I have directed my mobile app to accept the following Gestures
grabGesture(Qt::TapGesture);
grabGesture(Qt::TapAndHoldGesture);
grabGesture(Qt::PanGesture);
grabGesture(Qt::TapGesture);
grabGesture(Qt::TapAndHoldGesture);
grabGesture(Qt::PanGesture);
To copy to clipboard, switch view to plain text mode
and I am handling the gestures as follows...
bool client
::event(QEvent *event
) {
if (event
->type
() == QEvent::Gesture) gestureEvent(static_cast<QGestureEvent*>(event));
else
}
void client::gestureEvent(QGestureEvent *event)
{
if(event->gesture(Qt::TapGesture))
{
ui->statusBox->appendPlainText("Tap");
}
else if(event->gesture(Qt::TapAndHoldGesture))
{
ui->statusBox->appendPlainText("Tap and Hold");
}
else if(event->gesture(Qt::PanGesture))
{
ui->statusBox->appendPlainText("Pan Gesture");
}
else
ui->statusBox->appendPlainText("Some Gesture");
}
bool client::event(QEvent *event)
{
if (event->type() == QEvent::Gesture)
gestureEvent(static_cast<QGestureEvent*>(event));
else
QWidget::event(event);
}
void client::gestureEvent(QGestureEvent *event)
{
if(event->gesture(Qt::TapGesture))
{
ui->statusBox->appendPlainText("Tap");
}
else if(event->gesture(Qt::TapAndHoldGesture))
{
ui->statusBox->appendPlainText("Tap and Hold");
}
else if(event->gesture(Qt::PanGesture))
{
ui->statusBox->appendPlainText("Pan Gesture");
}
else
ui->statusBox->appendPlainText("Some Gesture");
}
To copy to clipboard, switch view to plain text mode
so I am just printing the Gesture Name in a textbox...but out of the three gestures on TapAndHold gesture is working, the other two are not working on the Maemo Fermantle or S^3 simulator...pls help
Bookmarks