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

`required property` fail only for last object

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • 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)

    Description

      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
          }
      }
      

      Attachments

        For Gerrit Dashboard: QTBUG-108291
        # Subject Branch Project Status CR V

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes