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

Property signal handlers of list type

XMLWordPrintable

      When I change value of property of list type the related signal handler is called as many times, as many elements the list include (which IMHO is not right - I would rather expect it to be called once, cause I'm changing the property value only once).

      main.qt
      {{
      import Qt 4.7

      Rectangle {
      width: 200; height: 200
      TestItem {
      items: [
      QtObject {},
      QtObject {},
      QtObject {}
      ]
      }
      }
      }}

      TestItem.qml
      {{
      import Qt 4.7

      Item

      { id: testitem property list<QtObject> items onItemsChanged: console.log("Items changed: ", testitem.items.length) } }}

      qmlviewer output
      {{
      $ qmlviewer main.qml
      Items changed: 1
      Items changed: 2
      Items changed: 3
      }}

        1. TestItem.qml
          0.1 kB
        2. main.qml
          0.2 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            aakenned Aaron Kennedy
            telendt Tomasz Elendt
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes