QTpushbutton圆形按钮
QPushButton { //设置图1的样式表⽅式
font-size:100px; //⽂字⼤⼩
color:yellow; //前景⾊也就是字体颜⾊
border-radius:150px; //圆⾓⼤⼩,因为矩形的⼀半为150,所以圆⾓⼤⼩ 设置为150以后,将会成为⼀个原型,⼩于150,就是圆⾓矩形了。background-color:rgba(0,255,0,200); //设置按钮背景为绿⾊
}
QPushButton:hover { //设置图1的样式表⽅式:悬停状态
font-size:100px;
color:green;
改变button按钮的形状
border-radius:150px;
background-color:rgba(255,255,0,200); //设置按钮背景为黄⾊ = 红+绿
}
QPushButton:pressed { //设置图1的样式表⽅式:按下状态
color:orange;
border-width:3;
border-color:orange;
border-style:solid;;
background-color:cyan; //设置按钮背景为青⾊
}
注意1:border-radius:150px; 例⼦中的按钮⼤⼩是300X300,所以这⾥是150,
注意2:若是按钮是在desginer中添加的, 悬停和按下在desgner中设置不其作⽤