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

Crash in QQmlObjectCreator::setPropertyBinding()

    XMLWordPrintable

Details

    Description

      Accessing the ScrollBar and ButtonGroup attached properties causes a crash when qt.lab.controls components are wrapped in a qml module as suggested in the documentation

      In the given example, the code causing a crash is commented
      MyControls is a simple wrapper module around qt.labs.controls (see attached zip for the full code (the project does not copy the module automatically I just copied it by hand from the sources to the build directory))

      main.qml
      import QtQuick 2.5
      import QtQuick.Window 2.2
      import QtQuick.Dialogs 1.2
      
      import MyControls 1.0
      import Qt.labs.controls 1.0 as LabCtrl
      
      Window {
          title: qsTr("Hello World")
          width: 640
          height: 480
          visible: true
      
          ButtonGroup {
              id: grp
          }
      
          Row {
              id: row
      
              RadioButton {
                  text: "hello"
                  //ButtonGroup.group: grp // !!! This will crash !!!
                  LabCtrl.ButtonGroup.group: grp // !!! This works !!!
              }
      
              RadioButton {
                  text: "bye"
                  //ButtonGroup.group: grp // !!! This will crash !!!
                  LabCtrl.ButtonGroup.group: grp // !!! This works !!!
              }
          }
      
          Flickable {
             anchors.top: row.bottom
             width: 200
             height: 100
             contentWidth: 200
             contentHeight: 200
             clip: true
      
             //LabCtrl.ScrollBar.vertical: ScrollBar{} // !!! This will crash !!!
             //LabCtrl.ScrollBar.vertical: LabCtrl.ScrollBar{} // !!! This will crash !!!
      
             Rectangle {
               width: 200
               height: 200
               gradient: Gradient {
                 GradientStop {position: 0.0; color: "red"}
                 GradientStop {position: 0.5; color: "green"}
                 GradientStop {position: 1.0; color: "blue"}
               }
             }
          }
      }
      

      QQmlObjectCreator::setPropertyBinding() will fail to resolve the attached type but uses the null pointer to QQmlType anyway.
      This results in a crash without printing any useful information.

      Attachments

        Issue Links

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

          Activity

            People

              shausman Simon Hausmann
              Smatcher Benjamin Hautbois
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes