Details
-
Bug
-
Resolution: Done
-
Not Evaluated
-
4.7.4
-
None
-
Tested on Windows, maybe other platforms have the correct behaviour
-
6da3e4d865e391a1d291c4729f4771a87c6bcd65
Description
According to the documentation QElapsedTimer::msecsTo(QElapsedTimer other) returns a positive value if other was started before this. However, the actual implementation is exactly the other way round, it returns a positive value when this was started before other.
Simple program to validate:
#include <QElapsedTimer> #include <QThread> #include <QDebug> class Thread: public QThread { public: using QThread::sleep; }; int main(int argc, char *argv[]) { QElapsedTimer timer1; timer1.start(); Thread::sleep(1); QElapsedTimer timer2; timer2.start(); qDebug() << timer2.msecsTo(timer1); qDebug() << timer1.msecsTo(timer2); return 0; }
Results in:
-998 998
Attachments
For Gerrit Dashboard: QTBUG-25128 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
22218,2 | Update the documentation about the sign in QElapsedTimer::(m)secsTo | master | qt/qtbase | Status: MERGED | +2 | 0 |
22324,1 | Update the documentation about the sign in QElapsedTimer::(m)secsTo | api_changes | qt/qtbase | Status: ABANDONED | 0 | 0 |