diff options
author | Martin Jones <martin.jones@nokia.com> | 2009-08-21 03:01:11 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2009-08-21 03:01:11 (GMT) |
commit | 1d9ae86dda99d8f0eb4949d3779777e795eb52be (patch) | |
tree | 3cd7d3ca2e9209a411011935e5dad4df56ca8bb6 /examples/declarative/mouseregion | |
parent | 0fd79d739bf102e406a8042eb20add5b1e8ebb10 (diff) | |
download | Qt-1d9ae86dda99d8f0eb4949d3779777e795eb52be.zip Qt-1d9ae86dda99d8f0eb4949d3779777e795eb52be.tar.gz Qt-1d9ae86dda99d8f0eb4949d3779777e795eb52be.tar.bz2 |
Add MouseRegion::pressedButtons property. Update mouseX/Y when hovered.
Diffstat (limited to 'examples/declarative/mouseregion')
-rw-r--r-- | examples/declarative/mouseregion/mouse.qml | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/examples/declarative/mouseregion/mouse.qml b/examples/declarative/mouseregion/mouse.qml index 18378ae..91f3b6e 100644 --- a/examples/declarative/mouseregion/mouse.qml +++ b/examples/declarative/mouseregion/mouse.qml @@ -9,6 +9,7 @@ Rectangle { Text { text: "Click"; anchors.centerIn: parent } MouseRegion { hoverEnabled: true + acceptedButtons: Qt.LeftButton | Qt.RightButton onPressed: { print('press (x: ' + mouse.x + ' y: ' + mouse.y + ' button: ' + (mouse.button == Qt.RightButton ? 'right' : 'left') + ' Shift: ' + (mouse.modifiers & Qt.ShiftModifier ? 'true' : 'false') + ')') } onReleased: { print('release (x: ' + mouse.x + ' y: ' + mouse.y + ' isClick: ' + mouse.isClick + ' wasHeld: ' + mouse.wasHeld + ')') } onClicked: { print('click (x: ' + mouse.x + ' y: ' + mouse.y + ' wasHeld: ' + mouse.wasHeld + ')') } |