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

`required property` fail only for last object

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • 6.5.0 Beta1
    • 5.15.2, 6.3.2, 6.4.0
    • QML: Tooling
    • b6ba7e9c90 (qt/qtdeclarative/dev) b6ba7e9c90 (qt/tqtc-qtdeclarative/dev)

      When several instances are created from component with `required property`, application will fail to start only when last instance doesn't set value to the property.
      Comment property set for the last instance and uncomment for the first instance and application will fail to start.
      Example code:

      import QtQuick 2.15
      import QtQuick.Controls 2.15
      import QtQuick.Window 2.15
      
      Window {
          width: 640
          height: 480
          visible: true
          component AccessibleButton : Button {
              required property string description
              Accessible.description: description
          }
          AccessibleButton {
              //description: "" // Uncomment this line
          }
          AccessibleButton {
              description: "" // Comment this line
          }
      }
      

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

            ulherman Ulf Hermann
            areharu Alexey Zinoviev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes