QTimer deads after laptop hibernation
-
Hello!
I use QTimer for polling SOAP server in my application like:
@pollTimer = new QTimer(this);
connect(pollTimer, SIGNAL(timeout()), this, SLOT(pollServer()));
pollTimer->start(pollTimeout);@After sometimes(1-2 days or laptop gibernation) timer stops working and client application is unable to poll server..
How to solve this problem?
-
Hi,
thank you for reply.
My problem is the following - the QTimer stops working after my laptop hasn't been used for a while. (Hibernation or sleep is generaly suspected)
Result of QTimer::isActive() - true.
I'll check the resut of QTimer::remainingTime() asap and come back with result. -
Take a look at "this":http://qt-project.org/doc/qt-5.0/qtcore/qtimer.html#remainingTime-prop ,
Your timer must have went overdue while your computer was off or something. I suggest you should use a thread.
-
Or maybe "this":http://qt-project.org/doc/qt-5.0/qtcore/qtimer.html#singleShot-prop will help you without changing to threads.