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 set focus on tabs button
Qt 6.11 is out! See what's new in the release blog

How to set focus on tabs button

Scheduled Pinned Locked Moved Solved QML and Qt Quick
2 Posts 1 Posters 1.5k 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.
  • R Offline
    R Offline
    RadChand
    wrote on last edited by RadChand
    #1

    Hi!
    I have to specify order of passage buttons in TabView including its header (buttons on tab bar).
    If I don't use KeyNavigation I can navigate (by Tab key) through my buttons (b11, b12) and header of TabView (tab1, tab2, tab3).
    But, if I use KeyNavigation I can navigate only through buttons (b11, b12).
    How to specify tab bar in KeyNavigation.tab: ??? (I try set 'tab' and 'tabView' - doesn't work.)
    Is there another way to set focus on header of TabView?

    Build with Desktop Qt 5.7.0 MSVC2015 32bit

    import QtQuick 2.7
    import QtQuick.Window 2.2
    import QtQuick.Layouts 1.1
    import QtQuick.Controls 1.4
    import QtQuick.Controls.Styles 1.2
    
    Window {
        visible: true
        width: 640
        height: 480
        title: qsTr("Hello World")
    
        TabView {
            id: tabView
            anchors.fill: parent
            Tab {
                id: tab1
                title: 'tab1'
                Row {
                    Button { id: b11; text: 'b11'; KeyNavigation.tab: b12 }
                    Button { id: b12; text: 'b12'; KeyNavigation.tab: tabView /*tab1*/}
                }
            }
            Tab { title: 'tab2'; Button { text: 'b21' } }
            Tab { title: 'tab3'; Button { text: 'b31' } }
        }
    }
    

    Andrew

    1 Reply Last reply
    0
    • R Offline
      R Offline
      RadChand
      wrote on last edited by RadChand
      #2

      I've found a back door ))
      TabBar is first child of TabView

      KeyNavigation.tab: tabView.children[0] // it works
      
      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