当前位置:网站首页>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,设置水平垂直居中
边栏推荐
- 微服务实战|微服务网关Zuul入门与实战
- MySQL事务
- 西瓜书--第五章.神经网络
- C语言之判断直角三角形
- FragmentTabHost实现房贷计算器界面
- c语言编程题
- 记录一下初次使用Xray的有趣过程
- "Interview high frequency question" is 1.5/5 difficult, and the classic "prefix and + dichotomy" application question
- Double non undergraduate students enter the factory, while I am still quietly climbing trees at the bottom (Part 1)
- Jd.com interviewer asked: what is the difference between using on or where in the left join association table and conditions
猜你喜欢

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

知识点很细(代码有注释)数构(C语言)——第三章、栈和队列

Solution to amq4036 error in remote connection to IBM MQ

Hystrix implements request consolidation

hystrix 实现请求合并

Don't look for it. All the necessary plug-ins for Chrome browser are here

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

概率还不会的快看过来《统计学习方法》——第四章、朴素贝叶斯法

Say goodbye to 996. What are the necessary plug-ins in idea?
![[go practical basis] how to bind and use URL parameters in gin](/img/63/84717b0da3a55d7fda9d57c8da2463.png)
[go practical basis] how to bind and use URL parameters in gin
随机推荐
Bold prediction: it will become the core player of 5g
From concept to method, the statistical learning method -- Chapter 3, k-nearest neighbor method
Matplotlib swordsman - a stylist who can draw without tools and code
How to use pyqt5 to make a sensitive word detection tool
Microservice practice | fuse hytrix initial experience
[go practical basis] how to verify request parameters in gin
Don't look for it. All the necessary plug-ins for Chrome browser are here
Watermelon book -- Chapter 6 Support vector machine (SVM)
Chrome user script manager tempermonkey monkey
Amq6126 problem solving ideas
微服务实战|Eureka注册中心及集群搭建
Navicat remote connection MySQL reports an error 1045 - access denied for user 'root' @ '222.173.220.236' (using password: yes)
FragmentTabHost实现房贷计算器界面
自定義Redis連接池
Redis installation and deployment (windows/linux)
每天睡前30分钟阅读Day5_Map中全部Key值,全部Value值获取方式
How to use PHP spoole to implement millisecond scheduled tasks
Double non undergraduate students enter the factory, while I am still quietly climbing trees at the bottom (Part 1)
图像识别-数据清洗
Insight into cloud native | microservices and microservice architecture