From c49bb5bda32477a878b6b82b99f853cef1340890 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Wed, 15 May 2019 14:58:01 +0200 Subject: 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 --- src/imports/controls/material/CursorDelegate.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v1.2.3