QAbstractEventDispatcher

Synopsis

Functions

Virtual functions

Signals

Static functions

Detailed Description

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.

class PySide.QtCore.QAbstractEventDispatcher([parent=None])
Parameters:parentPySide.QtCore.QObject

Constructs a new event dispatcher with the given parent .

PySide.QtCore.QAbstractEventDispatcher.aboutToBlock()
PySide.QtCore.QAbstractEventDispatcher.awake()
PySide.QtCore.QAbstractEventDispatcher.closingDown()
PySide.QtCore.QAbstractEventDispatcher.flush()

Flushes the event queue. This normally returns almost immediately. Does nothing on platforms other than X11.

PySide.QtCore.QAbstractEventDispatcher.hasPendingEvents()
Return type:PySide.QtCore.bool

Returns true if there is an event waiting; otherwise returns false.

static PySide.QtCore.QAbstractEventDispatcher.instance([thread=None])
Parameters:threadPySide.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.

PySide.QtCore.QAbstractEventDispatcher.interrupt()

Interrupts event dispatching; i.e. the event dispatcher will return from PySide.QtCore.QAbstractEventDispatcher.processEvents() as soon as possible.

PySide.QtCore.QAbstractEventDispatcher.processEvents(flags)
Parameters:flagsPySide.QtCore.QEventLoop.ProcessEventsFlags
Return type:PySide.QtCore.bool
PySide.QtCore.QAbstractEventDispatcher.registerSocketNotifier(notifier)
Parameters:notifierPySide.QtCore.QSocketNotifier

Registers notifier with the event loop. Subclasses must implement this method to tie a socket notifier into another event loop.

PySide.QtCore.QAbstractEventDispatcher.registerTimer(timerId, interval, object)
Parameters:

Register a timer with the specified timerId and interval for the given object .

PySide.QtCore.QAbstractEventDispatcher.registerTimer(interval, object)
Parameters:
Return type:

PySide.QtCore.int

Registers a timer with the specified interval for the given object .

PySide.QtCore.QAbstractEventDispatcher.registeredTimers(object)
Parameters:objectPySide.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.

PySide.QtCore.QAbstractEventDispatcher.startingUp()
PySide.QtCore.QAbstractEventDispatcher.unregisterSocketNotifier(notifier)
Parameters:notifierPySide.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.

PySide.QtCore.QAbstractEventDispatcher.unregisterTimer(timerId)
Parameters:timerIdPySide.QtCore.int
Return type:PySide.QtCore.bool

Unregisters the timer with the given timerId . Returns true if successful; otherwise returns false.

PySide.QtCore.QAbstractEventDispatcher.unregisterTimers(object)
Parameters:objectPySide.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.

PySide.QtCore.QAbstractEventDispatcher.wakeUp()

Wakes up the event loop.