UI样式表(悬停hover状态样式和按下pressed)

比如添加一个按钮,背景色,边框,边角,文本颜色

cpp 复制代码
QPushButton{
	
	background-color: rgb(255, 255, 0);
	border:1px groove gray;
	border-radius:5px;
	color:black;
}

悬停状态:浅蓝色,其他的不变

cpp 复制代码
QPushButton::hover{
	background: rgb(237, 240, 243);
	border:1px groove gray;
	border-radius:5px;
	color:black;
}

按下状态:文本被压下去的动态效果

cpp 复制代码
QPushButton::pressed { 
	padding-left:6px;
	padding-top:6px;
}
相关推荐
风闲12171 天前
Qt源码编译记录
开发语言·qt
864记忆1 天前
Qt c++的基础语法有哪些?
开发语言·c++·qt
江公望1 天前
Qt QHostInfo::lookupHost()函数,10分钟讲清楚
开发语言·qt·qml
胡斌附体1 天前
qt showevent引发的问题
qt·qt creator·问题排查·思路·报警·showevent·重复打印
Dneccc1 天前
Qt5配置MSVC2017
开发语言·qt
江公望1 天前
Qt QByteArray类型,10分钟讲清楚
开发语言·c++·qt
小灰灰搞电子1 天前
Qt Sensors 传感器框架详解
开发语言·qt
LNN20221 天前
Qt 5.8 中的 Qt Test:轻松实现自动化测试
开发语言·qt
菜鸟-012 天前
上位机---QT
开发语言·qt
864记忆2 天前
Qt 对 JSON和XML文件的操作详解
xml·qt·json