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

Regression: program crash in QQuickItem destructor when layouts contain custom property

XMLWordPrintable

    • 342c72da64cac4aec1463091f6fe0bfb16cd1850

      Program crashes on exit when layout (exist as ListView delegate) contains nested child layouts and any custom property. This situation occurs only if ListView turn to invisible state.

      Example:

      main.qml
      import QtQuick 2.7
      import QtQuick.Controls 2.0
      import QtQuick.Layouts 1.3
      
      ApplicationWindow {
          visible: true
          width: 640; height: 480
      
          ColumnLayout {
              anchors.fill: parent
              RowLayout {
                  Layout.alignment: Qt.AlignCenter
                  Button {
                      text: 'first page'
                      onClicked: __stackLayout.currentIndex = 0
                  }
                  Button {
                      text: 'second page'
                      onClicked: __stackLayout.currentIndex = 1
                  }
              }
      
              StackLayout {
                  id: __stackLayout
                  Layout.fillHeight: true; Layout.fillWidth: true
      
                  ListView {
                      model: 50
                      delegate: __delegate
                      Layout.fillHeight: true; Layout.fillWidth: true
                  }
      
                  ListView {
                      model: 70
                      delegate: __delegate
                      Layout.fillHeight: true; Layout.fillWidth: true
                  }
              }
          }
      
          Component {
              id: __delegate
              ColumnLayout {
                  property bool bug: true
      
                  /* IF REMOVE PROPERTY 'bug' OR REMOVE layout '__childLayout'
                     CRASH WILL DISAPPEAR. */
      
                  width: ListView.view.width
                  RowLayout {
                      id: __childLayout
                      Layout.alignment: Qt.AlignCenter
                      Text {
                          text: 'This is row № '
                          Layout.fillHeight: true
                      }
                      Text {
                          text: index; Layout.fillHeight: true
                      }
                  }
                  Rectangle {
                      height: 1; color: 'red'
                      Layout.fillWidth: true
                  }
              }
          }
      }
      

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

            smd Jan Arve
            amuralev Artem Muralev
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes