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

Problem in QDate::fromString/toString() with Qt::SystemLocaleLongDate

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 4.6.2
    • Core: Locales (i18n)
    • None
    • Win XP 64 Russian with Russian regional settings.

      Try the following code

       
                  for (int format = Qt::TextDate; format < Qt::DefaultLocaleLongDate; ++format)
                  {
                      QDate t(QDate::currentDate());
                      QDate t1(QDate::fromString(t.toString((Qt::DateFormat)format), (Qt::DateFormat)format));
                      qDebug()  << format <<  t.toString((Qt::DateFormat)format) << t1.toString((Qt::DateFormat)format);
                  }
      

      there is a output

       
      0 "Пн май 31 2010" "Пн май 31 2010" 
      1 "2010-05-31" "2010-05-31" 
      2 "31.05.2010" "31.05.2010" 
      3 "31.05.2010" "31.05.2010" 
      4 "31.05.2010" "31.05.2010" 
      5 "31 мая 2010 г." "" 
      6 "31.05.2010" "31.05.2010"  
      

      There is a problem with converting data using Qt::SystemLocaleLongDate (value 5), convertation does not work.

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

            laknoll Lars Knoll
            begemot Tiushkov Nikolay
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes