Details
-
Type:
Bug
-
Status: Closed
-
Priority:
P4: Low
-
Resolution: Done
-
Affects Version/s: 5.0.0 Beta 1
-
Fix Version/s: 5.0.0
-
Component/s: Core: Date/Time, Widgets: Widgets and Dialogs
-
Labels:None
-
Commits:I558ee13b224707d22b26c2ec2c045f96118bd5a1
Description
As a result of testing QTBUG-26847, it was found that QDateEdit will also temporarily display a short or long day name as its numerical value under the same circumstances as the aforementioned bug.
- QDateEdit has the display format set to 'yyyy/MM/ddd' (or any format with a short or long day name)
- The date value is edited to '31' (cycle through the days by holding the up key)
- The focus is changed to month with Shift + Tab
- The month value is edited to '2'
- The date value shows '29' until cursor is moved or focus changed (or 291 if https://codereview.qt-project.org/#change,33204 is not applied)
The reason this happens is because QDateTimeParser doesn't distinguish between day names and numbers:
qdatetime.cpp:5082
if (sectionType(i) & (DaySection|DayOfWeekSection)) {
input.replace(sectionPos(i), sectionSize(i), loc.toString(day));
}
Attached is a patch (to go on top of the aforementioned change) which contains unit tests demonstrating the issue.
Attachments
Issue Links
- relates to
-
QTBUG-19091 QDateEdit/ QDateTimeEdit display problems with certain displaystrings and dates
-
- Closed
-
- resulted from
-
QTBUG-26847 QDateEdit wrong section size
-
- Closed
-