7#include <QtCore/qglobal.h>
11#include <QtCore/qbasictimer.h>
12#include <QtCore/qobject.h>
22 Q_PROPERTY(
bool singleShot READ isSingleShot WRITE setSingleShot BINDABLE bindableSingleShot)
23 Q_PROPERTY(
int interval READ interval WRITE setInterval BINDABLE bindableInterval)
25 Q_PROPERTY(
Qt::TimerType timerType READ timerType WRITE setTimerType BINDABLE bindableTimerType)
34 Qt::TimerId
id() const;
36 void setInterval(
int msec);
40 int remainingTime() const;
42 void setTimerType(
Qt::TimerType atype);
43 Qt::TimerType timerType() const;
46 void setSingleShot(
bool singleShot);
47 bool isSingleShot() const;
50 QT_CORE_INLINE_SINCE(6, 8)
51 static
void singleShot(
int msec, const
QObject *receiver, const
char *member);
53 QT_CORE_INLINE_SINCE(6, 8)
54 static
void singleShot(
int msec,
Qt::TimerType timerType, const
QObject *receiver, const
char *member);
58 template <
typename Duration,
typename Functor>
59 static inline void singleShot(Duration interval,
const QObject *receiver,
Functor &&slot);
60 template <
typename Duration,
typename Functor>
61 static inline void singleShot(Duration interval,
Qt::TimerType timerType,
64 template <
typename Duration,
typename Functor>
69 singleShot(interval, defaultTypeFor(interval), receiver, std::forward<Functor>(slot));
71 template <
typename Duration,
typename Functor>
76 using Prototype =
void(*)();
77 singleShotImpl(interval, timerType, receiver,
78 QtPrivate::makeCallableObject<Prototype>(std::forward<Functor>(slot)));
83 template <
typename Duration,
typename Functor>
86 singleShot(interval, defaultTypeFor(interval),
nullptr, std::forward<Functor>(slot));
88 template <
typename Duration,
typename Functor>
91 singleShot(interval, timerType,
nullptr, std::forward<Functor>(slot));
95 template <
typename Functor>
97 template <
typename Functor>
100 template <
typename ... Args>
109 void start(
int msec);
118 void setInterval(std::chrono::milliseconds
value);
122 return std::chrono::milliseconds(interval());
127 return std::chrono::milliseconds(remainingTime());
132 singleShot(
value, defaultTypeFor(
value), receiver, member);
134 static void singleShot(std::chrono::milliseconds interval,
Qt::TimerType timerType,
135 const QObject *receiver,
const char *member);
146 inline int startTimer(
int){
return -1;}
147 inline void killTimer(
int){}
149 static constexpr Qt::TimerType defaultTypeFor(
int msecs)
noexcept
150 {
return defaultTypeFor(std::chrono::milliseconds{msecs}); }
152 static constexpr Qt::TimerType defaultTypeFor(std::chrono::milliseconds interval)
noexcept
157 using namespace std::chrono_literals;
161 QT_CORE_INLINE_SINCE(6, 8)
162 static
void singleShotImpl(
int msec,
Qt::TimerType timerType,
165 static
void singleShotImpl(
std::chrono::milliseconds interval,
Qt::TimerType timerType,
169#if QT_CORE_INLINE_IMPL_SINCE(6, 8)
171{ singleShot(std::chrono::milliseconds{msec}, receiver, member); }
175{ singleShot(std::chrono::milliseconds{msec}, timerType, receiver, member); }
177void QTimer::singleShotImpl(
int msec,
Qt::TimerType timerType,
180 singleShotImpl(std::chrono::milliseconds{msec}, timerType, receiver, slotObj);
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
static void singleShot(Duration interval, Functor &&slot)
std::chrono::milliseconds intervalAsDuration() const
static void singleShot(Duration interval, Qt::TimerType timerType, const typename QtPrivate::ContextTypeForFunctor< Functor >::ContextType *receiver, Functor &&slot)
bool singleShot
whether the timer is a single-shot timer
static void singleShot(Duration interval, Qt::TimerType timerType, Functor &&slot)
static void singleShot(Duration interval, const typename QtPrivate::ContextTypeForFunctor< Functor >::ContextType *receiver, Functor &&slot)
static void singleShot(std::chrono::milliseconds value, const QObject *receiver, const char *member)
void timeout(QPrivateSignal)
This signal is emitted when the timer times out.
QMetaObject::Connection callOnTimeout(Args &&...args)
std::chrono::milliseconds remainingTimeAsDuration() const
Combined button and popup list for selecting options.
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]