Important: Please read the Qt Code of Conduct -

Qt 5.11+: import of a qrc:/directory not working with QtQuickCompiler

  • Hi folks,

    when I use CONFIG += qtquickcompiler in my .pro-file the import statement doesn't work respectively auto-completation fails.

    My working tree looks like this:


    I want to use now A.qml in main.qml with this import statement:

    import "qrc:/other"

    My qrc-file looks like this

      <RCC version="1.0">
        <qresource prefix="/">
          <file alias="qml/main.qml">main.qml</file>
          <file alias="other/A.qml">../../other/qml/A.qml</file>

    If I use CONFIG += qtquickcompiler I get an "Unknown component" M300 failure but the application is working. Without CONFIG += qtquickcompiler everything is alright and auto-completion works.

    Do you have any idea how to solve this issue?


  • Moderators

    So that m300 error is shown only in Qt Creator, but application works normally, right? Then you should report this as a bug in Qt Creator.

  • Yes, the application works normally.

Log in to reply