Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 2

Qt-interest Archive, February 2007
how can i change the border color of QTabWidget (qt4.2.2)


Message 1 in thread

hi all,
since QTabWidget doesn't support Box Model which means I can't use StyleSheet to change the border color of the QTabWidget, but I still want to do that, Is there a way to do such thinngs?
Best Regards,
Reimand.Zhu

Message 2 in thread

The easiest solution is probably to set QWindowsStyle
on the tab widget itself and then change the palette entries for
QPalette::Dark and QPalette::Light to the color you want. This will
give you a decent looking tab widget with a custom border color.

A more flexible solution is to create a custom style for your tab 
widget. You can subclass from an existing style and then reimplement 
PE_FrameTabWidget, CE_TabBarTabShape and PE_FrameTabBarBase to design
the tab widget exactly like you want it.

> hi all,
> 
> since QTabWidget doesn't support Box Model which means I can't use 
> StyleSheet to change the border color of the QTabWidget, but I still 
> want to do that, Is there a way to do such thinngs?
> 
> Best Regards,
> Reimand.Zhu
> 
> 
> ------------------------------------------------------------------------
> 想加入吗?1.9亿用户正在使用网易邮箱 www.126.com <http://www.126.com/>


-- 
 [ signature omitted ]