MouseArea.hoverEnabled not working?
-
Hi,
I am new to QML and am just starting to go through the tutorials. I am experienced in Qt so I know hove the mouse hover attribute affects mouse events so I am wondering why this code sample below doesn't change the rectangle color without pressing/holding down a mouse button?
Either I'm really blind and not seeing the issue or it is hoverEnabled that is not working. I am using Nokia SDK 1.0.2 (with its Qt 4.7.0).
@
import Qt 4.7Rectangle {
width: 300
height: 100
id:simplebutton
border.width: 5property color onHoverColor: "yellow"
property color defaultColor: "blue"MouseArea {
id: buttonMouseArea
anchors.fill: parent
hoverEnabled: true
onEntered: parent.border.color = onHoverColor
onExited: parent.border.color = defaultColor
}
}
@Thanks for any help.
-
-
Do you run this code in Nokia Simulator? hoverEnabled thingy works perfectly for me in qmlviewer.
-
The example is running with QDeclarativeView in the Symbian simulator under Linux (Ubuntu 10.10). I think that strekazoid is on the right track with his comment. The simulator is probably simulating a phone touchscreen which doesn't know your "mouse" (i.e. finger) position until the screen is actually touched. Consequentially, hovering cannot exist on those devices.