diff options
Diffstat (limited to 'src/gui/kernel/qguiapplication.cpp')
-rw-r--r-- | src/gui/kernel/qguiapplication.cpp | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index b242a3cc68..8e5c290cc6 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -1029,27 +1029,23 @@ void QGuiApplicationPrivate::createPlatformIntegration() } +/*! + Called from QCoreApplication::init() + + Responsible for creating an event dispatcher when QCoreApplication + decides that it needs one (because a custom one has not been set). +*/ void QGuiApplicationPrivate::createEventDispatcher() { + Q_ASSERT(!eventDispatcher); + if (platform_integration == 0) createPlatformIntegration(); - if (!eventDispatcher) { - QAbstractEventDispatcher *eventDispatcher = platform_integration->guiThreadEventDispatcher(); - setEventDispatcher(eventDispatcher); - } -} - -void QGuiApplicationPrivate::setEventDispatcher(QAbstractEventDispatcher *eventDispatcher) -{ - Q_Q(QGuiApplication); - - if (!QCoreApplicationPrivate::eventDispatcher) { - QCoreApplicationPrivate::eventDispatcher = eventDispatcher; - QCoreApplicationPrivate::eventDispatcher->setParent(q); - threadData->eventDispatcher = eventDispatcher; - } + // The platform integration should not mess with the event dispatcher + Q_ASSERT(!eventDispatcher); + eventDispatcher = platform_integration->createEventDispatcher(); } #if defined(QT_DEBUG) && defined(Q_OS_LINUX) |