how to import multiple qml files in to main.qml file
-
i am new to qt qml , i just created one file with name of com1.qml in the same directory of the main.qml . In main qml i am importing the file using import "com1.qml" ,but it is throwing the error as QQmlApplicationEngine failed to load component
qrc:/main.qml:4 "comp1.qml": no such directorycan any please help?
-
Component names must start with capital letter. Rename your file to
Com1.qml. If it is in the same directory as main.qml, you don't need to import it. Just use it in main like this:Com1 { } -
Hi @venkatesh88,
Your custom component name should start with uppercase letter
// Comp1.qml
you don't need any import statement if your components are in the same dir, use them directly in the main.qmlComp1{} -
Hi @venkatesh88,
Your custom component name should start with uppercase letter
// Comp1.qml
you don't need any import statement if your components are in the same dir, use them directly in the main.qmlComp1{}@LeLev said in how to import multiple qml files in to main.qml file:
thanks it's worked