Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

QTimer remainingTime() always returns 0

$
0
0
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.

Viewing all articles
Browse latest Browse all 4972

Latest Images

Trending Articles



Latest Images