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

Add a new QQmlComponent::Status value that represents the stage of component creation before Ready, after QQmlComponentPrivate::beginCreate has finished

    XMLWordPrintable

Details

    Description

      This is needed in order to support declaring the pressed property of PageIndicator's delegate as required:

      import QtQuick
      import QtQuick.Controls.Material
      
      ApplicationWindow {
          width: 640
          height: 480
          visible: true
      
          PageIndicator {
              id: control
              count: 3
              delegate: Rectangle {
                  implicitWidth: 8
                  implicitHeight: 8
      
                  radius: width / 2
                  color: control.palette.dark
      
                  opacity: index === control.currentIndex ? 0.95 : pressed ? 0.7 : 0.45
      
                  required property int index
                  required property bool pressed
      
                  Behavior on opacity { OpacityAnimator { duration: 100 } }
              }
          }
      }
      

      Currently this results in the following error:

      qrc:/quick/Main.qml:12:19: QML Component: Cannot create delegate
      qrc:/quick/Main.qml:22:13: Required property pressed was not initialized
      

      We need a new status for when the object has been constructed, but the initial properties haven't been set yet. So before Ready, basically after QQmlComponentPrivate::beginCreate is done.

      Attachments

        Issue Links

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

          Activity

            People

              qtqmlteam Qt Qml Team User
              mitch_curtis Mitch Curtis
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes