Disregard milliseconds in QTime::secsTo().
authorMitch Curtis <mitch.curtis@nokia.com>
Tue, 31 Jul 2012 09:34:43 +0000 (11:34 +0200)
committerQt by Nokia <qt-info@nokia.com>
Tue, 21 Aug 2012 09:05:20 +0000 (11:05 +0200)
commit3a7b6a74a8b36d98d57f4ec73b7e57f14911a775
tree33418fbea83234a3c54b6739b073adf578b275c6
parent718a2251be2d32f96befef1ec23912c1a2ce3e34
Disregard milliseconds in QTime::secsTo().

"The documentation states that "secsTo() does not take into account any
milliseconds", however, this is not the case. Given times 12:30:01.500
and 12:30:02.400 secsTo returns 0. If milliseconds are not taken into
account, I would expect this to return 1 (i.e. interprets the times as
12:30:01 and 12:30:02 thus truncating the milliseconds)."

Note that tests were also written for QDateTime::secsTo(), as it uses
QTime::secsTo internally. This addresses Javier's issue in the
comments of QTBUG-9304.

Task-number: QTBUG-9304
Change-Id: I9efe0c8f710db859c1d086d67ba3e5b349a56c4e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
src/corelib/tools/qdatetime.cpp
tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp
tests/auto/corelib/tools/qtime/tst_qtime.cpp