qt5base-lts/tests/auto
Volker Hilsheimer 924b97d6ab Fix QDateTimeEdit's handling of invalid time in dst gap
During a spring forward, a time-zone omits an hour. A QDateTime with
such an hour is invalid, but QDateTimeEdit's handling of this invalid
time was not done correctly.

With this fix, up/down changes of any field that would result in an
invalid date-time corrects the time to be valid, while leaving as
much as possible of the user-entered data unchanged. To do that, we
rely on QDateTime::toMSecsSinceEpoch to return a value even for such
an invalid time, which then can be used to construct a valid
QDateTime.

Edits that would result in an invalid hour are reverted to the
previous when pressing return, if correctionMode is
CorrectToPreviousValue. This change also implements support for
CorrectToNearestValue, which uses the same mechanism as when stepping
over an invalid time.

Include a test that verifies that the various interactions result
in a reasonable value. Since QDateTimeEdit does not respect the
timezone or timespec of the QDateTime it is initialized with, we
have to find the first hour of daylight saving time for a year
that we know works for most time zones. Failing that, we have to
skip the tests. Verified in a wide range of time zones.

Change-Id: I05b906ae3b5f6681891d23704f00f9c10cd479ae
Fixes: QTBUG-79803
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-02-27 19:35:28 +01:00
..
bic/data Add binary compatibility files for qtbase 5.14 branch 2019-12-20 10:41:11 +02:00
cmake CMake: Add support for auto-importing plugins in CMake 2019-08-12 18:23:58 +02:00
concurrent Introduce QT_NO_LINKED_LIST and mark QtBase (almost) free of it 2019-07-12 14:26:30 +02:00
corelib Add an expansion limit for entities 2020-02-26 22:08:38 +01:00
dbus Deprecate constructing QFlags from a pointer 2019-11-20 19:43:38 +01:00
gui QAbstractSocket: deprecate 'error' signal, use 'errorOccurred' instead 2020-02-27 13:56:45 +01:00
guiapplauncher
installed_cmake
network QAbstractSocket: deprecate 'error' signal, use 'errorOccurred' instead 2020-02-27 13:56:45 +01:00
opengl Remove dead code from Qt 4 times 2019-08-20 22:27:46 +00:00
other Revert "QAbstractSocket: deprecate 'error' member-function" 2020-02-26 23:07:52 +03:00
printsupport Remove the remaining usages of deprecated APIs of qtbase 2019-08-01 06:48:27 +02:00
shared QWindowsFontDatabase: Check preferred family names for all fonts 2019-11-29 09:31:21 +01:00
sql Merge remote-tracking branch 'origin/5.14' into 5.15 2019-12-10 13:51:40 +02:00
testlib testlib: Improve error message when detecting line count mismatch 2020-02-10 15:06:14 +01:00
tools moc: Record whether a meta object is an object, gadget, or namespace 2020-02-13 11:40:05 +01:00
widgets Fix QDateTimeEdit's handling of invalid time in dst gap 2020-02-27 19:35:28 +01:00
xml QNetworkReply: deprecate the 'error' getter 2020-01-13 15:50:47 +01:00
auto.pro winrt: Skip network auto tests for now 2018-06-22 05:02:39 +00:00
network-settings.h Revert "QAbstractSocket: deprecate 'error' member-function" 2020-02-26 23:07:52 +03:00