PyQT-设置QTabWidget的文本颜色 [英] PyQT - setting the text color for a QTabWidget
本文介绍了PyQT-设置QTabWidget的文本颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以设置QTabWidget一部分的特定选项卡的文本颜色? QTabBar 似乎有一种方法可以设置标签文本颜色,但 QTabWidget.
Is there any way to set the text color of a certain tab that's part of a QTabWidget? QTabBar seems to have a method to set the tab text color, but I do not see a similar method for QTabWidget.
推荐答案
The tab text color can be set via the tab-widget's tabBar method:
tabwidget.tabBar().setTabTextColor(index, color)
这篇关于PyQT-设置QTabWidget的文本颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文