Hi, all.
I'm looking for an idea how to make QTabBar to have different color tabs. Qt's Style Sheet engine allows to specify styles for all/selected/first/last tabs, but not each one separately by index. Can anybody advise anything?
Thanks.
Hi, all.
I'm looking for an idea how to make QTabBar to have different color tabs. Qt's Style Sheet engine allows to specify styles for all/selected/first/last tabs, but not each one separately by index. Can anybody advise anything?
Thanks.
Oleg Shparber
You could subclass QTabBar and write your own paint event. Have a look inside the sources how the original paint even looks like. Then just alter the for loop which is painting the tabs.
Oleg (29th March 2010)
You can use QTabBar::setTabTextColor ( int index, const QColor & color ) to set different colors for tabs.
QTabBar::setTabTextColor ( int index, const QColor & color ) sets text color, not tab background color.
Is there a way to implement stylesheet handler plugin for my own widget to has its own stylesheet? I'd like to have something like
Qt Code:
MyColorTabBar[tabIndex=1] { background-color: red; } MyColorTabBar[tabIndex=2] { background-color: green; }To copy to clipboard, switch view to plain text mode
Oleg Shparber
Bookmarks