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

ListElement custom property access not possible

    XMLWordPrintable

Details

    Description

      Custom property access denied to due to potential undefined access, for example when trying to assign a custom property to a string, got warning:"Cannot assign potential undefined to QString of (component in  with type QString [compiler]"

      Snippet to reproduce the issue:

       

      import QtQuick 
      Window {
          id: window
          width: 640
          height: 480
          visible: true
          title: qsTr("Hello World")
          
          property ListModel myList: ListModel {
              ListElement {
                  effect: "active"
              }
          }
          
          property string effectState
          Component.onCompleted: {
              effectState = myList.get(0).effect
          }
      }
      

       

      Attachments

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

        Activity

          People

            qtqmlteam Qt Qml Team User
            kitruong Kinh Truong
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes