Import QML File from QRC
-
wrote on 2 Aug 2015, 20:27 last edited by
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
-
wrote on 3 Aug 2015, 04:49 last edited by
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.
-
wrote on 3 Aug 2015, 18:23 last edited by
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 ? -
wrote on 3 Aug 2015, 18:30 last edited by
Once again, you don't need to import it. You should be able to instantiate it without a problem.
importFile { id: test }
-
wrote on 3 Aug 2015, 20:29 last edited by
ahh okay thank you ^^
1/5