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

QQmlPropertyValueSource does not work with aliased properties of inline components

XMLWordPrintable

    • 547f5761cb31600c9669ba205512fa0b6c7d36da (qt/qtdeclarative/dev)

      When using the on <property> feature of QQmlPropertyValueSource on an aliased property of a inline component, the QML engine fails:

      Reproduction:

      import QtQuick 2.12
      import QtQuick.Controls 2.5
      
      ApplicationWindow {
          visible: true
          component MyText: Text {
              id: myText
              property alias foo: myText.text
              property string bar
              text: bar
          }
      
          MyText {
              foo: "ok"
          }
          MyText {
              Binding on bar {
                  value: "ok"
              }
          }
          MyText {
              id: myText
              Binding {
                  target: myText
                  property: "foo"
                  value: "ok"
              }
          }
          MyText {
              Binding on foo {
                  value: "ko" // QQmlApplicationEngine failed to load component
              }               // qrc:/main.qml:30:20: Cannot assign to non-existent property "foo"
          }
      }
      
      

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

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            grecko Pierre-Yves Siret
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes