Don't expect QCoreApplictionPrivate::eventDispatcher to be set

QCoreApplication::setEventDispatcher sets the dispatcher on the current
thread, not on QCoreApplictionPrivate, so when running init() we don't
have an event dispatcher set.

Change-Id: Ia008e68b70777779ab14f1f7b9eeadac9adbcf7b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Tor Arne Vestbø 2018-02-13 14:47:18 +01:00
parent 4266c54128
commit 550b8c342b

View File

@ -848,8 +848,9 @@ void QCoreApplicationPrivate::init()
#ifndef QT_NO_QOBJECT
// use the event dispatcher created by the app programmer (if any)
if (!eventDispatcher)
eventDispatcher = threadData->eventDispatcher.load();
Q_ASSERT(!eventDispatcher);
eventDispatcher = threadData->eventDispatcher.load();
// otherwise we create one
if (!eventDispatcher)
createEventDispatcher();