9#include <private/qthread_p.h>
10#include <private/qcoreapplication_p.h>
11#include <private/qfreelist_p.h>
12#include <private/qnumeric_p.h>
16using namespace std::chrono_literals;
60 using namespace std::chrono;
61 qint64 value = ceil<milliseconds>(interval).count();
62 return qt_saturate<T>(
value);
65#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
86 if (!timerIdFreeList.isDestroyed())
87 (
void)timerIdFreeList();
110 fl->release(timerId);
191 return data->eventDispatcher.loadRelaxed();
259 return int(
registerTimer(interval * 1ms, timerType,
object));
273#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
275 self->registerTimer(
id, interval, timerType,
object);
284#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
505 d->eventFilters.removeAll(
nullptr);
506 d->eventFilters.removeAll(filterObj);
507 d->eventFilters.prepend(filterObj);
526 for (
int i = 0;
i <
d->eventFilters.size(); ++
i) {
527 if (
d->eventFilters.at(
i) ==
filter) {
528 d->eventFilters[
i] =
nullptr;
556 if (!
d->eventFilters.isEmpty()) {
560 for (
int i = 0;
i <
d->eventFilters.size(); ++
i) {
587#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
592 self->registerTimer(timerId, interval, timerType,
object);
594 registerTimer(
int(timerId), fromDuration<qint64>(interval), timerType,
object);
600 return self->unregisterTimer(timerId);
604QList<QAbstractEventDispatcher::TimerInfoV2>
608 return self->timersForObject(
object);
609 QList<TimerInfo> timers = registeredTimers(
object);
610 QList<TimerInfoV2>
result;
611 result.reserve(timers.size());
612 for (
const TimerInfo &
t : timers)
621 return self->remainingTime(timerId);
641QAbstractEventDispatcherV2::QAbstractEventDispatcherV2(
QObject *parent)
658QAbstractEventDispatcherV2::~QAbstractEventDispatcherV2() =
default;
685auto QAbstractEventDispatcherV2::registeredTimers(
QObject *
object)
const -> QList<TimerInfo>
688 QList<TimerInfoV2> timers =
self->timersForObject(
object);
690 result.reserve(timers.size());
691 for (
const TimerInfoV2 &
t : timers)
709#include "moc_qabstracteventdispatcher.cpp"
static int allocateTimerId()
~QAbstractEventDispatcherPrivate() override
QAbstractEventDispatcherPrivate()
static void releaseTimerId(int id)
static QAbstractEventDispatcherPrivate * get(QAbstractEventDispatcher *o)
~QAbstractEventDispatcher()
Destroys the event dispatcher.
virtual Duration remainingTime(Qt::TimerId timerId) const =0
Returns the remaining time of the timer with the given timerId.
static QAbstractEventDispatcher * instance(QThread *thread=nullptr)
Returns a pointer to the event dispatcher object for the specified thread.
virtual void startingUp()
bool filterNativeEvent(const QByteArray &eventType, void *message, qintptr *result)
Sends message through the event filters that were set by installNativeEventFilter().
std::chrono::nanoseconds Duration
A {std::chrono::duration} type that is used in various API in this class.
virtual QList< TimerInfoV2 > timersForObject(QObject *object) const =0
void installNativeEventFilter(QAbstractNativeEventFilter *filterObj)
\variable QAbstractEventDispatcher::TimerInfoV2::timerId
void removeNativeEventFilter(QAbstractNativeEventFilter *filterObj)
Removes the event filter filter from this object.
virtual void closingDown()
QAbstractEventDispatcher(QObject *parent=nullptr)
Constructs a new event dispatcher with the given parent.
virtual bool unregisterTimer(Qt::TimerId timerId)=0
Qt::TimerId registerTimer(Duration interval, Qt::TimerType timerType, QObject *object)
QThread * thread() const
Returns the thread in which the object lives.
static Q_AUTOTEST_EXPORT QThreadData * current(bool createIfNecessary=true)
static QThreadData * get2(QThread *thread)
Combined button and popup list for selecting options.
QFreeList< void, QtTimerIdFreeListConstants > QtTimerIdFreeList
static T fromDuration(std::chrono::nanoseconds interval)
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char return DBusMessage dbus_bool_t return DBusMessage dbus_uint32_t return DBusMessage void
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
#define Q_GLOBAL_STATIC(TYPE, NAME,...)
GLint GLfloat GLfloat GLfloat v2
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
GLuint GLsizei const GLchar * message
QT_BEGIN_NAMESPACE constexpr std::underlying_type_t< Enum > qToUnderlying(Enum e) noexcept
static const int Sizes[BlockCount]