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

modifying the object returned by ListModel.get(0) doesn't update the view

    XMLWordPrintable

Details

    • c2bbef949126826f0330c69dff1a8c96919f69a5, 68281ec913e2a69682f00bf22c291b15ea4ce542

    Description

      ListModel {
              id: fruitModel
              ListElement {
                  name: "Apple"
                  cost: 2.45
              }
              ListElement {
                  name: "Orange"
                  cost: 3.25
              }
              ListElement {
                  name: "Banana"
                  cost: 1.95
              }
          }
          ListView {
              x: 10
              y: 200
              width: 200; height: 250
              model: fruitModel
              delegate: Row {
                  Text { text: "Fruit: " + name }
                  Text { text: "Cost: $" + cost }
              }
              MouseArea {
                  anchors.fill: parent
                  onClicked: { fruitModel.get(0).name = "bob"; console.log("ListElement.name: " + fruitModel.get(0).name) }
              }
          }
      }
      

      This needs to work in both the Nested (normal) and Flat (WorkserScript) cases.

      Attachments

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

        Activity

          People

            bealam Bea Lam (closed Nokia identity) (Inactive)
            brasser Michael Brasser (closed Nokia identity) (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes