CDT CDT - 1 year ago 195
C++ Question

How to call a function periodically in Qt?

Is it possible to call a function periodically in C++ with Qt function ?

And how to stop the timed function after it is set to be called periodically ?

Answer Source

If you are using qt, you can you QTimer which by default creates a repetitive timer.

There is an example in the documentation (shown below) and an example (Analog Clock).

QTimer *timer = new QTimer(this);
connect(timer, SIGNAL(timeout()), this, SLOT(update()));
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download