how to import multiple qml files in to main.qml file
-
wrote on 5 Nov 2018, 09:57 last edited by
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 { }
-
wrote on 5 Nov 2018, 10:05 last edited by ODБOï 11 May 2018, 10:15
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{}
wrote on 5 Nov 2018, 10:25 last edited by@LeLev said in how to import multiple qml files in to main.qml file:
thanks it's worked
4/4