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

Errors when using "parent" within a (removed) Item in a Repeater

    XMLWordPrintable

Details

    • 9d0e702b1f29c8120f2000e1558a7b040311d8c0

    Description

      The following example produces errors when the model is removed (click anywhere to remove):

      import QtQuick 2.0
      
      Item {
          width: 400
          height: 400
      
          Row {
              anchors.bottom: parent.bottom
              anchors.horizontalCenter: parent.horizontalCenter
              spacing: 2
      
              Repeater {
                  id: repeater
                  model: 10
                  Rectangle {
                      color: "green"
                      width: 10; height: 50
                      anchors.bottom: parent.bottom
                  }
              }
          }
      
          MouseArea {
              anchors.fill: parent
              onClicked: repeater.model = 0
          }
      }
      

      The error message is:

      QmlTesting.qml:18: TypeError: Cannot read property of null
      

      Attachments

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

        Activity

          People

            mbrasser Michael Brasser
            mbrasser Michael Brasser
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes