Details
-
Bug
-
Resolution: Fixed
-
P3: Somewhat important
-
6.6
-
None
-
-
1
-
612b67cf1 (dev), 40e56294f (6.7), 148ec9eb9 (6.6), 858e5f3ee (tqtc/lts-6.5)
-
Foundation Sprint 101
Description
Calling QTimer::start with negative values will not start any timer but instead print the warning from QObject::startTimer. However QTimer::isActive will return true even though it's not really running
This can produce some nasty bugs in conjunction with QTBUG-67383
For example simplified:
QTimer timer; timer.setSingleShot(true); connect(&timer, QTimer::timeout, &doTheThing); [...] // Somehere else void scheduleDoingTheThing() if (timer.isActive()) // Don't do the thing yet, timer still running return; std::chrono::milliseconds interval(biggerthanintmax); // actually result of a calculation timer.start(interval)
Attachments
For Gerrit Dashboard: QTBUG-122087 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
538429,5 | QTimer: do not set active state when setting a negative interval | dev | qt/qtbase | Status: MERGED | +2 | 0 |
539536,2 | QTimer: do not set active state when setting a negative interval | 6.7 | qt/qtbase | Status: MERGED | +2 | 0 |
540191,3 | QTimer: do not set active state when setting a negative interval | 6.6 | qt/qtbase | Status: MERGED | +2 | 0 |
540554,3 | QTimer: do not set active state when setting a negative interval | tqtc/lts-6.5 | qt/tqtc-qtbase | Status: MERGED | +2 | 0 |