diff options
author | Sergio Ahumada <sergio.ahumada@digia.com> | 2013-10-09 15:50:11 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-10-09 15:50:11 +0200 |
commit | da0cb32b8ee7cc4a991a59420a411898e63a660e (patch) | |
tree | 9ed8e190a6543518f9b082afc5a380f659da0220 /src/gui/kernel/qguiapplication.cpp | |
parent | 7f3e3c1099f42cff46bbd267c70587bcf72024fc (diff) | |
parent | d8fc0da235b2bd566b2b6f1e21218afdf2f34eb3 (diff) |
Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev
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 07ee8e9a64..eeeb5aaf90 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) @@ -2942,7 +2938,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() @@ -3002,7 +2998,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() */ |