diff options
authorRichard Moe Gustavsen <richard.gustavsen@qt.io>2019-05-15 14:58:01 +0200
committerRichard Moe Gustavsen <richard.gustavsen@qt.io>2019-05-15 17:38:29 +0000
commitc49bb5bda32477a878b6b82b99f853cef1340890 (patch)
parent7431b0549a9bb69f5f4a036fc931683dd4e20d2c (diff)
CursorDelegate: stop cursor timer when interval is set to 0
The cursor flash iterval can sometimes be set to 0. This is done from e.g the iOS plugin while selecting text, since the cursor should not flash when the user is dragging it around inside a magnifier glass. Setting the interval to 0 simply means "don't flash", rather than "hide the cursor". But setting the interval of a QML Timer to 0 will cause it to never trigger, which is not what we want, since then the cursor can end up staying hidden if done in-between two "flashes". This patch will add an extra condition that checks for this case. Fixes: QTBUG-75844 Change-Id: Ib1ca594a49a18cb161a2b2a67928fb6766984988 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
1 files changed, 1 insertions, 1 deletions
diff --git a/src/imports/controls/material/CursorDelegate.qml b/src/imports/controls/material/CursorDelegate.qml
index f472e8ae..1626a6fb 100644
--- a/src/imports/controls/material/CursorDelegate.qml
+++ b/src/imports/controls/material/CursorDelegate.qml
@@ -55,7 +55,7 @@ Rectangle {
Timer {
id: timer
- running: cursor.parent.activeFocus && !cursor.parent.readOnly
+ running: cursor.parent.activeFocus && !cursor.parent.readOnly && interval != 0
repeat: true
interval: Qt.styleHints.cursorFlashTime / 2
onTriggered: cursor.opacity = !cursor.opacity ? 1 : 0