Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.8
-
None
Description
The original report is from the forum: https://forum.qt.io/topic/160278
QChronoTimer::remainingTime() can not return a duration > ~24days due to an integer overflow inside int QEventDispatcherWin32::remainingTime() because this function can only return integers in Qt6.
I wonder why this should work on linux with gcc13 though (at least someone else from the forum checked it with this combination)
Reproducer:
int main(int argc, char **argv) { QCoreApplication app(argc, argv); ChronoTimer timer; qint64 interval = 24; timer.setInterval(days(interval)); timer.start(); qDebug() << "days:" << duration_cast<days>(timer.remainingTime()).count(); QChronoTimer timer2; interval = 25; timer2.setInterval(days(interval)); timer2.start(); qDebug() << "days:" << duration_cast<days>(timer2.remainingTime()).count(); }