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

import Components - Qt creator show M300 Unknown Component

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • Qt Creator 13.0.2, Qt Creator 15.0.0
    • Quick / QML Support
    • Ubuntu
      Qt Creator 12.* 13.*
    • All

    Description

      I try Local Directory Imports into a qualified local namespace but without success,   but if I import by qrc the application builds and runs like expected but in Qt Creator the auto-completation doesn't work, and the Components imported into a qualified fails, not recognized at all the Qt creator show the error "M300 Unknown Component". 
      I found some related Qt Creator issues reported in pass:

      QTCREATORBUG-22392
      QTCREATORBUG-22839
      QTCREATORBUG-19637

      I think the problem is when import not in app directory

       

      ├── appX
      |     ├── mycomponents.qrc
      |     └── main.qml  
      |
      ├── appY
      |     ├── mycomponents.qrc
      |     └── main.qml  
      |
      └── shared
             └──  mycomponents              
                   ├── Component1.qml            
                   └── Component2.qml 

       

       

      mycomponents.qrc

       

      <RCC>
          <qresource prefix="/MyComponents">
              <file alias="Component1.qml">../shared/mycomponents/Component1.qml</file>
              <file alias="Component2.qml">../shared/mycomponents/Component2.qml</file>
          </qresource>
      </RCC> 

       

      when I try import in appX/main.qml

      import "qrc:/MyComponents" as MyComponents
      
      MyComponents.Component1 {
          // ...
      }

      this way works build and run but in Qt Creator not recognized show the error "M300 Unknown Component"

       

       

       

       

      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
            diackne Ricardo Guerra
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes