当前位置:网站首页>Qt|qlabole change line spacing when displaying multiple lines
Qt|qlabole change line spacing when displaying multiple lines
2022-07-25 08:33:00 【InfoQ】
the front
development environment :WIN10 + VS2017 + Qt5.14.2 64 position

Function realization
1: Text wrapping
ui.labContent->setFiexedWidth(800);
ui.labContent->setText(qsContent);
ui.labContent->setWordWarp(true);
ui.labContent->adjustSize();
2: Text font settings
// obtain :QLabel Default font style
QFont fontContent = ui.labContent->font();
// Set up : Font style : Microsoft YaHei
fontContent->setFamily("Microsoft YaHei");
// Set up : font size :22
fontContent->setPixelSize(22);
// Set up : Font color value
QPalette peContent;
peContent.setColor(QPalette::WindowText, QColor(51, 51, 51));
ui.labContent->setPalette(peContent);
// Font binding
ui.labContent->setFont(fontContent);
3: Row spacing settings
<p style='line-height:40px;'></p>
<p style='width:100%;'></p>
<p style='white-space: pre-wrap'></p>
QString qsShow = "<p style='line-height:40px; width:100% ; white-space: pre-wrap; '>" + qsContent + "</p>";
summary
边栏推荐
- Eureka forced offline service
- Mogdb 3.0 how to add a standby database in the environment of one active and one standby
- Online bookstore system based on jsp+servlet+mysql
- Sun Tzu's art of war
- [dark horse programmer] redis learning notes 001: introduction to redis + five basic data types
- Advanced C language (XIII) - Example Analysis of dynamic memory management
- Interview questions: common faults and occurrence scenarios of redis
- Raspberry pie CM4 -- using metartc3.0 to integrate ffmpeg to realize webrtc push-pull streaming
- Blue and white porcelain used by Charles
- A simple SQL injection shooting range exercise
猜你喜欢
![[ten thousand words long text] Based on LSM tree thought Net 6.0 C # realize kV database (case version)](/img/07/235785b7658b5ae022dfa3f53ec86d.png)
[ten thousand words long text] Based on LSM tree thought Net 6.0 C # realize kV database (case version)

CAS operation
![[dark horse programmer] redis learning notes 001: introduction to redis + five basic data types](/img/f7/9f43cd964a671f3b53337999332280.png)
[dark horse programmer] redis learning notes 001: introduction to redis + five basic data types

Raspberry pie 4B parsing PWM

第3章业务功能开发(修改线索,数据回显并修改数据)

Teach you to understand the computer optometry sheet

How to set up a personal website for free

Use of lambdaquerywrapper, lambdaupdatewrapper, lambdaquerychainwrapper

第3章业务功能开发(查询线索)

Advanced C language (XII) - dynamic memory management
随机推荐
efcore在Saas系统下多租户零脚本分表分库读写分离解决方案
Mogdb 3.0 how to add a standby database in the environment of one active and one standby
Idea2021 failed to start. Could not find main class com/intellij/idea/main
ArcGIS Pro scripting tool (10) -- generate.Stylx style symbols from layers
uni-app
【万字长文】使用 LSM-Tree 思想基于.Net 6.0 C# 实现 KV 数据库(案例版)
@Differences between requestparam, @pathparam, @pathvariable and other annotations (use of some annotations)
【keras bug】Tensor is unhashable if Tensor equality is enabled. Instead, use tensor.experimental_ ref(
第3章业务功能开发(查询线索)
Huawei device remote login (Telnet, SSH) configuration
提高代码可续性的小技巧,以connectTo方法为例。
Svg creative underline style JS special effect
Talk about your transformation test development process
Redis best practices
Machine learning theory and case analysis (Part1) -- Fundamentals of machine learning
刷题《剑指Offer》day02
Eureka forced offline service
Brush the title "sword finger offer" day02
刷题《剑指Offer》day01
[Sesame Street family] & Bert Bart Roberta