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

Binding crashes when combined with StackView and Loader

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P1: Critical
    • None
    • 6.8.2
    • Quick: Controls 2
    • None

    Description

      Binding component nested in Loader and StackView leads to segfault in a following setup:

       

      pragma ComponentBehavior: Bound
      import QtQuick
      import QtQuick.Controls
      Window {
          id: root
          visible: true
          property Page page
          StackView {
              id: stack
              anchors.fill: parent
              initialItem: initialComponent
          }
          Component {
              id: initialComponent
              Loader {
                  sourceComponent: pageComponent
              }
          }
          Component {
              id: pageComponent
              Page {
                  id: page
                  contentItem: Item {
                      Button {
                          text: "reload"
                          onClicked: {
                              stack.clear()
                              stack.push(initialComponent)
                          }
                      }
                  }
                  Binding {
                      target: root
                      restoreMode: Binding.RestoreValue
                      property: "page"
                      value: page
                  }
              }
          }
      }
      

      Clicking "reload" several times leads to segfault.

      The same code works fine under 5.15.2

      Attachments

        1. Backtrace1.txt
          122 kB
        2. qt6_test_project.zip
          2 kB
        3. stack.txt
          4 kB
        For Gerrit Dashboard: QTBUG-135295
        # Subject Branch Project Status CR V

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            michalc Michał Cieślak
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There is 1 open Gerrit change