Qss界面美化4:QGroupBox,QRadioButton,QCheckBox美化

Qss界面美化4:QGroupBox,QRadioButton,QCheckBox美化(写的很一般,主要是介绍下里面的样式)

先看效果图:
Qss界面美化4:QGroupBox,QRadioButton,QCheckBox美化_第1张图片
关键代码:

/*单选框*/
QRadioButton::indicator {/*选择框部分*/
     width: 13px;
     height: 13px;
     color:black;
}

QRadioButton::indicator:unchecked:pressed {
    width: 13px;
    height: 13px;
    color:black;
}

QRadioButton::indicator:unchecked:hover {
    width: 16px;
    height: 16px;
}
QRadioButton::indicator:checked:hover {
    width: 16px;
    height: 16px;
}

/*复选框*/
QCheckBox::indicator:checked {
image: url(:/image/images/checkbox_checked.png);
}

QCheckBox::indicator:unchecked {
image: url(:/image/images/checkbox_unchecked.png);
}
QCheckBox::indicator:unchecked:pressed {
image: url(:/image/images/checkbox_checked.png);
}

/*groupBox*/
QGroupBox{
background:#444444;
border:1px solid black;
border-radius:10px;
margin-top:11px;
}

QGroupBox::title {
      subcontrol-origin: margin;
      subcontrol-position: top left;
      padding-top: 5;
      padding-left: 5;
}

你可能感兴趣的:(QSS界面美化,Qt,Qss)