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

Intentiator: added element don't trigger objectAdded

    XMLWordPrintable

Details

    • 7c0156309eef50b5cfd3e498eaed6d7218dc40f8

    Description

      Intentiator does not handle properly items added to the model. In the following test case, the object added signal is not fired when data are added to the model.

      import QtQuick 2.1
      import QtQuick.Controls 1.0
      
      Rectangle {
          width: 360
          height: 360
          property var index: 0
          ListModel {
              id: citiesModel3
              ListElement { text: "0 - Oslo" }
          }
      
          Column {
              Rectangle {
                  id: rect
                  width: 50
                  height: 100
                  Instantiator {
                      id: popupItems
                      model: citiesModel3
                      Text {
                          parent: rect
                          text: model["text"] || ""
                      }
                      onObjectAdded: print("onObjectAdded")
                  }
              }
      
              Button {
                  text: "append date"
                  onClicked: {
                      index++
                      citiesModel3.append({ text: index + " - Oslo"})
                  }
              }
              Label { text: "added element: " + index }
              Label { text: "model count: " + citiesModel3.count }
          }
      }
      

      Tested on Ubuntu 11.10

      Attachments

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

        Activity

          People

            aalpert Alan Alpert
            carochao Caroline Chao (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes