QRadioButton样式表
//样式基本格式
QRadioButton{
font-family: "Microsoft YaHei";//字体类型
font-size: 25px;//字体⼤⼩,像素
color: #bdc8e2//字体颜⾊
outline:0px;//去掉焦点虚线框
border:3px solid red //外边框
min-width:30px;//尺⼨
min-height:30px;
background-color:rgba(r,g,b,a);//值transparent为透明
}
//设置字体样式htmlradio设置默认的按钮
font-family: "Microsoft YaHei";//字体类型
font-size: 25px;//字体⼤⼩,像素
font-style: italic;//字体斜体样式,mormal不斜体
font-weight:bold;//字体加粗样式,mormal不加粗
color: #bdc8e2//字体颜⾊
font: bold italic 18px "Microsoft YaHei";//顺序要求:style weight size family 或者 weight style  size family
//⽂字位置
Spacing:5px;//选择框和⽂字之间的距离(⽔平)
padding-left: 10px;距离左边边界的距离(包括选择框)
padding-top: 10px;距离顶边边界的距离(包括选择框)
padding-right: 10px;距离右边边界的距离(包括选择框)
padding-bottom: 10px;距离底边边界的距离(包括选择框)
//边框样式
border-style: solid;//边框样式,实线:solid ;虚线:dashed; 点线:dotted;
不显⽰(默认):none;
border-width: 2px;
border-color: red;
border:2px,solid red;//同时设置
//某⼀条边框(其他三个边框: right,bottom,left)
border-top-style:solid;
border-top-width:2px;
border-top-color:red;
//圆⾓
border-top-left-radius:20px;//左上⾓弧度
border-top-right-radius:20px;//右上⾓弧度
border-bottom-left-radius:20px;//左下⾓弧度
border-bottom-right-radius:20px;//右下⾓弧度
bordet-radius:20px;//同时设置4个⾓的弧度
//背景样式
background-color:rgba(r,g,b,a);//值transparent为透明
background-image:url(".png");//背景图⽚
background-repeat:no-repeat;//在x轴重复:repeat-x; 在y轴重复:repeat-y background-position:left center;//图⽚显⽰位置:left,right,center,top,bottom;
background: url(".png") no-repeat left center #2e3648;//顺序任意
//动态样式(不存在pressed样式)
//⿏标悬浮
QRadioButton:hover{
color:
}
//按钮禁⽌
QRadioButton:disabled{
color:
}
//⿏标点击
QRadioButton:disabled{
color:
}
//单选框
QRadioButton::indicator{
width:32px;
height:18px;
image: url(./image1.png);
position:relative;//通过该参数可以修改图⽚位置:left,right…
left:0px;
right:0px;
top:0px;
bottom:0px;
}
//单选框动态样式
QRadioButton::indicator:hover{
Image:url(./image2.png);
}
QRadioButton::indicator:pressed{
Image:url(./image2.png);
}
/
/根据是否选中状态的动态样式(unchecked和没有添加任何状态时的样式是相同) QRadioButton::indicator: unchecked{
Image:url(./image2.png);
}
QRadioButton::indicator:unchecked:hover{
Image:url(./image2.png);
}
QRadioButton::indicator:unchecked: pressed{
Image:url(./image2.png);
}
QRadioButton::indicator: checked{
Image:url(./image2.png);
}
QRadioButton::indicator: checked:hover{
Image:url(./image2.png);
}
QRadioButton::indicator: checked: pressed{ Image:url(./image2.png);
}

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。