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

QSetting setValue("", float) does not work for all Qt apps running on iOS 10 and macOS Sierra

    XMLWordPrintable

Details

    • iOS/tvOS/watchOS, macOS

    Description

      The problem seems only to occur on iOS 10. It worked fine on iOS 9 and also on other platforms:

      [EDIT]: Not only only iOS 10 is affected, but also all Qt apps running on macOS Sierra.

      QSettings settings;
      settings.setValue("test", 1.0f);
      
      QSetting settings;
      bool bOk;
      setting.value("test", 1.0).toFloat(&bOk); // bOk is always false and 0 is returned
      

      With qreal/double everything works:

      void setSettings() {
      QSettings settings;
      settings.setValue("test", 1.0);
      }
      
      void loadSettings() {
      QSetting settings;
      bool bOk;
      setting.value("test", 1.0).toReal(&bOk); // bOk
      }
      

      Attachments

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

        Activity

          People

            vestbo Tor Arne Vestbø
            DanielSt Peter Staab
            Votes:
            3 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews