Pass events to QGestureManager from the main (GUI) thread only.

Task-number: QTBUG-20946

Change-Id: I964452c1e97bd3d3a521e33abeb2f7d8cdbc89a9
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
bb10
Friedemann Kleint 2014-03-28 12:45:00 +01:00 committed by The Qt Project
parent d4a8a29e0b
commit 9b28ab3f38
1 changed files with 12 additions and 9 deletions

View File

@ -2861,16 +2861,19 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
case QEvent::NetworkReplyUpdated:
break;
default:
if (receiver->isWidgetType()) {
if (d->gestureManager->filterEvent(static_cast<QWidget *>(receiver), e))
return true;
} else {
// a special case for events that go to QGesture objects.
// We pass the object to the gesture manager and it'll figure
// out if it's QGesture or not.
if (d->gestureManager->filterEvent(receiver, e))
return true;
if (d->gestureManager->thread() == QThread::currentThread()) {
if (receiver->isWidgetType()) {
if (d->gestureManager->filterEvent(static_cast<QWidget *>(receiver), e))
return true;
} else {
// a special case for events that go to QGesture objects.
// We pass the object to the gesture manager and it'll figure
// out if it's QGesture or not.
if (d->gestureManager->filterEvent(receiver, e))
return true;
}
}
break;
}
}
#endif // QT_NO_GESTURES