I want to implement the following scenario in QML.
Here is a sample/simplified delegat
I was faced by this same problem, and came across the answer in the QtQuick 5.0 documentation for MouseArea. The answer to this is actually quite simple.
If you want to include child mouse hover events in your parent MouseArea
, make you child MouseArea
a child of the parent MouseArea
:
MouseArea {
id: parent
MouseArea {
id: child
}
}
Since I have a custom Widget
type that would be used as the parent view, I ended up with the default
property being the children of the MouseArea
:
Item {
default property alias children: mouseArea.data
MouseArea {
id: mouseArea
}
}