How to Add multiple Qtoolbar in QtabWidget
-
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:
-
You'll need to subclass
QTabWidget
and write a custom one. The standardQTabWidget
can only have one tabbar (top, left, right or bottom), so you have to write your own widget either with oneTabBar
which goes around your widget or with threeTabBars
(one on each side; standard TabWidget holds one TabBar only). Maybe you have to subclassQTabBar
as well...The easy way is to use two or three
QTabWidgets
next to each other (or maybe inside aQStackedWidget
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. -
@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. -
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 eachQTabWidget
(each with a different tabBar position) on a page of aQStackedWidget
. 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)