Details
-
Bug
-
Resolution: Unresolved
-
P4: Low
-
None
-
5.3.2, 5.4.0 Beta, 5.7.0
-
None
-
Win7 / Ubuntu 12.04,14.03,16.04 / Windows 10
Description
When entering a date by keyboard in a QCalendarWidget the month is not correctly
handled when the month starts with 0. (01-01-2014). You can reproduce this with de calendarwidget example.
The problem is in the QCalendarMonthValidator class in function applyToDate:
QDate QCalendarMonthValidator::applyToDate(const QDate &date)
{
int month = m_month;
if (month < 1)
month = 1;
else if (month > 12)
month = 12;
QDate newDate(date.year(), m_month,1);
....
}
QDate newDate(date.year(), m_month,1) should be:
QDate newDate(date.year(), month,1);
because if m_month = 0 an invalid date would be produced.