Suppose, I want to seperate Logic code from UI code as myApp.qml and myAppForm.ui.qml.
ui.qml does not support javascript logic, for example,mouse events.
Suppose, the following problem.
//myAppForm.ui.qml
import QtQuick 2.4
Item {
Rectangle {
id: rectangle1
color: "#a0ebfb"
anchors.fill: parent
MouseArea {
id: mouse1
anchors.fill: parent
}
}
}
The above is the UI code. I need to separate the logic code as,
//myApp.qml
import QtQuick 2.4
myAppForm {
mouse1{
onClicked: {
rectangle1.color = 'red'
}
}
}
Obviously, the above does not work. I am asking how to do something similar.
Thanks.