Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Solved QML - Anchor a TabView's tabBar at the bottom of the TabView

    QML and Qt Quick
    2
    3
    1731
    Loading More Posts
    • 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.
    • B
      BjoernK last edited by

      Hi!

      Is it possible to anchor the tabBar of a TabView at the bottom of the TabView?
      I tried to achieve this by means of the TabViewStyle but I can't figure out how it works.

      TabView {
                  id: tabView
                  anchors.fill: parent
                  style: TabViewStyle {
                      tabBar: Rectangle {
                          anchors.bottom: control.bottom
                      }
                  }
                  Tab {
                      title: "example"
                      Label { }
                  }
      }
      

      The following error message is displayed:
      QML Rectangle: Cannot anchor to an item that isn't a parent or sibling.

      Do I miss a simple solution?

      Best regards,
      Björn

      1 Reply Last reply Reply Quote 0
      • jpnurmi
        jpnurmi last edited by

        Hi, see http://doc.qt.io/qt-5/qml-qtquick-controls-tabview.html#tabPosition-prop

        TabView { tabPosition: Qt.BottomEdge }
        
        1 Reply Last reply Reply Quote 1
        • B
          BjoernK last edited by

          Thank you very much. That was exactly what I was looking for.

          Best regards,
          Björn

          1 Reply Last reply Reply Quote 0
          • First post
            Last post