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 manually activate CheckBox blue focus indicator ?
Forum Update on Monday, May 27th 2025

How to manually activate CheckBox blue focus indicator ?

Scheduled Pinned Locked Moved Solved QML and Qt Quick
checkboxqmlquickquick controls
2 Posts 1 Posters 629 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.
  • M Offline
    M Offline
    Mixlu
    wrote on 12 Jan 2021, 14:32 last edited by
    #1

    Hello,

    Working with CheckBox, I am trying to manually activate the blue focus indicator, this one :

    960b6685-55a3-4425-9915-9b0179e3d1d8-image.png

    I see this indicator by pressing tab, but when setting focus property to true this indicator doesn't appear.

    I tried this :

    Window {
        width: 640
        height: 480
        visible: true
    
        Column {
            CheckBox {
                id: chekbox
            }
    
            Button {
                onClicked: {
                    chekbox.focus = true
                }
            }
        }
    }
    

    By pressing the button I correctly having the focus on the checkbox (when I press space the checkbox toggle), but the blue indicator doesn't appear.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      Mixlu
      wrote on 12 Jan 2021, 14:46 last edited by
      #2

      Problem solved by calling chekbox.forceActiveFocus(Qt.TabFocusReason)

      1 Reply Last reply
      0

      2/2

      12 Jan 2021, 14:46

      • Login

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