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

最终效果:

相关推荐
小小码农Come on8 小时前
WorkerScript处理qml多线程处理异步数据
qt
小灰灰搞电子8 小时前
Qt 中的队列解析
qt
QC·Rex11 小时前
Spring AI MCP Apps 实战:打造聊天与富 UI 融合的智能化应用
人工智能·spring·ui·spring ai·mcp
ai_coder_ai13 小时前
自动化脚本ui编程之帧布局(frame)
ui·autojs·自动化脚本·冰狐智能辅助·easyclick
天天进步201513 小时前
不止于 UI:OpenWork 的核心哲学与“引擎+外壳”架构全景图
人工智能·ui·架构
星辰即远方14 小时前
UI学习3
学习·ui
原来是猿14 小时前
QT初识【创建项目+对象树】
开发语言·qt
-凌凌漆-15 小时前
【Qt】 QSerialPort::flush()介绍
开发语言·qt
咸鱼翻身小阿橙16 小时前
QT P4
数据库·qt·nginx
比老马还六17 小时前
element-ui,使用el-table时,type=“expand“和fixed一起使用坑
开发语言·javascript·ui