Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-392

QDate format does not accept a combination of date representations

    XMLWordPrintable

Details

    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();
      }

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            fenglich Frans Englich (closed Nokia identity)
            sanonymous Nokia Qt Support (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes