diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2015-11-23 07:13:00 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2015-11-23 07:13:00 +0100 |
commit | 1ed7a67a4cef8350103e4ea33b4bbd084f5d4c2d (patch) | |
tree | 03dd7b6f8d9ccc02da6d0d882793ec62c71b00f7 /src/corelib/thread | |
parent | dbb7817e13bc7f7ccb8f04b00a65eb3dcf8d25f8 (diff) | |
parent | 6a2b17eeec2d171d2afa17bdbc36456346bfd13b (diff) |
Merge remote-tracking branch 'origin/5.6' into dev
Conflicts:
src/corelib/kernel/qcoreapplication.cpp
src/corelib/thread/qthread_unix.cpp
Change-Id: Ia08d613c3f0bd08cb6dc3e3a57257207dfd4a099
Diffstat (limited to 'src/corelib/thread')
-rw-r--r-- | src/corelib/thread/qthread_unix.cpp | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp index cc0476461f..9329c515af 100644 --- a/src/corelib/thread/qthread_unix.cpp +++ b/src/corelib/thread/qthread_unix.cpp @@ -36,9 +36,14 @@ #include "qplatformdefs.h" #include <private/qcoreapplication_p.h> +#include <private/qcore_unix_p.h> -#if !defined(QT_NO_GLIB) -# include "../kernel/qeventdispatcher_glib_p.h" +#if defined(Q_OS_OSX) +# include <private/qeventdispatcher_cf_p.h> +#else +# if !defined(QT_NO_GLIB) +# include "../kernel/qeventdispatcher_glib_p.h" +# endif #endif #include <private/qeventdispatcher_unix_p.h> @@ -243,14 +248,23 @@ typedef void*(*QtThreadCallback)(void*); void QThreadPrivate::createEventDispatcher(QThreadData *data) { -#if !defined(QT_NO_GLIB) +#if defined(Q_OS_OSX) + bool ok = false; + int value = qEnvironmentVariableIntValue("QT_EVENT_DISPATCHER_CORE_FOUNDATION", &ok); + if (ok && value > 0) + data->eventDispatcher.storeRelease(new QEventDispatcherCoreFoundation); + else + data->eventDispatcher.storeRelease(new QEventDispatcherUNIX); +#elif !defined(QT_NO_GLIB) if (qEnvironmentVariableIsEmpty("QT_NO_GLIB") && qEnvironmentVariableIsEmpty("QT_NO_THREADED_GLIB") && QEventDispatcherGlib::versionSupported()) data->eventDispatcher.storeRelease(new QEventDispatcherGlib); else -#endif + data->eventDispatcher.storeRelease(new QEventDispatcherUNIX); +#else data->eventDispatcher.storeRelease(new QEventDispatcherUNIX); +#endif data->eventDispatcher.load()->startingUp(); } |