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

Unable to set certain dates for a QDateEdit

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • 5.12.1
    • 5.6, 5.7.0, 5.8.0, 5.9
    • None
    • Ubuntu 16.10, Fedora 25, Windows 7, Windows 10
    • 4e01b851159342122d42be1091d4cfa464700a4e (qt/qtbase/5.12)

      Unable to set certain dates, for example 2017-3-22 for a QDateEdit object. QDateTimeEdit has same problem. The widget prints this error message to stderr:

      QLineEdit::setSelection: Invalid start position (1) 
      

      Minimal Sample:

      #include <QApplication>
      #include <QDialog>
      #include <QDateEdit>
      #include <QVBoxLayout>
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
      
          QDialog d;
          QVBoxLayout layout(&d);
          QDateEdit de(&d);
          layout.addWidget(&de);
          de.setDate(QDate(2017,3,22));
          d.show();
      
          return a.exec();
      }
      

        1. 2017-03-21.png
          2017-03-21.png
          5 kB
        2. 2017-03-23.png
          2017-03-23.png
          5 kB
        3. 2017-3-22.png
          2017-3-22.png
          4 kB
        4. QTBUG-58947.tar.gz
          0.5 kB
        5. screenshot-1.png
          screenshot-1.png
          364 kB
        For Gerrit Dashboard: QTBUG-58947
        # Subject Branch Project Status CR V

            Eddy Edward Welbourne
            soroush Soroush Rabiei
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes