Best Practices: Nest elements inside MouseArea or nest MouseArea inside element?
QML and Qt Quick
3
Posts
2
Posters
779
Views
1
Watching
-
Hi,
Can you give simple examples of what you want to say ?
-
@
MouseArea
{
width: 400
height: 100
Rectangle
{
anchors.fill: parent
color: "red"
Text
{
text: "btn"
}
}
onClicked:
{
console.log("hi I've been clicked")
}
}
@
vs
@
Rectangle
{
width: 400
height: 100
color: "red"
Text
{
text: "btn"
}
MouseArea
{
anchors.fill: parent
onClicked:
{
console.log("hi I've been clicked")
}
}
}
@