From a9445c3b9c8f51a229b62c25df1aeebe5c85c88d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antti=20H=C3=B6ltt=C3=A4?= Date: Mon, 3 Dec 2018 13:44:15 +0100 Subject: Cursor now movable only to items that set the acceptsCursor value to true --- DemoApplication/controls/CNButton.qml | 4 ++-- DemoApplication/pages/Page1.qml | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'DemoApplication') diff --git a/DemoApplication/controls/CNButton.qml b/DemoApplication/controls/CNButton.qml index 33299d1..19dcb8e 100644 --- a/DemoApplication/controls/CNButton.qml +++ b/DemoApplication/controls/CNButton.qml @@ -8,7 +8,7 @@ Button { implicitHeight: 40 CursorNavigation.acceptsCursor: true - property bool hasCursor: CursorNavigation.hasCursor + //property bool hasCursor: CursorNavigation.hasCursor background: Rectangle { anchors.fill: parent @@ -31,7 +31,7 @@ Button { border.width: 2 border.color: "red" anchors.fill: parent - visible: root.hasCursor + visible: root.CursorNavigation.hasCursor color: "transparent" } } diff --git a/DemoApplication/pages/Page1.qml b/DemoApplication/pages/Page1.qml index a140c6e..84ef0a7 100644 --- a/DemoApplication/pages/Page1.qml +++ b/DemoApplication/pages/Page1.qml @@ -71,6 +71,14 @@ Item { y: 241 text: qsTr("Button") } + + CNButton { + id: button8 + x: 210 + y: 138 + text: qsTr("Button (cursor off)") + CursorNavigation.acceptsCursor: false + } } //this seems to be the way to force focus on a newly opened dialog? Component.onCompleted: { forceActiveFocus(); } -- cgit v1.2.3