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

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

XMLWordPrintable

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

      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
                                                                     ^^^^
      

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes