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

QLocale not correctly restored from QSettings

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • P3: Somewhat important
    • 5.14.1
    • 5.12.6, 5.14.0
    • Core: I/O
    • None
    • macOS, Windows

    Description

      When saving and restoring a QLocale instance to/from QSettings, not all options are correctly restored. 

      Test code

      // Make an English locale
      QLocale locale(QLocale::English);
      // Set a number option flag, that differs from English locale
      locale.setNumberOptions(QLocale::OmitGroupSeparator);
      QVariant variant = locale;
      // This returns true, as expected.
      QVERIFY(variant.toLocale().numberOptions().testFlag(QLocale::OmitGroupSeparator));
      
      QSettings settings;
      settings.setValue("key", variant);
      QLocale locale2 = settings.value("key").toLocale();
      // This will fail 
      QVERIFY(locale2.numberOptions().testFlag(QLocale::OmitGroupSeparator));
      

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            simisas Per Ivar Bruheim
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes