如何使用自定义witdh=max为QTabBar自定义选项卡标题?(qt样式表)
我想要这样的TabBar,但我不知道我必须设置TabBar的哪些参数?(我只想使用样式表) 我试过这个:如何使用自定义witdh=max为QTabBar自定义选项卡标题?(qt样式表),qt,qstylesheet,Qt,Qstylesheet,我想要这样的TabBar,但我不知道我必须设置TabBar的哪些参数?(我只想使用样式表) 我试过这个: QTabWidget::tab-bar { background-color: blue; min-width:2000; with:2000; height:50; } 但屏幕上没有变化 这是完整的解决方案: QTabWidget QTabBar{ background-color: #136ba2; width: 256px; font: 1
QTabWidget::tab-bar {
background-color: blue;
min-width:2000;
with:2000;
height:50;
}
但屏幕上没有变化
这是完整的解决方案:
QTabWidget QTabBar{
background-color: #136ba2;
width: 256px;
font: 10pt "Arial";
}
QTabWidget QTabBar::tab{
background-color: #136ba2;
height: 50px;
width: 256px;
color: #e6e6e6;
}
QTabWidget QTabBar::tab:selected{
background-color: #0f5d90;
width: 256px;
}
QTabBar::tab:last {
border-top-right-radius: 3px;
border-bottom-right-radius: 3px;
margin-right: 678px;
}
不要使用
QTabWidget::tab bar{}
尝试使用QTabWidget QTabBar{}
。要设置更具体的属性,请使用::选项卡
选择器
例如:
QTabWidget QTabBar{background-color: #136ba2; min-width: 2000px;}
QTabWidget QTabBar::tab{background-color: #136ba2; height: 50px; color: #e6e6e6}
QTabWidget QTabBar::tab:selected{background-color: #0f5d90;}
你能更好地解释一下你想要的是什么,展示一下你已经尝试过的吗?没关系。请阅读我的最新评论。我在问题信息中添加了完整的解决方案,但这对我帮助很大。谢谢:)