The PySide.QtCore.QAbstractEventDispatcher class provides an interface to manage Qt’s event queue.
An event dispatcher receives events from the window system and other sources. It then sends them to the PySide.QtCore.QCoreApplication or PySide.QtGui.QApplication instance for processing and delivery. PySide.QtCore.QAbstractEventDispatcher provides fine-grained control over event delivery.
For simple control of event processing use QCoreApplication.processEvents() .
For finer control of the application’s event loop, call PySide.QtCore.QAbstractEventDispatcher.instance() and call functions on the PySide.QtCore.QAbstractEventDispatcher object that is returned. If you want to use your own instance of PySide.QtCore.QAbstractEventDispatcher or of a PySide.QtCore.QAbstractEventDispatcher subclass, you must create your instance before you create the PySide.QtGui.QApplication object.
The main event loop is started by calling QCoreApplication.exec() , and stopped by calling QCoreApplication.exit() . Local event loops can be created using PySide.QtCore.QEventLoop .
Programs that perform long operations can call PySide.QtCore.QAbstractEventDispatcher.processEvents() with a bitwise OR combination of various QEventLoop.ProcessEventsFlag values to control which events should be delivered.
PySide.QtCore.QAbstractEventDispatcher also allows the integration of an external event loop with the Qt event loop. For example, the Motif Extension includes a reimplementation of PySide.QtCore.QAbstractEventDispatcher that merges Qt and Motif events together.
Parameters: | parent – PySide.QtCore.QObject |
---|
Constructs a new event dispatcher with the given parent .
Flushes the event queue. This normally returns almost immediately. Does nothing on platforms other than X11.
Return type: | PySide.QtCore.bool |
---|
Returns true if there is an event waiting; otherwise returns false.
Parameters: | thread – PySide.QtCore.QThread |
---|---|
Return type: | PySide.QtCore.QAbstractEventDispatcher |
Returns a pointer to the event dispatcher object for the specified thread . If thread is zero, the current thread is used. If no event dispatcher exists for the specified thread, this function returns 0.
Note
If Qt is built without thread support, the thread argument is ignored.
Interrupts event dispatching; i.e. the event dispatcher will return from PySide.QtCore.QAbstractEventDispatcher.processEvents() as soon as possible.
Parameters: | flags – PySide.QtCore.QEventLoop.ProcessEventsFlags |
---|---|
Return type: | PySide.QtCore.bool |
Parameters: | notifier – PySide.QtCore.QSocketNotifier |
---|
Registers notifier with the event loop. Subclasses must implement this method to tie a socket notifier into another event loop.
Parameters: |
|
---|
Register a timer with the specified timerId and interval for the given object .
Parameters: |
|
---|---|
Return type: | PySide.QtCore.int |
Registers a timer with the specified interval for the given object .
Parameters: | object – PySide.QtCore.QObject |
---|---|
Return type: |
Returns a list of registered timers for object . The timer ID is the first member in each pair; the interval is the second.
Parameters: | notifier – PySide.QtCore.QSocketNotifier |
---|
Unregisters notifier from the event dispatcher. Subclasses must reimplement this method to tie a socket notifier into another event loop. Reimplementations must call the base implementation.
Parameters: | timerId – PySide.QtCore.int |
---|---|
Return type: | PySide.QtCore.bool |
Unregisters the timer with the given timerId . Returns true if successful; otherwise returns false.
Parameters: | object – PySide.QtCore.QObject |
---|---|
Return type: | PySide.QtCore.bool |
Unregisters all the timers associated with the given object . Returns true if all timers were successful removed; otherwise returns false.
Wakes up the event loop.