如下:
QPushButton{border-radius:10px;
border:2px solid white;
color:white;
background:transparent;
}
QPushButton:hover{
border:2px solid rgb(71,186,204);
color:rgb(71,186,204);
background:transparent;
}
QPushButton:pressed{
border:2px solid white;
color:white;
background-color:rgb(71,186,204);
}
QPushButton:!enabled
{
border:2px solid rgb(130,130,130);
color:rgb(130,130,130);
}
QPushButton:focus {
border:2px solid black;
color:black;
background-color:white;
}
QPushButton{
border:2px solid white;
color:white;
background:transparent;
}
QPushButton:hover{
border-image: url(:/Resources/btn1.png);
}
QPushButton:pressed{
border-image: url(:/Resources/btn2.png);
}
QPushButton:focus{
border-image: url(:/Resources/btn1.png);
padding: -4;
}
QPushButton:!enabled
{
border:2px solid rgb(130,130,130);
color:rgb(130,130,130);
}

本文详细介绍了如何使用CSS样式的属性来定制QPushButton的外观效果,包括不同状态下的边框、颜色及背景变化,还提供了使用图片作为按钮背景的方法。
2万+

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



