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. How to Add multiple Qtoolbar in QtabWidget

How to Add multiple Qtoolbar in QtabWidget

Scheduled Pinned Locked Moved Unsolved General and Desktop
qtabwidgetqtoolbarqt5qtwidgetstabs
4 Posts 2 Posters 1.9k 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.
  • V Offline
    V Offline
    vicky_mac
    wrote on 19 Feb 2020, 09:23 last edited by
    #1

    I want to create a tabwidget which will have tabs in left , right and top.

    Currently by using the default tabwidget i can have only one toolbar at any location(left,right,top or bottom).
    But i want to add 3 toolbars on 3 sides or is there anyway i can split tabs in default toolbar to different sides of widgets.
    I want tabwidget something like the below image:
    tabwidget.JPG

    P 1 Reply Last reply 19 Feb 2020, 10:06
    0
    • V vicky_mac
      19 Feb 2020, 09:23

      I want to create a tabwidget which will have tabs in left , right and top.

      Currently by using the default tabwidget i can have only one toolbar at any location(left,right,top or bottom).
      But i want to add 3 toolbars on 3 sides or is there anyway i can split tabs in default toolbar to different sides of widgets.
      I want tabwidget something like the below image:
      tabwidget.JPG

      P Offline
      P Offline
      Pl45m4
      wrote on 19 Feb 2020, 10:06 last edited by Pl45m4
      #2

      @vicky_mac

      You'll need to subclass QTabWidget and write a custom one. The standard QTabWidget can only have one tabbar (top, left, right or bottom), so you have to write your own widget either with one TabBar which goes around your widget or with three TabBars (one on each side; standard TabWidget holds one TabBar only). Maybe you have to subclass QTabBar as well...

      The easy way is to use two or three QTabWidgets next to each other (or maybe inside a QStackedWidget container). This is not exactly what you are asking for but the other solution might be a little tough, if you have never done this before.


      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      V 1 Reply Last reply 20 Feb 2020, 03:56
      3
      • P Pl45m4
        19 Feb 2020, 10:06

        @vicky_mac

        You'll need to subclass QTabWidget and write a custom one. The standard QTabWidget can only have one tabbar (top, left, right or bottom), so you have to write your own widget either with one TabBar which goes around your widget or with three TabBars (one on each side; standard TabWidget holds one TabBar only). Maybe you have to subclass QTabBar as well...

        The easy way is to use two or three QTabWidgets next to each other (or maybe inside a QStackedWidget container). This is not exactly what you are asking for but the other solution might be a little tough, if you have never done this before.

        V Offline
        V Offline
        vicky_mac
        wrote on 20 Feb 2020, 03:56 last edited by
        #3

        @Pl45m4 said in How to Add multiple Qtoolbar in QtabWidget:

        maybe inside a QStackedWidget container

        Hi ,
        Thanks for suggestion. Do you have any example or link somewhat similar to what you suggested .
        Haven't used QT much so little help will be required.

        P 1 Reply Last reply 20 Feb 2020, 23:49
        0
        • V vicky_mac
          20 Feb 2020, 03:56

          @Pl45m4 said in How to Add multiple Qtoolbar in QtabWidget:

          maybe inside a QStackedWidget container

          Hi ,
          Thanks for suggestion. Do you have any example or link somewhat similar to what you suggested .
          Haven't used QT much so little help will be required.

          P Offline
          P Offline
          Pl45m4
          wrote on 20 Feb 2020, 23:49 last edited by
          #4

          @vicky_mac

          A QStackedWidget works like a book. You have pages with your content. You can flip these pages to change your widget inplace (without opening another window or something else).
          So one possibility is to put one of each QTabWidget (each with a different tabBar position) on a page of a QStackedWidget. You could flip the pages by clicking a dummy tab on each tabBar or you use a button to go to the next page. I know, this is not exactly what the widget in your image looks like :)

          @vicky_mac said in How to Add multiple Qtoolbar in QtabWidget:

          Haven't used QT much

          If you want a widget, that looks exactly like the one shown above, you could still try to subclass and create your own, custom TabWidget, but I fear, that it might be a little too challenging.

          Here's all you need to know about QStackedWidget (https://doc.qt.io/qt-5/qstackedwidget.html#details)


          If debugging is the process of removing software bugs, then programming must be the process of putting them in.

          ~E. W. Dijkstra

          1 Reply Last reply
          1

          2/4

          19 Feb 2020, 10:06

          • Login

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