How to remove blue focus rectangle getting created on Bluetooth mouse onClick (TextField)
-
wrote on 31 Aug 2021, 11:53 last edited by Kuldip Somwanshi 9 Feb 2021, 04:32
I am using On Lenovo tablet m10 and the torgus bluetooth mouse and with these running my application then clicking on textfield after that get the blue rectangle as shown in pictures.
if I navigate to the next page then the rectangle will stay on the same position . This is happening with QT sample examples too as shown in the below screenshots
-
wrote on 1 Sept 2021, 07:55 last edited by Markkyboy 9 Jan 2021, 07:56
Here's an option;
import QtQuick 2.12 import QtQuick.Window 2.12 import QtQuick.Controls 2.12 Window { width: 640 height: 480 visible: true color: "grey" title: qsTr("Hello World") Column { spacing: 10 anchors.centerIn: parent TextField { width: 200 font.pixelSize: 36 focus: false background: Rectangle { border.color: "blue" // box border color border.width: 2 color: "lightblue" // background box color } color: "black" // text color } TextField { width: 200 font.pixelSize: 36 background: Rectangle { border.color: "yellow" border.width: 1 color: "orange" } color: "lime" selectionColor: "green" } } }
-
Here's an option;
import QtQuick 2.12 import QtQuick.Window 2.12 import QtQuick.Controls 2.12 Window { width: 640 height: 480 visible: true color: "grey" title: qsTr("Hello World") Column { spacing: 10 anchors.centerIn: parent TextField { width: 200 font.pixelSize: 36 focus: false background: Rectangle { border.color: "blue" // box border color border.width: 2 color: "lightblue" // background box color } color: "black" // text color } TextField { width: 200 font.pixelSize: 36 background: Rectangle { border.color: "yellow" border.width: 1 color: "orange" } color: "lime" selectionColor: "green" } } }
wrote on 2 Sept 2021, 04:33 last edited by@Markkyboy This one tried but not worked please could you suggest some other solution
-
@Markkyboy This one tried but not worked please could you suggest some other solution
@Kuldip-Somwanshi that focus rectangle comes from android directly.
As far as I know, you can't change that from Qt/Qml code.
Maybe you could disable it with some java code / styles, but I don't know how exactly 🤷♂️
-
@Markkyboy This one tried but not worked please could you suggest some other solution
wrote on 17 Apr 2024, 16:14 last edited by@Kuldip-Somwanshi have you ever solved this? I couldn't find a solution anywhere