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

QML Code Model false Duplicate Id (M15) error

    XMLWordPrintable

Details

    Description

      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
      }
      

      Attachments

        1. DuplicateId.png
          132 kB
          Lysandra Sola
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

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

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes