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

Crash on destruction of a Layout with children attached to alias default property

XMLWordPrintable

      Application crash when destroying of the layout that has children attatched to default property.

      To crash click the red button.

      It may be related to: QTBUG-52490 and QTBUG-52241

      Main.qml

      import QtQuick 2.5
      
      Rectangle {
          id: root
      
          ListView {
              id: listView
      
              anchors.fill: parent
              model: 5
              spacing: 2
      
              delegate: TestItem {
                  width: listView.width
                  height: 10
      
                  Rectangle {
                      width: 10
                      height: 10
                      color: "black"
                  }
              }
          }
      
          Rectangle {
              anchors.bottom: parent.bottom
      
              color: "red"
              width: 20
              height: 20
      
              MouseArea {
                  anchors.fill: parent
      
                  onClicked: {
                      listView.model = Math.floor((Math.random() * 10) + 1)
                  }
              }
          }
      }
      

      TestItem.qml

      import QtQuick 2.5
      import QtQuick.Layouts 1.3
      
      Item {
          id: root
      
          default property alias rowData: row.data
      
          RowLayout { //if it is changed from RowLayout to Item, all works correctly
              id: row
      
              anchors.fill: parent
              //Component.onDestruction: data = [] //this hack can solve the problem
          }
      }
      

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

            shausman Simon Hausmann
            permotion88 Karol Polak
            Votes:
            2 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes