当前位置:网站首页>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 use pyqt5 to make a sensitive word detection tool
- Number structure (C language) -- Chapter 4, compressed storage of matrices (Part 2)
- What is the function of laravel facade
- hystrix 实现请求合并
- Machine learning practice: is Mermaid a love movie or an action movie? KNN announces the answer
- Actual combat of microservices | discovery and invocation of original ecosystem implementation services
- Say goodbye to 996. What are the necessary plug-ins in idea?
- Microservice practice | declarative service invocation openfeign practice
- Matplotlib swordsman line - layout guide and multi map implementation (Updated)
猜你喜欢
MySQL事务
微服务实战|熔断器Hystrix初体验
kinect dk 获取CV::Mat格式的彩色RGB图像(openpose中使用)
Chrome browser plug-in fatkun installation and introduction
Matplotlib swordsman line - first acquaintance with Matplotlib
[go practical basis] how to verify request parameters in gin
Microservice practice | load balancing component and source code analysis
Chrome user script manager tempermonkey monkey
Insight into cloud native | microservices and microservice architecture
zk配置中心---Config Toolkit配置与使用
随机推荐
How to use PHP spoole to implement millisecond scheduled tasks
Pdf document of distributed service architecture: principle + Design + practice, (collect and see again)
图像识别-数据清洗
[go practical basis] how to install and use gin
Double non undergraduate students enter the factory, while I am still quietly climbing trees at the bottom (Part 1)
Break the cocoon | one article explains what is the real cloud primordial
C语言之数据插入
zk配置中心---Config Toolkit配置与使用
别找了,Chrome浏览器必装插件都在这了
C语言之做木桶
Mysql 多列IN操作
Safety production early warning system software - Download safety production app software
Solution to amq4036 error in remote connection to IBM MQ
因上努力,果上随缘
Oracle modifies tablespace names and data files
BugkuCTF-web16(备份是个好习惯)
每天睡前30分钟阅读Day6_Day6_Date_Calendar_LocalDate_TimeStamp_LocalTime
深入剖析JVM是如何执行Hello World的
C语言之二进制与十进制
Typeerror: X () got multiple values for argument 'y‘