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

Inline components from other QML files are not highlighted. Unknown component (M300) error

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • Qt Creator 12.0.2
    • Quick / QML Support
    • None
    • macOS

    Description

      Documentation tells it's perfectly OK to use inline components in other files
      https://doc.qt.io/qt-6/qtqml-documents-definetypes.html#inline-components

      In other files, it has to be prefixed with the name of its containing component.
      

      But in Creator it results in error in editor (works in runtime, though)

      Main.qml

      import QtQuick
      
      Window {
          width: 640
          height: 480
          visible: true
          title: qsTr("Hello World")
      
          MyComponent {}
          MyComponent.InlineComponent {}
      }
      

      MyComponent.qml

      import QtQuick
      
      Item {
      
          component InlineComponent: Text { }
      
          InlineComponent {}
      }
      

      Attachments

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

        Activity

          People

            qtqmlteam Qt Qml Team User
            sergei.nevdakh Sergei Nevdakh
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes