Skip to content

Commit 0364c4d

Browse files
committed
qmlplayer: auto hide cursor
1 parent 91873b8 commit 0364c4d

File tree

1 file changed

+6
-0
lines changed
  • examples/QMLPlayer/qml/QMLPlayer

1 file changed

+6
-0
lines changed

examples/QMLPlayer/qml/QMLPlayer/main.qml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ Rectangle {
234234
MouseArea {
235235
anchors.fill: parent
236236
hoverEnabled: true
237+
cursorShape: control.opacity > 0 || cursor_timer.running ? Qt.ArrowCursor : Qt.BlankCursor
237238
onWheel: {
238239
var deg = wheel.angleDelta.y/8
239240
var dp = wheel.pixelDelta
@@ -273,6 +274,7 @@ Rectangle {
273274
}
274275

275276
onMouseXChanged: {
277+
cursor_timer.start()
276278
if (mouseX > root.width || mouseX < 0
277279
|| mouseY > root.height || mouseY < 0)
278280
return;
@@ -299,6 +301,10 @@ Rectangle {
299301
}
300302
}
301303
}
304+
Timer {
305+
id: cursor_timer
306+
interval: 2000
307+
}
302308
}
303309
}
304310
Text {

0 commit comments

Comments
 (0)