Unsolved Pause and restart timerEvent
-
I see some example codes to pause the timer in Snake game such as:
void pause() { int remaining = dataTimer.remainingTime(); dataTimer.stop(); dataTimer.setInterval(remaining); } void resume() { dataTimer.start(); }
Since I use timerEvent, I use
timerId = startTimer(DELAY) killTimer(timerId);
Is there anyway to convert the 1st code for timerEvent? Any hint?
-
I don't think so, QObject class only provides the basic of timer supports. If you need to set Interval or other features of QTimer, you should use a QTimer Object instead of use QObject Timer.