Details
-
Suggestion
-
Resolution: Out of scope
-
P3: Somewhat important
-
4.2.2
-
None
Description
The QDate format does not accept a combination of date representations.
To write QDateEdit::setDisplayFormat("dddd dd/MM/yy") to display "Tuesday 03/01/07" will return invalid dates when changing the date at the end of a month.
Can be reproduced with the following example:
Set the date to 31/12/07. Select the number "12" and then change this number to "11". This will return the invalid date: 30 30/13007.
#include <QtGui>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QWidget widget;
QDateEdit *date = new QDateEdit(QDate::currentDate(), &widget);
date->setDisplayFormat("dddd dd/MM/yy");
QHBoxLayout *hbox = new QHBoxLayout;
hbox->addWidget(date);
widget.setLayout(hbox);
widget.show();
return app.exec();
}