Go to file
Mitch Curtis 2b562b7564 Fix 3 digit day being displayed by QDateEdit.
When a QDateEdit has its display format set to "yyyy/MM/dd", its day
set to 31 and its month set to 2, it will display 291 as the day until
the cursor is moved or the focus changed. This is because
QDateTimeParser::parse calls sectionSize() for the day section, which
will sometimes return an incorrect size. There are also other display
formats affected by this bug (e.g. long day names).

For example, (in the context of sectionSize()) when text is
"2000/01/31" and displayText() is "2000/2/31", there is a difference
between displayText() and text - text is the previous value and
displayText() is the new value. The size difference is always due to
leading zeroes.

This patch makes QDateTimeParser keep track of the quantity of zeroes
added to each section and then factors this value into the result of
sectionSize() if there is a size difference between text and
displayText().

Task-number: QTBUG-26847
Change-Id: I3823cc41167ec920f742cb6a20d39fc5f433c915
Reviewed-by: Mitch Curtis <mitch.curtis@nokia.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dietrich-de@nokia.com>
Reviewed-by: aavit <qt_aavit@ovi.com>
2012-09-05 21:06:39 +02:00
bin de-duplicate code 2012-08-28 20:47:11 +02:00
config.tests mips: Autodetect MIPS DSP rev1 and rev2 instructionset 2012-09-01 15:28:24 +02:00
dist QStyle: make standardIcon() & layoutSpacing() virtual 2012-08-31 18:56:35 +02:00
doc Moved gui example documentation to the proper location. 2012-09-01 11:21:46 +02:00
examples Command-line-only examples should not build as .app bundles on OSX 2012-09-03 11:05:49 +02:00
lib Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
mkspecs QNX: Move qpa-based mkspecs out of the unsupported directory 2012-09-04 18:17:23 +02:00
qmake restore support for QMAKE_LIBDIR_FLAGS 2012-09-05 03:03:15 +02:00
src Fix 3 digit day being displayed by QDateEdit. 2012-09-05 21:06:39 +02:00
tests Fix 3 digit day being displayed by QDateEdit. 2012-09-05 21:06:39 +02:00
tools configure: Fix infinite loop displaying config.summary 2012-09-03 13:41:55 +02:00
util Make plugintest util work on Windows. 2012-08-30 13:51:22 +02:00
.gitattributes Added .tag file with Git revision. 2011-05-03 16:23:49 +02:00
.gitignore Updated .gitignore 2012-08-18 13:59:11 +02:00
.tag Added .tag file with Git revision. 2011-05-03 16:23:49 +02:00
configure Rename MAC_CONFIG_TEST_COMMANDLINE to MAC_SDK_FLAG 2012-09-03 13:41:55 +02:00
configure.bat bypass configure bootstrap for non-git builds 2012-09-05 03:03:14 +02:00
header.BSD Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
header.FDL Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
header.LGPL Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
header.LGPL-ONLY Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
INSTALL Remove Symbian specific code from qtbase. 2012-01-31 07:08:31 +01:00
LGPL_EXCEPTION.txt Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
LICENSE.FDL Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
LICENSE.GPL Add the LICENSE.GPL file to the module referenced from license headers 2012-05-20 22:41:08 +02:00
LICENSE.LGPL Update contact information in license headers. 2012-01-23 04:04:33 +01:00
LICENSE.PREVIEW.COMMERCIAL Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
qtbase.pro Install right version of tools when x-compiling. 2012-07-17 12:52:48 +02:00
sync.profile Revert "Move QWindowSystemInterface out of qpa." 2012-08-03 00:38:09 +02:00