pyqt5控件QSS记录
1. QPushButton
QPushButton:hover
{
background-color:rgb(44 , 137 , 255);
border-radius:5px;
}
QPushButton:pressed
{
background-color:rgb(14 , 135 , 228);
padding-left:3px;
padding-top:3px;
}
2. QTabWidget
QTabWidget::pane { /*内容区域*/
background-color: rgb(80, 80, 80);/*背景色-空隙颜色*/
border:1px solid rgb(128, 128, 128);
}
QTabBar::tab{/*页签*/
font-size:18px;
min-height:28px;
width:120px;
color: rgb(230, 230, 230);
margin-right:1px;
margin-bottom:1px;
border-top-left-radius:16px 24px;
border:1px solid rgb(128, 128, 128);
border-bottom:0;
3. QGroupBox
QGroupBox {
border: 2px solid rgb(255, 170, 127);
border-radius: 5px;
margin-top: 2ex;
background-color:rgb(255, 170, 127)
}
QGroupBox::title {
min-height:28px;
subcontrol-origin: margin;
subcontrol-position: top center;
border-radius: 5px;
padding: 0 3px;
background-color:rgb(255, 170, 127)
}
参考:https://github.com/GTRONICK/QSS
本文介绍了PyQT5中QSS(Qt StyleSheet)的使用,展示了如何为QPushButton、QTabWidget和QGroupBox设置不同的状态样式,如:hover、:pressed等,详细定义了背景色、边框、内边距等属性,帮助提升GUI界面的视觉效果。
894

被折叠的 条评论
为什么被折叠?



