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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Cannot Reproduce
    • Affects Version/s: 4.6.2
    • Fix Version/s: None
    • Component/s: Core: Locales (L10n)
    • Labels:
      None
    • Environment:
      Win XP 64 Russian with Russian regional settings.

      Description

      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.

        Attachments

          Issue Links

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

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes