diff options
author | Sven Anderson <Sven.Anderson@snom.com> | 2011-09-08 17:40:55 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-11-15 10:16:12 +0100 |
commit | 2b7d98ef8fbd6cf49326fa0bbf154e9bacbb7b49 (patch) | |
tree | 250f2752acb679a237504ea70888b0ad5efa1251 /src/corelib/kernel/qcoreapplication.h | |
parent | 51b7d3c8b621c2de6f98f465f478ec574bb14195 (diff) |
Allow to create a custom event dispatcher for specific QThreads.
QAbstractEventDispatcher() does no longer install itself into the current
thread. Instead the new methods QThread::setEventDispatcher() and
QCoreApplication::setEventDispatcher() allow to install a custom event
dispatcher into any QThread as long as there is no default event dispatcher
created yet. That is, before the thread has been started with
QThread::start() or, in case of the main thread, before QCoreApplication has
been instantiated.
Change-Id: I7367e13d8d8aebed5a5651260bb69b8818eb1b90
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Diffstat (limited to 'src/corelib/kernel/qcoreapplication.h')
-rw-r--r-- | src/corelib/kernel/qcoreapplication.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/corelib/kernel/qcoreapplication.h b/src/corelib/kernel/qcoreapplication.h index ce3f349844..4d3ee9bc7a 100644 --- a/src/corelib/kernel/qcoreapplication.h +++ b/src/corelib/kernel/qcoreapplication.h @@ -61,6 +61,7 @@ class QTextCodec; class QTranslator; class QPostEventList; class QStringList; +class QAbstractEventDispatcher; #define qApp QCoreApplication::instance() @@ -114,6 +115,8 @@ public: static void removePostedEvents(QObject *receiver); static void removePostedEvents(QObject *receiver, int eventType); static bool hasPendingEvents(); + static QAbstractEventDispatcher *eventDispatcher(); + static void setEventDispatcher(QAbstractEventDispatcher *eventDispatcher); virtual bool notify(QObject *, QEvent *); |