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

ListModel should selectively emit changed signals

    XMLWordPrintable

Details

    • aca9a8d95f1fa9c29a7650d528616a0962732db3

    Description

      The following code should not trigger onNameChanged (We should also check that the model does not emit itemsChanged() for the same case):

      import QtQuick 1.0
      
      Rectangle {
          id: wrapper
          width: 200; height: 200
          property variant items;
      
          ListModel {
              id: lm
              ListElement {
                  name: "hello"
              }
          }
      
          Connections {
              target: lm.get(0)
              onNameChanged: console.log("here " + lm.get(0).name)
          }
      
          Component.onCompleted: lm.setProperty(0, "name", "hello")
      }
      

      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:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes