|
| QAbstractEventDispatcher (QObject *parent=nullptr) |
|
| ~QAbstractEventDispatcher () |
|
bool | filterNativeEvent (const QByteArray &eventType, void *message, long *result) |
|
virtual void | flush () = 0 |
|
virtual bool | hasPendingEvents () = 0 |
|
void | installNativeEventFilter (QAbstractNativeEventFilter *filterObj) |
|
virtual void | interrupt () = 0 |
|
virtual bool | processEvents (QEventLoop::ProcessEventsFlags flags) = 0 |
|
virtual QList< QTimerInfo > | registeredTimers (QObject *object) const = 0 |
|
virtual bool | registerEventNotifier (QWinEventNotifier *notifier) = 0 |
|
virtual void | registerSocketNotifier (QSocketNotifier *notifier) = 0 |
|
int | registerTimer (int interval, Qt::TimerType timerType, QObject *object) |
|
virtual void | registerTimer (int timerId, int interval, Qt::TimerType timerType, QObject *object) = 0 |
|
virtual int | remainingTime (int timerId) = 0 |
|
void | removeNativeEventFilter (QAbstractNativeEventFilter *filterObj) |
|
virtual void | unregisterEventNotifier (QWinEventNotifier *notifier) = 0 |
|
virtual void | unregisterSocketNotifier (QSocketNotifier *notifier) = 0 |
|
virtual bool | unregisterTimer (int timerId) = 0 |
|
virtual bool | unregisterTimers (QObject *object) = 0 |
|
virtual void | wakeUp () = 0 |
|
| QObject (QObject *parent=nullptr) |
|
| ~QObject () |
|
bool | blockSignals (bool block) |
|
const QList< QObject * > & | children () const |
|
bool | connect (const QObject *sender, const QString &signalMethod, const QString &location, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection) |
|
bool | connect (const QObject *sender, const QString &signalMethod, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection) |
|
bool | disconnect (const QObject *receiver, const QString &slotMethod=QString ()) const |
|
bool | disconnect (const QString &signalMethod, const QString &location, const QObject *receiver=nullptr, const QString &slotMethod=QString ()) const |
|
bool | disconnect (const QString &signalMethod=QString (), const QObject *receiver=nullptr, const QString &slotMethod=QString ()) const |
|
void | dumpObjectInfo () |
|
void | dumpObjectTree () |
|
QList< QString > | dynamicPropertyNames () const |
|
virtual bool | event (QEvent *event) |
|
virtual bool | eventFilter (QObject *watched, QEvent *event) |
|
template<typename T > |
T | findChild (const QString &childName=QString ()) const |
|
template<class T > |
QList< T > | findChildren (const QRegularExpression ®Exp, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
|
template<class T > |
QList< T > | findChildren (const QString &childName=QString (), Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
|
bool | inherits (const QString &className) const |
|
void | installEventFilter (QObject *filterObj) |
|
bool | isWidgetType () const |
|
bool | isWindowType () const |
|
void | killTimer (int id) |
|
const QMetaObject * | metaObject () const |
|
void | moveToThread (QThread *targetThread) |
|
QString | objectName () const |
|
QObject * | parent () const |
|
template<class T = QVariant> |
T | property (const QString &name) const |
|
void | removeEventFilter (QObject *obj) |
|
void | setObjectName (const QString &name) |
|
void | setParent (QObject *parent) |
|
bool | setProperty (const QString &name, const QVariant &value) |
|
bool | signalsBlocked () const |
|
int | startTimer (int interval, Qt::TimerType timerType=Qt::CoarseTimer) |
|
QThread * | thread () const |
|
|
static QAbstractEventDispatcher * | instance (QThread *thread=nullptr) |
|
static bool | connect (const QObject *sender, const QMetaMethod &signalMethod, const QObject *receiver, const QMetaMethod &slotMethod, Qt::ConnectionType type=Qt::AutoConnection) |
|
static bool | connect (const QObject *sender, const QString &signalMethod, const QObject *receiver, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection, const QString &location=QString ()) |
|
static bool | connect (const QObject *sender, const QString &signalMethod, const QString &location, const QObject *receiver, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection) |
|
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class SlotClass , class... SlotArgs, class SlotReturn > |
static bool | connect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, SlotReturn (SlotClass::*slotMethod)(SlotArgs...), Qt::ConnectionType type=Qt::AutoConnection) |
|
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class T > |
static bool | connect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, T slotLambda, Qt::ConnectionType type=Qt::AutoConnection) |
|
static bool | disconnect (const QObject *sender, const QMetaMethod &signalMethod, const QObject *receiver, const QMetaMethod &slotMethod) |
|
static bool | disconnect (const QObject *sender, const QString &signalMethod, const QObject *receiver, const QString &slotMethod) |
|
static bool | disconnect (const QObject *sender, const QString &signalMethod, const QString &location, const QObject *receiver, const QString &slotMethod) |
|
static bool | disconnect (const QObject *sender, std::nullptr_t, const QObject *receiver, std::nullptr_t) |
|
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class SlotClass , class... SlotArgs, class SlotReturn > |
static bool | disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, SlotReturn (SlotClass::*slotMethod)(SlotArgs...)) |
|
template<class Sender , class SignalClass , class... SignalArgs, class Receiver > |
static bool | disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, std::nullptr_t slotMethod=nullptr) |
|
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class T > |
static bool | disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, T slotMethod) |
|
static QMetaObject & | staticMetaObject () |
|
static QString | tr (const char *text, const char *comment=nullptr, std::optional< int > numArg=std::optional< int >()) |
|
An event dispatcher receives events from the window system and other sources. It then sends them to the QCoreApplication or QApplication instance for processing and delivery. 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 instance() and call functions on the QAbstractEventDispatcher object that is returned. If you want to use your own instance of QAbstractEventDispatcher or of a QAbstractEventDispatcher subclass, you must create your instance before you create the 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 QEventLoop.
Programs which perform long operations can call processEvents() with a bitwise OR combination of various QEventLoop::ProcessEventsFlag values to control which events should be delivered.
QAbstractEventDispatcher also allows the integration of an external event loop with the CopperSpice event loop.
- See also
- QEventLoop, QCoreApplication
Installs an event filter filterObj for all native event filters received by the application.
The event filter filterObj receives events via its nativeEventFilter() function, which is called for all events received by all threads.
The nativeEventFilter() function should return true if the event should be filtered, (in this case, stopped). It should return false to allow normal processing to continue. The native event can then be translated into a QEvent and handled by the standard event filtering, e.g. QObject::installEventFilter().
If multiple event filters are installed, the filter that was installed last is activated first. The filter function set here receives native messages, that is, MSG or XEvent structs. For maximum portability, you should always try to use QEvent objects and QObject::installEventFilter() whenever possible.
- See also
- QObject::installEventFilter()
Processes pending events which match the given flags until there are no more events to process. Returns true if an event was processed, otherwise returns false. This method returns when there are no more pending events.
This method is useful when there is a long operation and you want to show progress without allowing user input. For this to happen, pass the enum value QEventLoop::ExcludeUserInputEvents in the flags parameter.
If the flags value does not contain QEventLoop::WaitForMoreEvents and no events are available, this method will return immediately. If flags does contain QEventLoop::WaitForMoreEvents, the behavior is as follows.
-
If events are available, returns after processing them.
-
If no events are available, wait until more are available and return after processing newly available events.
- See also
- hasPendingEvents()