Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

134
Views
warning only in design view on import statement to use qml component from file

I have a .qml file with a component 2 steps above in my project path because I want to have a component folder above many projects to be shared by some of these. So in my main.qml I do:

import 'qrc:/../../components'

That works and I can use my qml component from file. However in the design view, I get the warning:

found not working imports: ...<file and import line number where the import is> "qrc:/../../components": no such directory

Many other things I tried make the project not compile or throwns error at runtime.

Trial1: import "qrc:/": compile time error: Unknown component. (M300). Makes sense as the component is in a path above.
Trial2: import './../../components': runtime error: import "./../../components" has no qmldir and no namespace.
Tried also to put a qmldir file in my components folder where my component is with the text "MyComponent MyComponent.qml" as explained in Importing QML Document Directories

Apart from the warning everything works fine. Project compiles, runs and the changes in the component are shown when I work in the design view.

info:
-> component resource is added to the .qrc resource file, and the file exists (project works)
-> QtQuick version QtQuick 2.9
-> Qt Creator 4.15.2 Based on Qt 5.15.2

How do I get rid of the warning?

Edit: I also tried following the steps of this answer with no success.

Adding the content of my .qrc file:

<RCC>
    <qresource prefix="/">
        ...<other not relevant resources>
        <file>../../components/MyComponent.qml</file>
    </qresource>
</RCC>

Screenshot of the warning:

enter image description here

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Adding an alias for the file in your .qrc should resolve the issue, like so:

<file alias="MyComponent.qml">../../components/MyComponent.qml</file>

and then for your import statement simply:

import "qrc:/"

The alias should resolve whatever relative path issue is causing the warning to be thrown by the designer.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!