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

qmllint does not properly warn about duplictaed ids

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 6.2, 6.3
    • Fix Version/s: 6.3
    • Component/s: QML: Tooling
    • Labels:
    • Commits:
      096a1c4f6e (qt/qtdeclarative/dev) 096a1c4f6e (qt/tqtc-qtdeclarative/dev)

      Description

      Consider 

       

      import QtQuick
      
      Item {
          id: root
          Item {
              id: root
          }
      }
      

      qmllint will not warn about the duplicate id. Furthermore, when accessing properties that exist only one one of the types (and the "wrong" type is picked internally), we end up with rather confusing error messages:

       

      import Qt
      QuickItem {
          id: root
          property var s
          Rectangle {
              id: root
              property var t: root.s
          }
      }
      

      will result in the not so obvious

      Warning: test.qml:9:30: Property "s" not found on type "Rectangle"
      {{ property var t: root.s}}

       

       

        Attachments

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

          Activity

            People

            Assignee:
            fabiankosmale Fabian Kosmale
            Reporter:
            fabiankosmale Fabian Kosmale
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes