import QtQuick 2.15
Item {
id:root
property string colorValue: "red"
//signal clicked
Rectangle{
width: 620
height: 120
color: colorValue
//anchors.bottom: parent.bottom
//anchors.horizontalCenter: parent.horizontalCenter
MouseArea {
anchors.fill: parent
onClicked: root.clicked()
}
}
}
import QtQuick 2.15
Rectangle{
width: 620
height: 120
MouseArea {
anchors.fill: parent
}
}
Column{
x:200
y:200
spacing:200
ClickableColor{
id:areaA
color: "red"
}
ClickableColor{
id:areaB
color: "blue"
}
ClickableColor{
id:areaC
color: "green"
}
Rectangle { color: "red"; width: 50; height: 50 }
Rectangle { id: greenRect; color: "green"; width: 20; height: 50 }
Rectangle { color: "blue"; width: 50; height: 20 }
}