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

qmllint: too many warnings when accessing an attached type from a value type

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • 6.8
    • 6.8
    • QML: Tooling
    • None
    • 13d5630ee (dev)

    Description

      The warning in the prefixed import type category has no location, and is followed by multiple warnings that all complain about the same thing (accessing an attached property of a valuetype in this case):

      Warning: /Users/sami/tmp/untitled66/Main.qml: Cannot use a non-QObject type QRectF to access prefixed import [prefixed-import-type]
      Warning: /Users/sami/tmp/untitled66/Main.qml:6:28: Type not found in namespace [unresolved-type]
      property int foo: rr.T.MyClass.i
      ^^^^^^^
      Warning: /Users/sami/tmp/untitled66/Main.qml:6:28: Member "MyClass" not found on type "QRectF" [missing-property]
      property int foo: rr.T.MyClass.i

      There is only the filename, but no line and column numbers for the [prefixed-import-type] warning. In qmlls, this warning is printed for the first line of the file because it has no line nor column number, see screenshot:

      Run qmllint on the attached project Archive.zip. The line and column should be 6:32 (at the rr keyword).

      These warnings should be cleaned up: we should only emit one warning instead of 3, and have proper locations on them.

      Attachments

        1. Archive.zip
          5 kB
        2. screenshot-1.png
          screenshot-1.png
          102 kB

        Issue Links

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

          Activity

            People

              qtqmlteam Qt Qml Team User
              sami.shalayel Sami Shalayel
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes