当前位置:网站首页>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,设置水平垂直居中
边栏推荐
- 每天睡前30分钟阅读Day6_Day6_Date_Calendar_LocalDate_TimeStamp_LocalTime
- How to choose between efficiency and correctness of these three implementation methods of distributed locks?
- Redis installation and deployment (windows/linux)
- Timed thread pool implements request merging
- Chrome browser tag management plug-in – onetab
- Oracle modify database character set
- 大学生四六级作文模板(自创版,成功跨过六级)
- 微服务实战|熔断器Hystrix初体验
- Actual combat of microservices | discovery and invocation of original ecosystem implementation services
- Micro service practice | introduction and practice of zuul, a micro service gateway
猜你喜欢

微服务实战|Eureka注册中心及集群搭建

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

Matplotlib剑客行——布局指南与多图实现(更新)

深入剖析JVM是如何执行Hello World的

Difference between redis serialization genericjackson2jsonredisserializer and jackson2jsonredisserializer

Say goodbye to 996. What are the necessary plug-ins in idea?

图像识别-数据清洗

记录一下初次使用Xray的有趣过程

Watermelon book -- Chapter 6 Support vector machine (SVM)

微服务实战|微服务网关Zuul入门与实战
随机推荐
[go practical basis] how to install and use gin
MySQL error: unblock with mysqladmin flush hosts
一次聊天勾起的回忆
BugkuCTF-web16(备份是个好习惯)
深入剖析JVM是如何执行Hello World的
Supplier selection and prequalification of Oracle project management system
Hystrix implements request consolidation
上班第一天的报错(AWVS卸载不彻底)
c语言编程题
DTM distributed transaction manager PHP collaboration client V0.1 beta release!!!
AMQ 4043 solution for errors when using IBM MQ remote connection
From concept to method, the statistical learning method -- Chapter 3, k-nearest neighbor method
分布式锁的这三种实现方式,如何在效率和正确性之间选择?
Navicat remote connection MySQL reports an error 1045 - access denied for user 'root' @ '222.173.220.236' (using password: yes)
记录下对游戏主机配置的个人理解与心得
VIM操作命令大全
"Redis source code series" learning and thinking about source code reading
Safety production early warning system software - Download safety production app software
Matplotlib swordsman - a stylist who can draw without tools and code
BugkuCTF-web21(详细解题思路及步骤)