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. TabView switching position
Forum Updated to NodeBB v4.3 + New Features

TabView switching position

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 2 Posters 777 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.
  • A Offline
    A Offline
    alecs26
    wrote on last edited by
    #1

    Hi,

    I am doing a form with QML Controls 2. In this form, there are 3 tabs. I did these tabs with TabView, TabButton and StackLayout.
    It works well except for one thing: when I click on the tabs, the tab order changes and I want them to remain fixed.
    For instance the tabs are a,b,c. If I click on b, they become b,c,a. I didn't find any option for the tabs to remain fixed.

    Thank you very much,

    Alex

       TabBar
        {
            id: bar
            width: (configwindow.width)
            TabButton
            {
                text: qsTr("a")
                width: (configwindow.width)*0.3
            }
            TabButton
            {
                text: qsTr("b")
                width: (configwindow.width)*0.3
            }
            TabButton
            {
                text: qsTr("c")
                width: (configwindow.width)*0.3
            }
         }
    
    
        StackLayout
        {
            width: parent.width
            currentIndex: bar.currentIndex
            Item
            {
                id: homeTab
            }
            Item
            {
                id: discoverTab
            }
            Item
            {
                id: activityTab
            }
        }
    
    raven-worxR 1 Reply Last reply
    0
    • A alecs26

      Hi,

      I am doing a form with QML Controls 2. In this form, there are 3 tabs. I did these tabs with TabView, TabButton and StackLayout.
      It works well except for one thing: when I click on the tabs, the tab order changes and I want them to remain fixed.
      For instance the tabs are a,b,c. If I click on b, they become b,c,a. I didn't find any option for the tabs to remain fixed.

      Thank you very much,

      Alex

         TabBar
          {
              id: bar
              width: (configwindow.width)
              TabButton
              {
                  text: qsTr("a")
                  width: (configwindow.width)*0.3
              }
              TabButton
              {
                  text: qsTr("b")
                  width: (configwindow.width)*0.3
              }
              TabButton
              {
                  text: qsTr("c")
                  width: (configwindow.width)*0.3
              }
           }
      
      
          StackLayout
          {
              width: parent.width
              currentIndex: bar.currentIndex
              Item
              {
                  id: homeTab
              }
              Item
              {
                  id: discoverTab
              }
              Item
              {
                  id: activityTab
              }
          }
      
      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @alecs26
      what version of Qt are you using exactly? 5.7.0, 5.7.1 or 5.8 RC?
      If thats really all the code you are using, it sounds like a bug to me.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • A Offline
        A Offline
        alecs26
        wrote on last edited by alecs26
        #3

        This was with 5_7_1_MinGW
        I just guessed it was the normal behavior...

        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