Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qabstracteventdispatcher.h
Go to the documentation of this file.
1// Copyright (C) 2020 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QABSTRACTEVENTDISPATCHER_H
5#define QABSTRACTEVENTDISPATCHER_H
6
7#include <QtCore/qobject.h>
8#include <QtCore/qeventloop.h>
9
11
14class QSocketNotifier;
15
16class Q_CORE_EXPORT QAbstractEventDispatcher : public QObject
17{
19 Q_DECLARE_PRIVATE(QAbstractEventDispatcher)
20
21public:
22 struct TimerInfo
23 {
27
28 inline TimerInfo(int id, int i, Qt::TimerType t)
29 : timerId(id), interval(i), timerType(t) { }
30 };
31
32 explicit QAbstractEventDispatcher(QObject *parent = nullptr);
34
35 static QAbstractEventDispatcher *instance(QThread *thread = nullptr);
36
37 virtual bool processEvents(QEventLoop::ProcessEventsFlags flags) = 0;
38
41
42 int registerTimer(qint64 interval, Qt::TimerType timerType, QObject *object);
43 virtual void registerTimer(int timerId, qint64 interval, Qt::TimerType timerType, QObject *object) = 0;
44 virtual bool unregisterTimer(int timerId) = 0;
45 virtual bool unregisterTimers(QObject *object) = 0;
46 virtual QList<TimerInfo> registeredTimers(QObject *object) const = 0;
47
48 virtual int remainingTime(int timerId) = 0;
49
50 virtual void wakeUp() = 0;
51 virtual void interrupt() = 0;
52
53 virtual void startingUp();
54 virtual void closingDown();
55
56 void installNativeEventFilter(QAbstractNativeEventFilter *filterObj);
57 void removeNativeEventFilter(QAbstractNativeEventFilter *filterObj);
58 bool filterNativeEvent(const QByteArray &eventType, void *message, qintptr *result);
59
62 void awake();
63
64protected:
67};
68
70
72
73#endif // QABSTRACTEVENTDISPATCHER_H
DarwinBluetooth::LECBManagerNotifier * notifier
virtual void registerTimer(int timerId, qint64 interval, Qt::TimerType timerType, QObject *object)=0
Register a timer with the specified timerId, interval, and timerType for the given object.
virtual void registerSocketNotifier(QSocketNotifier *notifier)=0
Registers notifier with the event loop.
void aboutToBlock()
This signal is emitted before the event loop calls a function that could block.
virtual void unregisterSocketNotifier(QSocketNotifier *notifier)=0
Unregisters notifier from the event dispatcher.
virtual void wakeUp()=0
\threadsafe
virtual int remainingTime(int timerId)=0
Returns the remaining time in milliseconds with the given timerId.
void awake()
This signal is emitted after the event loop returns from a function that could block.
virtual bool unregisterTimer(int timerId)=0
Unregisters the timer with the given timerId.
virtual bool processEvents(QEventLoop::ProcessEventsFlags flags)=0
Processes pending events that match flags until there are no more events to process.
virtual QList< TimerInfo > registeredTimers(QObject *object) const =0
Returns a list of registered timers for object.
virtual bool unregisterTimers(QObject *object)=0
Unregisters all the timers associated with the given object.
virtual void interrupt()=0
Interrupts event dispatching.
\inmodule QtCore
Definition qbytearray.h:57
Definition qlist.h:74
\inmodule QtCore
Definition qobject.h:90
\inmodule QtCore
Combined button and popup list for selecting options.
TimerType
GLenum GLuint id
[7]
GLbitfield flags
GLuint GLsizei const GLchar * message
GLdouble GLdouble t
Definition qopenglext.h:243
GLuint64EXT * result
[6]
#define Q_OBJECT
#define Q_SIGNALS
@ Q_PRIMITIVE_TYPE
Definition qtypeinfo.h:144
#define Q_DECLARE_TYPEINFO(TYPE, FLAGS)
Definition qtypeinfo.h:163
long long qint64
Definition qtypes.h:55
ptrdiff_t qintptr
Definition qtypes.h:71
TimerInfo(int id, int i, Qt::TimerType t)
Constructs a TimerInfo struct with the given timerId, interval, and timerType.
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent