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

qmllint does not know the type of "this"

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Not Evaluated
    • 6.8.1
    • 6.8.0
    • QML: Tooling
    • None

    Description

      qmllint does not know the type of "this", interpreting every "this" as being of type "QObject", however id references to the same object work. "Item" can be replaced with any other type.

      import QtQuick
      
      Item {
          id: object
          property string test: "test";
          function testfn() {
              console.log(this.test)
              console.log(object.test)
          }
      }
      

      produces

      $ qmllint test/qmllsthis.qml -I [...]
      Warning: test/qmllsthis.qml:9:20: Member "test" not found on type "QObject" [missing-property]
              console.log(this.test)
                               ^^^^
      

      qmlls reports the same.

      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
            outfoxxed outfoxxed -
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes