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 do I make my custom button element focusable?
Qt 6.11 is out! See what's new in the release blog

How do I make my custom button element focusable?

Scheduled Pinned Locked Moved Solved QML and Qt Quick
buttoncustom widgetfocus
3 Posts 2 Posters 2.3k Views 1 Watching
  • 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    I have a bunch of custom text input elemnts with TextInput inside of them. I can switch focus with tab easily. How do I get the same functionality with my custom button element? It only consits of Rectangles and MosueAreas. I can set the focus to true manually in the code, but when using Tab it never gets focus.

    p3c0P 1 Reply Last reply
    0
    • ? A Former User

      I have a bunch of custom text input elemnts with TextInput inside of them. I can switch focus with tab easily. How do I get the same functionality with my custom button element? It only consits of Rectangles and MosueAreas. I can set the focus to true manually in the code, but when using Tab it never gets focus.

      p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      @archeria Set activeFocusOnTab to true for each Item. Then to check if Item is in focus use:

       onFocusChanged: if(focus) console.log("In Focus")
      

      157

      ? 1 Reply Last reply
      1
      • p3c0P p3c0

        @archeria Set activeFocusOnTab to true for each Item. Then to check if Item is in focus use:

         onFocusChanged: if(focus) console.log("In Focus")
        
        ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        @p3c0 Thank you! Works fine.

        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