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

qmllint does not properly warn about duplictaed ids

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • 6.3
    • 6.2, 6.3
    • QML: Tooling
    • 096a1c4f6e (qt/qtdeclarative/dev) 096a1c4f6e (qt/tqtc-qtdeclarative/dev)

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

       

       

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes