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

Property signal handlers of list type

    XMLWordPrintable

Details

    Description

      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
      }}

      Attachments

        1. main.qml
          0.2 kB
        2. TestItem.qml
          0.1 kB

        Issue Links

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

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes