qt ui设计案例--登录界面

登录界面

要实现这个界面就非常简单了,准备一张图片就行。

lable样式:

css 复制代码
QLabel{
	border-image: url(":/nxd.jpg");
	background-position:center;
	min-width: 100px;
    min-height: 100px;
    border-radius: 50px;
	
}

搞一个圆背景贴一张图片就行

在登录与头像之间随便贴点文字,再修改一下样式就行

登录按钮采用三元渐变色,qt有自带设计颜色的功能

最后修改一下qpushbutton的交互样式就行了

css 复制代码
QPushButton {              
	border-radius:20;  
	background-color:qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0.204545 rgba(150, 214, 205, 255), stop:1 rgba(239, 193, 246, 255));
	color: #F0F0F0;
}
QPushButton:hover {            
	border-radius:20;  
	background-color:qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0.204545 rgba(211, 214, 205, 255), stop:1 rgba(239, 193, 246, 255));
	color: #F0F0F0;
}
QPushButton:pressed {        
	border-radius:20;  
	background-color:qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0.204545 rgba(150, 214, 205, 255), stop:1 rgba(239, 193, 246, 255));
	color: #F0F0F0;
	padding-left:2px;
	padding-top:3px;
}

最终效果:

相关推荐
hqwest2 小时前
码上通QT实战37--项目总结
开发语言·qt·软件开发·系统集成·设备选型
少控科技3 小时前
QT新手日记026
开发语言·qt
嘿嘿潶黑黑3 小时前
绘图中 QRect 与 QRectF 的不同
qt
木千3 小时前
Qt全屏显示,在顶部工具栏的最右边显示关闭按钮
开发语言·qt
誰能久伴不乏4 小时前
Qt 线程为什么和 Linux pthread 不一样?事件循环、QObject 线程归属与串口上位机正确架构
linux·qt·架构
少控科技5 小时前
QT新手日记025 - W002程序代码
开发语言·qt
C++ 老炮儿的技术栈5 小时前
Qt中自定义 QmyBattery 电池组件开发
c语言·开发语言·c++·windows·qt·idea·visual studio
少控科技7 小时前
QT新手日记 029 - QT所有模块
开发语言·qt
工业HMI实战笔记7 小时前
汽车制造业HMI设计特点:高节拍生产的界面优化
ui·信息可视化·性能优化·自动化·汽车·交互
夏河始溢8 小时前
一七九、WebRTC介绍
前端·人工智能·ui