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

qmllint does not recognize JS array functions on QQmlListProperty

    XMLWordPrintable

Details

    • 1879c8a6ba (qt/qtdeclarative/dev) 1879c8a6ba (qt/tqtc-qtdeclarative/dev)

    Description

      Code

      import QtQuick
      
      Item {
          id: root
          property Item dummy: Item {}
      
          Component.onCompleted: {
              console.log("Before pushing: " + root.children.length)
              root.children.push(root.dummy)
              console.log("After pushing: " + root.children.length)
          }
      }
      

       

      QML output

      qml: Before pushing: 0
      qml: After pushing: 1
      

       

      qmllint output

      Warning: ListPush.qml:9:17: Property "push" not found on type "QQmlListProperty<QObject>"
                      root.children.push(root.dummy)
                                    ^^^^
      

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-104706
          # Subject Branch Project Status CR V

          Activity

            People

              ulherman Ulf Hermann
              skoh-qt Sze Howe Koh
              Votes:
              6 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes