18using namespace std::chrono_literals;
161 return d_func()->isActiveData.value();
166 return QBindable<bool>(&d_func()->isActiveData);
197 d->isActiveData.notify();
212 d->isActiveData.notify();
263 return d_func()->single;
268 return QBindable<bool>(&d_func()->single);
288 d->intervalDuration.removeBindingUnlessInWrapper();
289 const bool intervalChanged = nsec !=
d->intervalDuration.valueBypassingBindings();
290 d->intervalDuration.setValueBypassingBindings(nsec);
301 d->isActiveData.notify();
305 d->intervalDuration.notify();
310 return d_func()->intervalDuration.value();
315 return {&d_func()->intervalDuration};
334 return std::chrono::nanoseconds::min();
347 d_func()->type = atype;
352 return d_func()->type;
357 return {&d_func()->type};
377 const QObject *receiver,
const char *member)
380 qWarning(
"QChronoTimer::singleShot: Timers cannot have negative timeouts");
383 if (receiver && member) {
386 const char* bracketPosition = strchr(member,
'(');
387 if (!bracketPosition || !(member[0] >=
'0' && member[0] <=
'2')) {
388 qWarning(
"QChronoTimer::singleShot: Invalid slot specification");
392 bracketPosition - 1 - member).
trimmed();
415void QChronoTimer::singleShotImpl(std::chrono::nanoseconds interval,
Qt::TimerType timerType,
419 bool deleteReceiver =
false;
430 }
else if (!receiver) {
434 deleteReceiver =
true;
438 QMetaObject::invokeMethodImpl(
const_cast<QObject *
>(receiver), slotObj,
452#include "moc_qchronotimer.cpp"
static QAbstractEventDispatcher * instance(QThread *thread=nullptr)
Returns a pointer to the event dispatcher object for the specified thread.
QByteArrayView trimmed() const noexcept
QBindable< bool > bindableActive()
QChronoTimer(std::chrono::nanoseconds nsec, QObject *parent=nullptr)
Constructs a timer with the given parent, using an interval of nsec.
void setSingleShot(bool singleShot)
QBindable< Qt::TimerType > bindableTimerType()
bool singleShot
Whether the timer is a single-shot timer.
Qt::TimerType timerType
Controls the accuracy of the timer.
Qt::TimerId id() const
Returns a Qt::TimerId representing the timer ID if the timer is running; otherwise returns Qt::TimerI...
void timerEvent(QTimerEvent *) override
\reimp
QBindable< bool > bindableSingleShot()
std::chrono::nanoseconds remainingTime
The remaining time.
void setTimerType(Qt::TimerType atype)
~QChronoTimer() override
Destroys the timer.
void setInterval(std::chrono::nanoseconds nsec)
QBindable< std::chrono::nanoseconds > bindableInterval()
std::chrono::nanoseconds interval
The timeout interval.
bool isActive() const
Returns true if the timer is running (pending); otherwise returns false.
void stop()
Stops the timer.
bool isSingleShot() const
static QThread * mainThread()
int startTimer(int interval, Qt::TimerType timerType=Qt::CoarseTimer)
This is an overloaded function that will start a timer of type timerType and a timeout of interval mi...
Q_INVOKABLE QObject(QObject *parent=nullptr)
Constructs an object with parent object parent.
void killTimer(int id)
Kills the timer with timer identifier, id.
void deleteLater()
\threadsafe
static QThread * currentThread()
int timerId() const
Returns the unique timer identifier, which is the same identifier as returned from QObject::startTime...
Combined button and popup list for selecting options.
auto invokeMethodHelper(QMetaMethodReturnArgument r, const Args &... arguments)
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
static QString methodName(const QDBusIntrospection::Method &method)
GLbitfield GLuint64 timeout
[4]
GLfloat GLfloat GLfloat GLfloat h