i try to import(Cell.qml) in main.qml,but i'm getting this error:QML debugging is enabled. Only use this in a safe environment. QQmlApplicationEngine failed to load component qrc:/main.qml:4 "Cell.qml": no such directory
In our main QML file, we use our Cell component to create the color picker. how can i fixed that?
import QtQuick 2.9
import QtQml 2.0
import "Cell.qml"
Rectangle {
id:page
width:320;height: 480
color: "lightgray"
Text {
id: helloText
text: "Hello World";
y:30
anchors.horizontalCenter: page.horizontalCenter
font.pointSize: 24; font.bold: true
}
Grid {
id:colorPicker
x:4;anchors.bottom: page.bottom;anchors.bottomMargin: 4
rows: 2;columns: 3;spacing: 3
Cell{cellColor: "red";onClicked: helloText.color=cellColor}
Cell{cellColor: "green";onClicked: helloText.color=cellColor}
Cell{cellColor: "blue";onClicked: helloText.color=cellColor}
Cell{cellColor: "yellow";onClicked: helloText.color=cellColor}
Cell{cellColor: "steelblue";onClicked: helloText.color=cellColor}
Cell{cellColor: "black";onClicked: helloText.color=cellColor}
}
}
Cell {}. The syntax you use is for folder content import. Read this article for more help - folibis