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

Accessing aliased object's properties only works if the property has been declared in C++

    XMLWordPrintable

Details

    Description

       

      Define IconButton component:

      import QtQuick 2.0
      
      MouseArea {
          property alias icon: icon
          Image {
              id: icon
              property string custom
          }
      }
      

      You can access aliased object's properties when they have been declared in C++:

       

      IconButton {
         icon.source: "icon.png"
      }
      

       

      But not when the object's property has been declared in QML.

      Executing

       

      IconButton {
         icon.custom: "Value"
      }
      

      results in error "Cannot assign to non-existent property "custom".

      Attachments

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

        Activity

          People

            ulherman Ulf Hermann
            jpetrell Joona Petrell
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes