Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How to remove blue focus rectangle getting created on Bluetooth mouse onClick (TextField)
QtWS25 Last Chance

How to remove blue focus rectangle getting created on Bluetooth mouse onClick (TextField)

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
qmltextfieldbluetooth mauseonclickedandroid
5 Posts 4 Posters 1.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kuldip Somwanshi
    wrote on last edited by Kuldip Somwanshi
    #1

    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.

    a53e192c-638d-4406-8077-964924c98011-image.png

    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

    fbd6cc93-e824-471a-9574-c314faffa566-image.png

    1 Reply Last reply
    0
    • MarkkyboyM Offline
      MarkkyboyM Offline
      Markkyboy
      wrote on last edited by Markkyboy
      #2

      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"
              }
          }
      }
      

      Capture.JPG

      Don't just sit there standing around, pick up a shovel and sweep up!

      I live by the sea, not in it.

      K 1 Reply Last reply
      0
      • MarkkyboyM Markkyboy

        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"
                }
            }
        }
        

        Capture.JPG

        K Offline
        K Offline
        Kuldip Somwanshi
        wrote on last edited by
        #3

        @Markkyboy This one tried but not worked please could you suggest some other solution

        J.HilkJ I 2 Replies Last reply
        0
        • K Kuldip Somwanshi

          @Markkyboy This one tried but not worked please could you suggest some other solution

          J.HilkJ Offline
          J.HilkJ Offline
          J.Hilk
          Moderators
          wrote on last edited by
          #4

          @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 🤷‍♂️


          Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


          Q: What's that?
          A: It's blue light.
          Q: What does it do?
          A: It turns blue.

          1 Reply Last reply
          1
          • K Kuldip Somwanshi

            @Markkyboy This one tried but not worked please could you suggest some other solution

            I Offline
            I Offline
            imperador
            wrote on last edited by
            #5

            @Kuldip-Somwanshi have you ever solved this? I couldn't find a solution anywhere

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved