Python PyQt4小部件';s样式表的组件名称
我正在努力学习为我的python程序创建外部Python PyQt4小部件';s样式表的组件名称,python,qt,pyqt,pyqt4,stylesheet,Python,Qt,Pyqt,Pyqt4,Stylesheet,我正在努力学习为我的python程序创建外部qss文件(样式表),该程序是用PyQt编写的,外观更加美观 在Qt样式表示例中,它使用了 QTableView QTableCornerButton::section { background: red; border: 2px outset red; } 在QTableWidget上指定连接按钮(红色矩形)的样式属性。 但是,它没有说明其他组件名称应该如何寻址。例如,我不知道如何更改horizontalheaderlabel和vertic
qss
文件(样式表),该程序是用PyQt编写的,外观更加美观
在Qt样式表示例中,它使用了
QTableView QTableCornerButton::section {
background: red;
border: 2px outset red;
}
在QTableWidget
上指定连接按钮(红色矩形)的样式属性。
但是,它没有说明其他组件名称应该如何寻址。例如,我不知道如何更改horizontalheaderlabel
和verticalheader
样式
当我使用样式表而不使用任何组件名称(如QTableCornerButton
)时
QTableWidget {
selection-background-color: qlineargradient(x1: 0, y1: 0, x2: 0.5, y2: 0.5,
stop: 0 #579599, stop: 1 #39B4BD);
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #D1DBEB, stop: 0.4 #C0D1EB,stop: 0.5 #ABBEDB, stop: 1.0 #95ABCC);
border:1px solid #7286A3;
border-top-left-radius: 9px;
border-top-right-radius: 9px;
border-bottom-left-radius: 9px;
border-bottom-right-radius: 9px;
padding:0px;
}
它将样式应用于整个小部件,而不是特定区域
在哪里可以在线找到样式表(例如,QTableCornerButton
)支持的小部件组件的名称
很好,但它没有提供我可以使用的所有名称和属性。您看过文档吗?我没有看到任何与表
horizontalheader
或verticalheader
相关的内容。这是否意味着不可能将样式表直接应用于它们?还是我遗漏了什么?通过设计QHeaderView的样式来完成,如下所示: