[Qt-interest] QTabWidget: changing style sheet for a particular tab

Christian Döring christian.doering at uni-muenster.de
Fri Jan 22 17:15:06 CET 2010


Hello,

I ran into a problem that i was unable to solve. I'll try to explain it
and maybe you can give me a hint how to do it.

I have a QTabWidget with several tabs and some text is displayed in
every tab. The user can edit the text as he likes. To give the user a
hint where he changed something i want to highlight the tabs where
changes happened. But i don't know how to realize this with stylesheets.
I looked into the stylesheet example for QTabWidget and QTabBar
(http://doc.trolltech.com/4.5/stylesheet-examples.html#customizing-qtabwidget-and-qtabbar)
but i can't find the proper option. The only thing i found was to
distinguish between selected and not selected tabs. How can i achieve to
distinguish in other ways in the stylesheet? I saw an option that you
can use mandatory fields in the stylesheet, but in my case i have to
call setProperty() of a single tab. But a tab is not accessible and also
not a widget.
What do i have to do that for example only 1 particular tab gets painted
with a different stylesheet?
I hope someone can help me.

Best regards
Christian

PS: I am using Qt 4.5



More information about the Qt-interest-old mailing list