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

REG: Binding to var properties that are undefined is broken in 6.2.0

    XMLWordPrintable

Details

    • e67b6c3ab9b3fe32dbc248b7349247a329736d66 (qt/qtdeclarative/dev) 2fd54b5bef7dd2c8dd21ab7d2ff66145df1e4fa2 (qt/qtdeclarative/6.2)

    Description

      The expected behaviour of the code below is that setting a property with a RESET property attribute calls the reset function for that property. The reset function is being called, yet something has broken here. In the case of width and height, that should result in them being set to the relevant implicit size properties (the bindings for which look like this for Button, for example). This works in 6.1.1 but broke in 6.2.0.

      import QtQuick 2.0
      import QtQuick.Controls 2.0
      
      ApplicationWindow {
          x: 800
          y: 400
          width: 400
          height: 400
          visible: true
      
          QtObject {
              id: theme
      
              property var toolButtonWidth: undefined
              property var toolButtonHeight: undefined
          }
      
          Button {
              id: root
              text: "Button"
              // Doesn't work with >= 6.0
              width: theme.toolButtonWidth
              height: theme.toolButtonHeight
              // Works
      //        width: undefined
      //        height: undefined
              anchors.centerIn: parent
              onClicked: print("clicked")
          }
      }
      

      Attachments

        Activity

          People

            fabiankosmale Fabian Kosmale
            mitch_curtis Mitch Curtis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: