Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QTabBar with QComboBox
Forum Update on Monday, May 27th 2025

QTabBar with QComboBox

Scheduled Pinned Locked Moved Solved General and Desktop
qtabbarqcombobox
6 Posts 3 Posters 2.3k 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.
  • T Offline
    T Offline
    tgru
    wrote on 3 Nov 2016, 12:16 last edited by
    #1

    I want to implement a tabbar with the tabs, then the left and right arrows for navigation (not overlapping) and then either a combobox or a button to activate a combobox with all tabs listet. The latter only in the case when not all tabs can be shown. I just need some hints/directions how to implement it: derive from QTabBar and overwrite paint etc, or replace the tabbar with a widget containing an horizontal box layout in which I insert a tabbar and the combobox, or ...

    Thanks,
    Thomas

    N 1 Reply Last reply 3 Nov 2016, 15:30
    0
    • T tgru
      3 Nov 2016, 12:16

      I want to implement a tabbar with the tabs, then the left and right arrows for navigation (not overlapping) and then either a combobox or a button to activate a combobox with all tabs listet. The latter only in the case when not all tabs can be shown. I just need some hints/directions how to implement it: derive from QTabBar and overwrite paint etc, or replace the tabbar with a widget containing an horizontal box layout in which I insert a tabbar and the combobox, or ...

      Thanks,
      Thomas

      N Offline
      N Offline
      Ni.Sumi
      wrote on 3 Nov 2016, 15:30 last edited by Ni.Sumi 11 Mar 2016, 15:32
      #2

      @tgru

      I guess, Stacked widget and stacked layout would be better options. It shows one widget at time.

      http://doc.qt.io/qt-4.8/qstackedwidget.html
      http://doc.qt.io/qt-5/qstackedlayout.html

      1 Reply Last reply
      2
      • T Offline
        T Offline
        tgru
        wrote on 3 Nov 2016, 17:38 last edited by
        #3

        I am looking for a modified QTabBar - not for displaying and controling the contents of the tabs.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 3 Nov 2016, 21:41 last edited by
          #4

          Hi,

          If you want that combo box after that tab bar then then custom widget with the tab bar followed by the combo box is likely the most simple way to implement it.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          3
          • T Offline
            T Offline
            tgru
            wrote on 5 Nov 2016, 07:15 last edited by
            #5

            Thanks for this hint and I also found setCornerWidget which solves the thing in my case.

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 5 Nov 2016, 07:44 last edited by
              #6

              Right, that's the best solution if you are using a QTabWidget.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              2

              3/6

              3 Nov 2016, 17:38

              • Login

              • Login or register to search.
              3 out of 6
              • First post
                3/6
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved