QtDispatch is an additional Qt Module building on QtCore and providing a custom Qt adapted interface to use libdispatch. More...
Classes | |
class | QBlockRunnable |
Provides a QRunnable Implementation for use with blocks on clang or Apple gcc 4.2. More... | |
class | QDispatch |
Single Instance Interface to control the dispatch behaviour. More... | |
class | QDispatchApplication |
Provides a QApplication implementation internally executing the dispatch main queue. More... | |
class | QDispatchCoreApplication |
Provides a QCoreApplication implementation internally executing the dispatch main queue. More... | |
class | QDispatchGroup |
A DispatchGroup is a group of QRunnables dispatched on queues. More... | |
class | QDispatchQueue |
Provides an interface for representing a dispatch queue and methods that can be called to modify or use the queue. More... | |
class | QDispatchSemaphore |
Wraps dispatch semaphores as provided by libDispatch/libXDispatch. More... | |
class | QDispatchSourceType |
Base class of all source types supported by QDispatchSource. More... | |
class | QDispatchSourceTypeSignal |
Uses a signal emitted by a QObject as source and will dispatch the sources handler each time the signal is emitted. More... | |
class | QDispatchSourceTypeIODevice |
Provides a source dispatching the handler each time the QIODevice has new data to be read. More... | |
class | QDispatchSourceTypeIODeviceRead |
class | QDispatchSourceTypeIODeviceWrite |
Provides a source dispatching the handler each time the QIODevice has finished to write data. More... | |
class | QDispatchSourceTypeNetworkManager |
This type will dispatch the handler each time the given network manager finished a QNetworkReply. More... | |
class | QDispatchSource |
Provides a dispatch source. More... | |
class | QDispatchTimer |
Provides a timer executing a block or runnable each time it fires on a given queue. More... | |
class | QIterationBlockRunnable |
Provides a QIterationRunnable implementation for use with blocks on clang or Apple's gcc 4.2. More... | |
class | QIterationRunnable |
Provides a QRunnable Implementation for passing a single parameter to the actual run() implementation. More... | |
Defines | |
#define | Q_DISPATCH_EXPORT Q_DECL_EXPORT |
Typedefs | |
typedef xdispatch::synclock | QDispatchSynclock |
Provides an easy locking mechanism used to ensure the threadsafety of a code area. | |
Functions | |
Q_DECL_EXPORT QDebug | operator<< (QDebug, const QDispatchGroup &) |
Q_DECL_EXPORT QDebug | operator<< (QDebug dbg, const QDispatchQueue *q) |
Q_DECL_EXPORT QDebug | operator<< (QDebug dbg, const QDispatchQueue &q) |
Q_DECL_EXPORT QDebug | operator<< (QDebug, const QDispatchSemaphore &) |
QtDispatch is an additional Qt Module building on QtCore and providing a custom Qt adapted interface to use libdispatch.
This interface is fully compatible with the generic C++ interface provided by libxdispatch.
As integration into Qt, it is possible to dispatch QRunnables onto groups and queues the same way as when executing them on a QThreadPool. Going along with that we added QBlockRunnable, a simple QRunnable created by passing an individual block.
For integrating the main queue into your Qt Application there is a QDispatchApplication which can be used as a drop-in replacement to QApplication. It will call xdispatch::exec() internally and ensure that all work dispatched to the main queue is executed on the main/gui thread. That way it is very easy to send gui updates to the main thread. All other functionality is equal to that of QApplication.
You can use QtDispach (in case you have Qt > 4.6 available on your system) by including the QtDispatch header or one of the individual modules - this will automatically include all other needed headers as well. Below you find a list of the available classes.
The corresponding headers have the same name and can be included all by once using
#include <QtDispatch/QtDispatch>
Please link your program with qtdispatch and xdispatch.
#define Q_DISPATCH_EXPORT Q_DECL_EXPORT |
Definition at line 44 of file qdispatchglobal.h.
typedef xdispatch::synclock QDispatchSynclock |
Provides an easy locking mechanism used to ensure the threadsafety of a code area.
Can be used interchangeable with xdispatch::synclock
Definition at line 65 of file qdispatchglobal.h.
Q_DECL_EXPORT QDebug operator<< | ( | QDebug | , |
const QDispatchSemaphore & | |||
) |
Q_DECL_EXPORT QDebug operator<< | ( | QDebug | dbg, |
const QDispatchQueue * | q | ||
) |
Q_DECL_EXPORT QDebug operator<< | ( | QDebug | , |
const QDispatchGroup & | |||
) |
Q_DECL_EXPORT QDebug operator<< | ( | QDebug | dbg, |
const QDispatchQueue & | q | ||
) |