QTabBar with QComboBox
-
wrote on 3 Nov 2016, 12:16 last edited by
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 -
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,
Thomaswrote on 3 Nov 2016, 15:30 last edited by Ni.Sumi 11 Mar 2016, 15:32I 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 -
wrote on 3 Nov 2016, 17:38 last edited by
I am looking for a modified QTabBar - not for displaying and controling the contents of the tabs.
-
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.
-
wrote on 5 Nov 2016, 07:15 last edited by
Thanks for this hint and I also found setCornerWidget which solves the thing in my case.
-
Right, that's the best solution if you are using a QTabWidget.
1/6