qt6-bb10/tests/auto/corelib/tools/qdatetime
Volker Hilsheimer 5aaade8c93 Fix editing of QDateTimeEdit in 12-hour locales that don't use AM/PM
The code made two incorrect assumptions: that the strings used are "AM"
or "PM", or would be translated. Instead, the locale provides the
correct strings, and there is no need to translate. However, in order
not to break existing translations, we give those preference.

And that the AM/PM string is not longer than 4 characters, while in
e.g Spanish/Columbia locale the strings are "A. M." and "P. M.", ie 5
characters long. Also, the use of qMin in a function that is asked to
provide the maximum section length is wrong.

[ChangeLog][QWidgets][QDateTimeEdit] Use the information provided by
the locale to determine the AM/PM strings, unless they are already
translated.

Change-Id: I6d1b05376e5ac62fc58da2cdea2e6cb732ec6747
Fixes: QTBUG-72833
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-05-28 06:14:32 +00:00
..
.gitignore
BLACKLIST Blacklist two tests on macOS that a planned CI change shall break 2018-08-24 17:30:01 +00:00
qdatetime.pro Use msvc qmake scope where appropriate 2018-11-22 14:16:52 +00:00
tst_qdatetime.cpp Fix editing of QDateTimeEdit in 12-hour locales that don't use AM/PM 2019-05-28 06:14:32 +00:00
tst_qdatetime_mac.mm Round to nearest millisecond in QDateTime::fromCFDate() 2016-10-02 13:07:18 +00:00