Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-32418

QML Code Model false Duplicate Id (M15) error

XMLWordPrintable

      When there is a component and an instance which both have the same id, the "built-in" QML Code model incorrectly classifies both of these ids as instance ids and displays a "Duplicate Id. (M15)" error in the editor.
      The error does not occur when qmllint is run nor when the QML Language Server is turned on, since it correctly identifies that the component id is not an instance id.

      import QtQuick
      
      Window {
      width: 640
      height: 480
      visible: true
      title: qsTr("Hello World")
      
      component MyComponent : Item {
      id: myComponent
      Item {
      anchors.fill: myComponent
      }
      }
      
      MyComponent {
      id: myComponent
      }
      

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

            qtqmlteam Qt Qml Team User
            lysandra.sola Lysandra Sola
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes