Mouse area overlapping
-
I need to change a little ImageHover logic, but now it's working. Thanks
-
puelocesar, you've changed z-order or you have done something other? If second it will be good if you can post the solution
-
My problem was: I have a circle, and when the circle mouse overs, a set of options appear above the circle.
So, when I moused over the Circle, I set the options opacity to 1, showing them. And when I moused over one of the options, that were inside the circle, the option would change it's color to orange.
But the mouse area's of the options and the circle were overlapping, so it wasn't working.
The solution was to put the Circle's MouseArea under the options (z-order), and adding the logic that was only on circle's mousearea inside the options mouseareas. So the overlapping wasn't a problem anymore.
Is this making any sense? it was very difficult to explain that without drawing :P
-
Resuming, I changed the z order of the circle, and changed this on ImagemHover:
@import Qt 4.7
Image {
property string nome: "buscar"
property bool hover: false
source: "img/"+ nome +"_normal.png"opacity: bola_hover ? 1 : 0 Behavior on opacity { PropertyAnimation {} } Image { id: hover source: "img/"+ nome +"_hover.png" opacity: 0 Behavior on opacity { PropertyAnimation {} } } MouseArea { anchors.fill: parent hoverEnabled: true onEntered: { hover.opacity = 1; bola_hover = true } onExited: { hover.opacity = 0; bola_hover = false } }
}
@ -
puelocesar, it makes sense :)
-
has anyone ever documented the double mouse area problem to nokia?
-
kyleplattner, yes, it was discussed somewhere here at DevNet.
-
Filed as (QTCREATORBUG-3303).
-
For the sake of completeness, link to the bug report. Now it is "QTBUG-15900":http://bugreports.qt.nokia.com/browse/QTBUG-15900