QTabWidget style each tab differently
Hi everyone,
is it possible to style each tab of a QTabWidget differently while using e.g. the tabindex as the individual tabs are widgets?
The setStyleSheet option only styles the whole QTabBar apart from using different states (: only-one, : first, : last, : middle, : previous-selected, : next-selected, : selected).
Thanks!!
Re: QTabWidget style each tab differently
I had a similar project long ago. QStyleSheets had not been of any use for this since they are pretty limited as you mentioned.
My solution was to subclass from QTabWidget and to extend the paintEvent. There you can react on the current index and so on and draw some colors/gradients/borders as much as you like.
Re: QTabWidget style each tab differently
Hi, you could try QTabBar::setTabButton and set different widgets for each tab.
Ginsengelf