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

Quick Controls 1 StackView crashes at push with url

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P1: Critical
    • None
    • 5.12.3
    • Quick: Controls 1
    • None
    • All

    Description

      Qt Quick applications crash whenever an Item gets pushed to a StackView via URL, but only in case some Item was pushed to a StackView before as Component:

      import QtQuick 2.9
      import QtQuick.Window 2.2
      import QtQuick.Controls 1.4
      
      Window {
        visible: true
        width: 640
        height: 480
        title: qsTr("StackView Crash")
      
        // example component to be pushed
        Component {
          id: someItemComp
          Rectangle { color: "lightyellow" }
        }
      
        // two stack views, as the issue also occurs across different stack views
        StackView {
          id: stackView1
          width: parent.width
          height: parent.height / 2
        }
      
        StackView {
          id: stackView2
          width: parent.width
          height: parent.height / 2
          y: height
        }
      
        // Row with Three buttons to push items to the above views.
          Row {
          anchors.centerIn: parent
      
          // Push the example component to any of the stacks with one of the first two buttons.
           Button {
            text: "Stack 1: Push Comp"
            onClicked: stackView1.push({ item: someItemComp })
          }
      
          Button {
            text: "Stack 2: Push Comp"
            onClicked: stackView2.push({ item: someItemComp })
          }
      
          // As soon as you press the third button, to push an Item via URL, the application crashes.
          // This only happens when a component was pushed before with one of the above buttons.
          // Press this third button first, and no crashes will happen regardless of the way items are pushed to the stacks afterwards.
          Button {
            text: "Stack 2: Push URL"
            onClicked: stackView2.push({ item: Qt.resolvedUrl("SomeItem.qml") })
          }
        }
      }
      

      Mainly tested on macOS. The crash happens across platforms, experienced on Win, macOS, Linux, as well as iOS and Android. 

      Attachments

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

        Activity

          People

            mitch_curtis Mitch Curtis
            GTDev Günther Teufl
            Votes:
            6 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes