PDA

View Full Version : Change the text color tab page



gtthang
19th January 2006, 03:15
Dear all,


I tried the following code snippet for changing the text color of tab page but it wouldn't

work as I hoped.

QString strText("<font color=#FF0000>some text</font>");

my_tab->setTabText(strText,0);

At runtime the page at position zero shows the strText but it doesn't parse the html tag.

I expect there are some other ways to change the text color of a tab page. If so, Can

anybody do me a favour ?

All helps will be greatly appreciated.

Thanks in advance

Have a nice day.

MarkoSan
19th January 2006, 07:27
Try with void QTabBar::setTabTextColor ( int index, const QColor (http://www.qtcentre.org/forum/qcolor.html) & color ).

gtthang
23rd January 2006, 04:18
Dear MarkoSan,

Thanks for your reply.

As a matter of fact, I am using Qt version 4.0.0 and QTabBar class doesn't have a method which is so-called setTabTextColor.

Thanks anyway

Have a nice day

Mike
24th January 2006, 15:29
well is it possible for you to move to QT 4.1? Because there you have that method available.

ReilenBlaeyze
18th February 2006, 18:38
Well that or subclass QTabBar and override QTabBar::paintLabel()