diff options
author | Friedemann Kleint <Friedemann.Kleint@digia.com> | 2014-03-28 11:45:00 (GMT) |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-28 14:39:43 (GMT) |
commit | 215a78618b185a71f660201c902da51360d8c30d (patch) | |
tree | 206947ea7c631cbc0423ecbc8879ab7dc6d5de61 /src | |
parent | 1fa7deed0a6441b20493c49bb3d5b53e55a9bcae (diff) | |
download | Qt-215a78618b185a71f660201c902da51360d8c30d.zip Qt-215a78618b185a71f660201c902da51360d8c30d.tar.gz Qt-215a78618b185a71f660201c902da51360d8c30d.tar.bz2 |
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>
(cherry picked from qtbase/9b28ab3f38e21f2e1498dea5dd761d22d72fb1ac)
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/kernel/qapplication.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index f403584..428588d 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -3906,16 +3906,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 |