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

qmllint always deduces type of "this" to be "QObject"

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.8.1, 6.8, 6.9.0 FF
    • 6.7.2
    • QML: Tooling
    • None
    • 8e3547fda (dev), c67163939 (6.8)

    Description

      When using "this" in qml elements, linter deduces the type to be "QObject" and complains about missing member. Is this the intended behaviour and using "this" should be avoided, or will the type deduction later improve in qmllint?

      TextField {
          Layout.fillWidth: true
          text: root.controller.mOutputAlias
      
          onEditingFinished: root.controller.mOutputAlias = this.text
      }
      

      warning:

      Member "text" not found on type "QObject" [missing-property]
              onEditingFinished: root.controller.mOutputAlias = this.text
                                                                     ^^^^
      

      Attachments

        Issue Links

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

          Activity

            People

              ulherman Ulf Hermann
              friendnick Mykola Vankovych
              Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes