[Qt-interest] QTabBar background colors

Diana Coppenbarger dcop at lle.rochester.edu
Thu Dec 11 21:53:24 CET 2008


But how do you tell it which tab to change the color of?  I don't  
think I have access to the individual tabs to use setPalette().  Each  
tab needs to be a different color.  If I call setPalette() on the  
widgets used in addTab(), the background of the whole page changes,  
but not the tab associated with it.  I can get the geometry of a tab  
by using tabRect(), but I'm not sure how to change the color using  
that value, if it's even possible.


On Dec 11, 2008, at 3:34 PM, Benjamin wrote:

> Hi,
>
> Have you tried to change the color of the Palette?  
> (QWidget::setPalette())?
>
> Benjamin
>
> 2008/12/11 Diana Coppenbarger <dcop at lle.rochester.edu>
> I am trying to figure out how the change the background colors on the
> tabs for a QTabWidget.  I have created my own class, inheriting from
> QTabWidget to be able to get access to the QTabBar.  I can change the
> text color by using tabBar()->setTabTextColor(QColor(Qt::red));, but I
> really want to be able to change the *background* color of just the
> tab.  I am using Qt 4.3.  Any thoughts?
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20081211/059b2570/attachment.html 


More information about the Qt-interest-old mailing list