Instead of always accepting touch events, do that only if we are
generating mouse events for non accepted ones. This enables
QQuickWindow subclasses to detect if a touch event was indeed
handled by QQuickWindow.
Change-Id: I73512fb3597131c2296d6cdc7b3d5c8454b159b6
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
QTouchEvent *touch = static_cast<QTouchEvent*>(e);
d->translateTouchEvent(touch);
d->deliverTouchEvent(touch);
- // we consume all touch events ourselves to avoid duplicate
- // mouse delivery by QtGui mouse synthesis
- e->accept();
+ if (Q_LIKELY(qApp->testAttribute(Qt::AA_SynthesizeMouseForUnhandledTouchEvents))) {
+ // we consume all touch events ourselves to avoid duplicate
+ // mouse delivery by QtGui mouse synthesis
+ e->accept();
+ }
return true;
}
break;