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

value returned by ListModel::get() doesn't reflect call to set() if get() has already been called

    XMLWordPrintable

Details

    • e64535b227599b5adb8847dfda0b2516ae7e5625

    Description

      For this code:

      ListModel {
          id: model
      
          Component.onCompleted: {
              model.append({"attrs": []})
              model.get(0)
              model.set(0, {"attrs": [{'abc': 123, 'def': 456}] } )
              print("attrs:", model.get(0).attrs.count)
          }
      }
      

      The value of model.get(0).attrs.count is zero even though it should have changed to 2. However the value appears correctly if the first call to model.get() is removed.

      Attachments

        Activity

          People

            bealam Bea Lam (closed Nokia identity) (Inactive)
            bealam Bea Lam (closed Nokia identity) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: