Problems with Open-Source Downloads read https://www.qt.io/blog/problem-with-open-source-downloads and https://forum.qt.io/post/638946
Import QML File from QRC
-
Hello Guys,
my main.qml is in qml.qrc// directory.
my import file is also in this qrc directory.
i try this paths
import "qrc:/importFile.qml" as ImportFile
import "qrc:///importFile.qml" as ImportFile
import "importFile.qml" as ImportFile
but is not workingthanks in the advance for the help
-
If both qml files have the same prefix (in your case, /), you don't need to import it. Use the filename without extension to instantiate it.
-
yes both files have the prefix / but this path
import "importFile.qml" as ImportFile
is not working the error is that
QML debugging is enabled. Only use this in a safe environment.
QQmlApplicationEngine failed to load component
qrc:///main.qml:4 "collectionView.qml": no such directory
maybe i must change my main.cpp file ?
-
Once again, you don't need to import it. You should be able to instantiate it without a problem.
importFile { id: test }
-
ahh okay thank you ^^