18using namespace std::chrono_literals;
169 return d_func()->isActiveData.value();
174 return QBindable<bool>(&d_func()->isActiveData);
186 return v == 0 ? -1 :
v;
219 d->isActiveData.notify();
252 const bool intervalChanged = msec !=
d->inter;
253 d->inter.setValue(msec);
273 d->isActiveData.notify();
302void QTimer::singleShotImpl(std::chrono::milliseconds msec,
Qt::TimerType timerType,
307 bool deleteReceiver =
false;
318 }
else if (!receiver) {
322 deleteReceiver =
true;
326 QMetaObject::invokeMethodImpl(
const_cast<QObject *
>(receiver), slotObj,
379 const QObject *receiver,
const char *member)
382 qWarning(
"QTimer::singleShot: Timers cannot have negative timeouts");
385 if (receiver && member) {
388 const char* bracketPosition = strchr(member,
'(');
389 if (!bracketPosition || !(member[0] >=
'0' && member[0] <=
'2')) {
390 qWarning(
"QTimer::singleShot: Invalid slot specification");
394 bracketPosition - 1 - member).
trimmed();
559 return d_func()->single;
564 return QBindable<bool>(&d_func()->single);
590 d->inter.removeBindingUnlessInWrapper();
591 const bool intervalChanged = msec !=
d->inter.valueBypassingBindings();
592 d->inter.setValueBypassingBindings(msec);
603 d->isActiveData.notify();
612 return d_func()->inter;
617 return QBindable<int>(&d_func()->inter);
635 using namespace std::chrono;
637 return ceil<milliseconds>(remaining).count();
653 d_func()->type = atype;
658 return d_func()->type;
663 return QBindable<Qt::TimerType>(&d_func()->
type);
668#include "moc_qtimer.cpp"
static QAbstractEventDispatcher * instance(QThread *thread=nullptr)
Returns a pointer to the event dispatcher object for the specified thread.
QByteArrayView trimmed() const noexcept
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 Duration fromMsecs(std::chrono::milliseconds ms)
static QThread * currentThread()
int timerId() const
Returns the unique timer identifier, which is the same identifier as returned from QObject::startTime...
QTimer(QObject *parent=nullptr)
Constructs a timer with the given parent.
void setSingleShot(bool singleShot)
void timerEvent(QTimerEvent *) override
\reimp
bool isSingleShot() const
int interval
the timeout interval in milliseconds
int remainingTime
the remaining time in milliseconds
Qt::TimerType timerType
controls the accuracy of the timer
void setInterval(int msec)
QBindable< Qt::TimerType > bindableTimerType()
int timerId() const
Returns the ID of the timer if the timer is running; otherwise returns -1.
bool isActive() const
Returns true if the timer is running (pending); otherwise returns false.
bool singleShot
whether the timer is a single-shot timer
QBindable< int > bindableInterval()
QBindable< bool > bindableActive()
void stop()
Stops the timer.
QBindable< bool > bindableSingleShot()
~QTimer()
Destroys the timer.
void setTimerType(Qt::TimerType atype)
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)
GLsizei const GLfloat * v
[13]
GLbitfield GLuint64 timeout
[4]
GLfloat GLfloat GLfloat GLfloat h
QT_BEGIN_NAMESPACE constexpr std::underlying_type_t< Enum > qToUnderlying(Enum e) noexcept