当前位置:网站首页>QT QLabel样式设置
QT QLabel样式设置
2022-07-02 06:34:00 【懵懂的梦花火】

需要设置error的样式
设置样式

color:rgb(255, 0, 0);
font-size:12pt;
font-family:Microsoft YaHei;
字体、颜色也可通过富文本设置在程序中设置
emit LoginError(QStringLiteral("<font style='font-size:12px; color:red;'>用户名、密码错误!</font>"));
例如:
实现方法:
ui.mSizeLabel->setText(QStringLiteral("< font style='color:black; font-weight:normal;'>已保存 </font>")
+ "< font style = 'color:#5B8FF9; font-weight:bold;'>"+QString::number(_currSize)
+ "< / font > "+ QStringLiteral("< font style='color:black; font-weight:normal;'> 张</font>" ));
设置文字居中,使用qt的Designer,设置水平垂直居中
边栏推荐
- 洞见云原生|微服务及微服务架构浅析
- Supplier selection and prequalification of Oracle project management system
- Microservice practice | teach you to develop load balancing components hand in hand
- C语言之到底是不是太胖了
- Insight into cloud native | microservices and microservice architecture
- Chrome用户脚本管理器-Tampermonkey 油猴
- 个人经历&&博客现状
- College Students' CET-4 and CET-6 composition template (self created version, successfully crossed CET-6)
- [go practical basis] how to verify request parameters in gin
- 每天睡前30分钟阅读Day5_Map中全部Key值,全部Value值获取方式
猜你喜欢

Chrome视频下载插件–Video Downloader for Chrome

Troubleshooting and handling of an online problem caused by redis zadd

Number structure (C language -- code with comments) -- Chapter 2, linear table (updated version)

图像识别-数据清洗

Chrome browser plug-in fatkun installation and introduction

西瓜书--第五章.神经网络

Read Day6 30 minutes before going to bed every day_ Day6_ Date_ Calendar_ LocalDate_ TimeStamp_ LocalTime

Pool de connexion redis personnalisé

Probability is not yet. Look at statistical learning methods -- Chapter 4, naive Bayesian method

Fragmenttabhost implements the interface of housing loan calculator
随机推荐
I've taken it. MySQL table 500W rows, but someone doesn't partition it?
上班第一天的报错(AWVS卸载不彻底)
C语言之数据插入
Matplotlib剑客行——布局指南与多图实现(更新)
Customize redis connection pool
Say goodbye to 996. What are the necessary plug-ins in idea?
Pool de connexion redis personnalisé
Learn combinelatest through a practical example
一篇详解带你再次重现《统计学习方法》——第二章、感知机模型
Actual combat of microservices | discovery and invocation of original ecosystem implementation services
[go practical basis] gin efficient artifact, how to bind parameters to structures
自定義Redis連接池
破茧|一文说透什么是真正的云原生
C语言之判断直角三角形
Safety production early warning system software - Download safety production app software
[go practical basis] how to install and use gin
Attributes of classfile
图像识别-数据标注
Microservice practice | fuse hytrix initial experience
Watermelon book -- Chapter 6 Support vector machine (SVM)