当前位置:网站首页>QT Chinese and English use different fonts respectively
QT Chinese and English use different fonts respectively
2022-06-25 23:36:00 【The struggle history of polar bear】
Make a note of Qt Use style sheets to specify Chinese 、 How to use different fonts in English .
Look at the effect :

It's very simple :
lablel->setStyleSheet(QString("QLabel{ font-family:'Roman, Chinese Xingkai '; font-size: 16pt; color: red; }");
Just set multiple font names , The middle is separated by commas .
Be careful : Set the English font first , Then set the Chinese font , such qt Will first look in the first font , If you can't find it, go to the second font .
Record it again Qt The method of setting fonts for the software as a whole :
stay main Add the following code to the function :
QFont ff("Times New Roman, SimSun, SimSun-ExtB");
app.setFont(ff);
Finally, record Qt At high resolution , Font anti aliasing method , Visual inspection of this method in qt5.15 The above version is valid
newly build qt.conf file , The content of the document is :
[Platforms]
WindowsArguments = fontengine=freetype
And then qt.conf Put... Into the project qrc In the resource file , Resource path is :
:/qt/etc/qt.conf
Recompile to generate executable file
边栏推荐
- golang Make a list of intervals with sequential numbers
- BI-SQL丨存储过程(一)
- Leetcode (605) -- flower planting
- C language (I)
- Xampp重启后,MySQL服务就启动不了。
- cookie、session、token
- Ad20 learning notes I
- CTS RTS RX TX in serial port flow control UART (direct communication between serial port module and MCU)
- 首个大众可用PyTorch版AlphaFold2复现,哥大开源OpenFold,star量破千
- 指针强化与提高
猜你喜欢

hiberate核心API/配置文件/一级缓存详解

Pycharm student's qualification expires, prompting no suitable licenses associated with account solution

转载: QTableWidget详解(样式、右键菜单、表头塌陷、多选等)

Uni app -- listen for the exit of the return key

CSDN add on page Jump and off page specified paragraph jump

Kotlin空指针Bug

RK3568+鸿蒙工控板工业网关视频网关解决方案

指针强化与提高

UE4_ Ue5 combines the offline voice recognition plug-in for speech recognition

Bi-sql stored procedure (I)
随机推荐
Qt自定义实现的日历控件
毕业旅行 | 伦敦5日游行程推荐
cookie、session、token
Svn icon disappearing solution
C. Planar Reflections-CodeCraft-21 and Codeforces Round #711 (Div. 2)
Summary of common JDBC exceptions and error solutions
Comp2913 database
konva系列教程2:绘制图形
指针强化与提高
【opencv450-samples】读取图像路径列表并保持比例显示
Implementation of sequence table: static and dynamic
The software test interview has been suspended. The interviewer always says that the logical thinking is chaotic. What should I do?
Qt Utf8 与 Unicode 编码的互相转换, Unicode编码输出为格式为 &#xXXXX
Pycharm student's qualification expires, prompting no suitable licenses associated with account solution
String对象(常量)池
CAD中图纸比较功能怎么用
OpenJudge NOI 2.1 15:Counterfeit Dollar
Informatics Orsay all in one 1353: expression bracket matching | Luogu p1739 expression bracket matching
[opencv450 samples] read the image path list and maintain the proportional display
Day4 branch and loop summary and operation