Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-55129

TabButton always squeezed to fit in TabBar

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.7.1
    • 5.7.0
    • Quick: Controls 2
    • None
    • Fedora 24, Windows 10

    Description

      when I try to put many TabButtons to TabBar they are always squeezed to fit all parent width. But it actually must be scrollable.
      That's right for all styles, but looks different.
      1. default tabs just become unreadable
      2. material tabs - the same
      3. universal tab bar become invisible

      import QtQuick 2.6
      import QtQuick.Controls 2.0
      
      Page {
          id: page
      
          SwipeView {
              id: swipeView
              anchors.fill: parent
              currentIndex: tabBar.currentIndex
      
              Repeater {
                  model: 15
      
                  Pane {
                      width: swipeView.width
                      height: swipeView.height
      
                      Column {
                          spacing: 40
                          width: parent.width
      
                          Label {
                              width: parent.width
                              wrapMode: Label.Wrap
                              horizontalAlignment: Qt.AlignHCenter
                              text: "TabBar is a bar with icons or text which allows the user"
                                    + "to switch between different subtasks, views, or modes."
                          }
      
                          Image {
                              source: "qrc:/images/arrows.png"
                              anchors.horizontalCenter: parent.horizontalCenter
                          }
                      }
                  }
              }
          }
      
          footer: TabBar {
              id: tabBar
              currentIndex: swipeView.currentIndex
      
              Repeater{
                  model: 15
                  TabButton {
                      text: 'tab#'+index
                  }
              }
          }
      }
      

      Example with 15 tabs and unreadable texts.
      Is this behavior right or I missed somwthing?

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              Unassigned Unassigned
              alexeym A M
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes