Qt鼠标悬停按钮样式表
作者:互联网
红色样式
/* Red Button */
QPushButton#RedButton {
border-radius: 8px;
color: white;
padding: 16px 32px;
text-align: center;
text-decoration: none;
font-size: 16px;
margin: 4px 2px;
background-color: white;
color: black;
border: 2px solid #f44336;
}
QPushButton#RedButton:hover {
background-color: #f44336;
color: white;
}
QPushButton#RedButton:pressed {
background-color: #06AD56;
}
蓝色样式
/* Blue Button */
QPushButton#BlueButton {
border-radius: 8px;
color: white;
padding: 16px 32px;
text-align: center;
text-decoration: none;
font-size: 16px;
margin: 4px 2px;
background-color: white;
color: black;
border: 2px solid #008cba;
}
QPushButton#BlueButton:hover {
background-color: #008cba;
color: white;
}
QPushButton#BlueButton:pressed {
background-color: #06AD56;
}
绿色样式
/* Green Button */
QPushButton#GreenButton {
border-radius: 8px;
color: white;
padding: 16px 32px;
text-align: center;
text-decoration: none;
font-size: 16px;
margin: 4px 2px;
background-color: white;
color: black;
border: 2px solid #4CAF50;
}
QPushButton#GreenButton:hover {
background-color: #4CAF50;
color: white;
}
QPushButton#GreenButton:pressed {
background-color: #06AD56;
}
灰色样式
/* Gray Button */
QPushButton#GrayButton {
border-radius: 8px;
color: white;
padding: 16px 32px;
text-align: center;
text-decoration: none;
font-size: 16px;
margin: 4px 2px;
background-color: white;
color: black;
border: 2px solid #e7e7e7;
}
QPushButton#GrayButton:hover {
background-color: #e7e7e7;
color: white;
}
QPushButton#GrayButton:pressed {
background-color: #06AD56;
}
黑色样式
/* Black Button */
QPushButton#BlackButton {
border-radius: 8px;
color: white;
padding: 16px 32px;
text-align: center;
text-decoration: none;
font-size: 16px;
margin: 4px 2px;
background-color: white;
color: black;
border: 2px solid #555555;
}
QPushButton#BlackButton:hover {
background-color: #555555;
color: white;
}
QPushButton#BlackButton:pressed {
background-color: #06AD56;
}
标签:Qt,color,text,background,鼠标悬停,样式表,QPushButton,white,border 来源: https://blog.csdn.net/xuefu2008/article/details/120576442