The following members of class QTimer are deprecated. They are provided to keep old source code working. We strongly advise against using them in new code.
(deprecated in 6.8) void |
singleShot(int msec, const QObject *receiver, const char *member) |
(deprecated in 6.8) void |
singleShot(int msec, Qt::TimerType timerType, const QObject *receiver, const char *member) |
[static, deprecated in 6.8] void QTimer::singleShot(int msec, const QObject *receiver, const char *member)This function is deprecated since 6.8. We strongly advise against using it in new code.
Use the chrono overloads. This static function calls a slot after a given time interval.
It is very convenient to use this function because you do not need to bother with a timerEvent or create a local QTimer object.
Example:
#include <QApplication> #include <QTimer> int main(int argc, char *argv[]) { QApplication app(argc, argv); QTimer::singleShot(600000, &app, QCoreApplication::quit); ... return app.exec(); }
This sample program automatically terminates after 10 minutes (600,000 milliseconds).
The receiver is the receiving object and the member is the slot. The time interval is msec milliseconds.
Note: This function is reentrant.
See also start().
[static, deprecated in 6.8] void QTimer::singleShot(int msec, Qt::TimerType timerType, const QObject *receiver,
const char *member)This function is deprecated since 6.8. We strongly advise against using it in new code.
This is an overloaded function.
Use the chrono overloads. This static function calls a slot after a given time interval.
It is very convenient to use this function because you do not need to bother with a timerEvent or create a local QTimer object.
The receiver is the receiving object and the member is the slot. The time interval is msec milliseconds. The timerType affects the accuracy of the timer.
Note: This function is reentrant.
See also start().
As part of the free Business evaluation, we offer a free welcome call for companies, to talk about your requirements, and how the Felgo SDK & Services can help you. Just sign up and schedule your call.
Sign up now to start your free Business evaluation: