当前位置:网站首页>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
边栏推荐
- OpenJudge NOI 2.1 15:Counterfeit Dollar
- CSDN force value
- Analysis on the control condition and mode of go cooperation overtime exit
- QLabel 文字水平滚动显示
- UE4_ Ue5 combines the offline voice recognition plug-in for speech recognition
- Qt 中文和英文分别使用不同的字体
- C2. k-LCM (hard version)-Codeforces Round #708 (Div. 2)
- What is Unified Extensible Firmware Interface (UEFI)?
- UE4\UE5 蓝图节点Delay与Retriggerable Delay的使用与区别
- Uni app -- listen for the exit of the return key
猜你喜欢

我的vscode

二进制、16进制、大端小端

What is Unified Extensible Firmware Interface (UEFI)?

【opencv450-samples】inpaint 使用区域邻域恢复图像中的选定区域

CSDN添加页内跳转和页外指定段落跳转

Rk3568+ Hongmeng industrial control board industrial gateway video gateway solution

Multithreaded learning 2- call control

UE4 学习记录一 创建角色,并控制其移动

Leaky API interface practical development series (13): gooseneck cloud service php-api two-dimensional array parameter transfer solution
![Classic image segmentation network: UNET supports libtorch deployment reasoning [with code]](/img/3a/fb3bfe673db5123e3124404f3905c0.png)
Classic image segmentation network: UNET supports libtorch deployment reasoning [with code]
随机推荐
Ad20 learning notes II
[Axi] interpretation of Axi protocol disorder mechanism
Count the number of different palindrome subsequences in the string
解决TypeError: Unicode-objects must be encoded before hashing
Extraction system apk
CDN加速是什么
Bi-sql stored procedure (I)
String对象(常量)池
UE4 学习记录一 创建角色,并控制其移动
Xinchida nd04 nd04c nrf52832 (52810) ble module (low power Bluetooth communication module) at command test
Leaky API interface practical development series (13): gooseneck cloud service php-api two-dimensional array parameter transfer solution
To solve the incompatibility between VM and device/credential guard, an effective solution for the whole network
jdbc常见异常及错误解决办法汇总
QT custom implemented calendar control
记录一下Qt将少量图片输出为MP4的思路及注意事项
Qt 中文和英文分别使用不同的字体
Efr32bg22 ble module (low power Bluetooth communication module) at command test
Use of xinchida ble 5.0 Low Power Bluetooth module (at command serial port transparent transmission) rsbrs02abr
Xampp重启后,MySQL服务就启动不了。
CTS RTS RX TX in serial port flow control UART (direct communication between serial port module and MCU)