Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.3.2
-
None
-
Qt5.3.2/msvc2010_opengl
See qtdiagsave.txt
-
d01d08971a1ba4d66927a48577041abc5b7df8a2
Description
According to its description, QTimer::remainingTime() should only return 0, -1 or positive int, but it can also return big negative ints if it is called before the event loop properly initialized it.
This happened in my case when I tried to create a QTimer object in a loop inside a thread and called remainingTime() on it. The loop blocked Qts event loop from executing and the remainingTime() never properly initialized, but was instead randomly set to something like "-1371648957".
The timer on the other hand tried to count down, which can be verified by printing the remainingTime() on the console, so the negative value just increases and timeout() is never fired.
See this thread for more details: http://stackoverflow.com/questions/28563004/qtimer-remainingtime-returns-1371648957/28563732#28563732
This is transparent to the user and the returned value should probably be -1.
Attachments
Issue Links
- is replaced by
-
QTBUG-46940 QTimer remainingTime() function returns always 0 after first shot.
-
- Closed
-