int QObject::startTimer ;The timer type indicates how accurate a timer can be.

The

timer is often used in programming. It is necessary to study it and take notes! There are two ways to use timers in

Qt. One is to use the timer provided by the QObject class, and the other is to use the QTimer class.

1, the use of timers in QObject requires the use of three functions:

int QObject::startTimer (int interval); Timer expiration processing function

void QObject::killTimer (int id);        // Turn off the timer

2, use the QTimer timer class (you can use signals and slots)

QTimer *timer = new QTimer(this); SLOT(onTimeout())); // Connect the timer slot function

void QTimer::start (int msec); // Turn on the timer and set the interval

void QTimer::stop(); QTimer::setTimerType(Qt::TimerType atype);

The original text in Qt Assitant is as follows:

enum Qt::TimerType

The timer type indicates how accurate a timer can be.

【Get QT development tutorial learning materials, click the link below to get it for free↓↓, code it first to not get lost~】

click→get