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

Settings QML Type: Variant typed property returns "@Variant(" IOS 10.2.1

    XMLWordPrintable

    Details

    • Platform/s:
      iOS/tvOS/watchOS

      Description

      I have a field in Settings (QML Type) as variant, and its a simple key value object. Everything works fine when initializing, using, and persisting this variant at runtime but after closing and reopening the application, i can't get my persisted data from Settings, it simply returns "@Variant(" as string. This scenario works properly in "iOS 9.3" and "macOS Sierra 10.12.3" but fails in "iOS 10.2.1"

      Note : tested application with compiling both iOS SDK 9 & iOS SDK 10, results are the same.

      Here is a simple qml code for quick test :

      sample.qml
          Component.onCompleted:
          {
              console.log(settings.keyValueObj) //output: undefined or @Variant(
              if(!settings.keyValueObj)
                  settings.keyValueObj = {};         
          }
      
          Settings {
              id: settings
              property int counter: 0
              property variant keyValueObj
          }
      
          Button
          {
              width: 200;
              height: 50;
              text:"Click !"
              onClicked:
              {
                  settings.counter++;
                  settings.keyValueObj["i"+settings.counter] =  settings.counter;
              }
          }
      

        Attachments

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

          Activity

            People

            Assignee:
            vestbo Tor Arne Vestbø
            Reporter:
            omrerdn Ömer Erden
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes