diff options
Diffstat (limited to 'src/gui/kernel/qguiapplication.cpp')
-rw-r--r-- | src/gui/kernel/qguiapplication.cpp | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index b242a3cc68..bde8d99a1c 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) @@ -2939,7 +2935,7 @@ static inline void applyWindowCursor(const QList<QWindow *> &l) restoreOverrideCursor(), otherwise the stack will never be emptied. Example: - \snippet code/src_gui_kernel_qapplication_x11.cpp 0 + \snippet code/src_gui_kernel_qguiapplication_x11.cpp 0 \sa overrideCursor(), restoreOverrideCursor(), changeOverrideCursor(), QWidget::setCursor() @@ -2999,7 +2995,7 @@ QStyleHints *QGuiApplication::styleHints() This function must be called before creating the QGuiApplication object, like this: - \snippet code/src_gui_kernel_qapplication.cpp 6 + \snippet code/src_gui_kernel_qguiapplication.cpp 0 \sa desktopSettingsAware() */ |