分享鼠标悬停按钮样式表 | 您所在的位置:网站首页 › qt鼠标悬停在按钮变大 › 分享鼠标悬停按钮样式表 |
不多说直接上代码。 红色悬停样式表112345678910111213141516171819202122/* 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;} 红色悬停样式表2123456789101112131415161718192021/* Red Button 2 */QPushButton#RedButton2 { background-color: #f44336; border-radius: 8px; padding: 16px 32px; text-align: center; text-decoration: none; font-size: 16px; margin: 4px 2px; color: white;}QPushButton#RedButton2:hover { background-color: white; border: 2px solid #f44336; color: black}QPushButton#RedButton2:pressed { background-color: #06AD56;} 蓝色悬停样式表112345678910111213141516171819202122/* 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;} 蓝色悬停样式表2123456789101112131415161718192021/* Blue Button 2 */QPushButton#BlueButton2 { background-color: #008cba; border-radius: 8px; padding: 16px 32px; text-align: center; text-decoration: none; font-size: 16px; margin: 4px 2px; color: white;}QPushButton#BlueButton2:hover { background-color: white; border: 2px solid #008cba; color: black}QPushButton#BlueButton2:pressed { background-color: #06AD56;} 绿色悬停样式表112345678910111213141516171819202122/* 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;} 绿色悬停样式表2123456789101112131415161718192021/* Green Button 2 */QPushButton#GreenButton2 { background-color: #4CAF50; border-radius: 8px; padding: 16px 32px; text-align: center; text-decoration: none; font-size: 16px; margin: 4px 2px; color: white;}QPushButton#GreenButton2:hover { background-color: white; border: 2px solid #4CAF50; color: black}QPushButton#GreenButton2:pressed { background-color: #06AD56;} 灰色悬停样式表112345678910111213141516171819202122/* 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;} 灰色悬停样式表2123456789101112131415161718192021/* Gray Button 2 */QPushButton#GrayButton2 { background-color: #e7e7e7; border-radius: 8px; padding: 16px 32px; text-align: center; text-decoration: none; font-size: 16px; margin: 4px 2px; color: white;}QPushButton#GrayButton2:hover { background-color: white; border: 2px solid #e7e7e7; color: black}QPushButton#GrayButton2:pressed { background-color: #06AD56;} 黑色悬停样式表112345678910111213141516171819202122/* 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;} 黑色悬停样式表2123456789101112131415161718192021/* Black Button 2 */QPushButton#BlackButton2 { background-color: #555555; border-radius: 8px; padding: 16px 32px; text-align: center; text-decoration: none; font-size: 16px; margin: 4px 2px; color: white;}QPushButton#BlackButton2:hover { background-color: white; border: 2px solid #555555; color: black}QPushButton#BlackButton2:pressed { background-color: #06AD56;} 总结修改下列属性即可快速修改该样式的显示颜色。12background-color: #555555;border: 2px solid #555555; 关于更多 源码示例https://github.com/aeagean/QSS.git Qt君公众号后台回复”QSS“获取更多相关信息。 |
CopyRight 2018-2019 实验室设备网 版权所有 |