Qt鼠标悬停按钮样式表

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;
}

上一篇:三、标准信号和槽


下一篇:pyqt5点击按钮更换图片