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

QML property alias not working

    XMLWordPrintable

Details

    Description

      Foo.qml:

      import QtQuick 1.0
      
      Item {
          width: 800
          height: 600
          Bar {
              theText.myValue: "foo"
          }
      }
      

      Bar.qml:

      import QtQuick 1.0
      
      Item {
          property alias theText: myText
          Baz {
              id: myText
              myValue: "bar"
          }
      }
      

      Baz.qml:

      import QtQuick 1.0
      
      Item {
          property string myValue: "baz"
          Text {
              text: myValue
              font.pointSize: 36
          }
      }
      

      On qmlviewer Foo.qml:
      file:///C:/cygwin/home/ryan/foo/Foo.qml:7:17: Cannot assign to non-existent property "myValue"
      theText.myValue: "foo"

      Attachments

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

        Activity

          People

            dajansen Damian Jansen (closed Nokia identity) (Inactive)
            ryan@enzosystems.com Ryan van der Bijl
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes