Hello,
I have a problem with the remainingTime() function of QTimer. It always returns 0, even if I call it immediately after having started a timer. For example:
timer = new QTimer (this);
timer->setSingleShot (true);
timer->start (3000);
qDebug () << "Remaining time: " << timer->remainingTime ();
This always prints “Remaining time: 0” on the console, though the timer still runs for 3 seconds. In the documentation, it says that the remainingTime() function only returns 0 when the timer is overdue, but that’s not the case here. Am I doing something wrong?
Thanks.
↧








