summaryrefslogtreecommitdiffstats
path: root/src/core/aspects
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire@kdab.com>2016-01-19 11:53:05 +0100
committerPaul Lemire <paul.lemire@kdab.com>2016-01-19 15:21:25 +0000
commit549013598404fa0b9b48c196adf2570c9e2103a8 (patch)
tree52e64ae0c0b4a2f44c1a9876c175ca1ecb30eb74 /src/core/aspects
parentda6a67b131879d0157b9774017c857bdfeff78c2 (diff)
QInputAspect/InputHandler: add EventSourceSetterHelper member
Change-Id: I4445f150016db8a79997ecc5324e42b024b489b8 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/core/aspects')
-rw-r--r--src/core/aspects/qaspectengine.cpp15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/core/aspects/qaspectengine.cpp b/src/core/aspects/qaspectengine.cpp
index eefe020cb..3aa2b0f95 100644
--- a/src/core/aspects/qaspectengine.cpp
+++ b/src/core/aspects/qaspectengine.cpp
@@ -169,18 +169,9 @@ void QAspectEnginePrivate::shutdown()
void QAspectEngine::setData(const QVariantMap &data)
{
Q_D(QAspectEngine);
-
- // We need to initialize the EventFilterService in the main thread
- // as we can register event filters only on QObjects of the same thread
- QObject *eventSource = Q_NULLPTR;
- const QVariant &eventSourceVariant = data.value(QStringLiteral("eventSource"));
- if (eventSourceVariant.isValid() &&
- (eventSource = eventSourceVariant.value<QObject *>()) != Q_NULLPTR) {
- QEventFilterService *eventFilterService = d->m_aspectThread->aspectManager()->serviceLocator()->eventFilterService();
- if (eventFilterService != Q_NULLPTR)
- eventFilterService->initialize(eventSource);
- }
-
+ // Note: setData in the AspectManager is called in the main thread
+ // which in turns calls onInitialize on each aspects in the main thread
+ // We should keep the call to onInitialize in the main thread
QMetaObject::invokeMethod(d->m_aspectThread->aspectManager(),
"setData",
Qt::BlockingQueuedConnection,