当前位置:网站首页>QT elidedText 只对中文符合起作用,对英文不起作用的问题解决
QT elidedText 只对中文符合起作用,对英文不起作用的问题解决
2022-06-23 03:50:00 【还债大湿兄】
QString strNodeName = “只对中文符合你作用”;
//QString strNodeName = “only yuo only yuo only yuoonly yuo only yuo only yuo ”;
const QString elidedIdNew = fm.elidedText(strNodeName,
Qt::ElideMiddle,
100);发觉对英文一点也不起作用,起初以为宽度有问题,打印出宽度后发觉也正常,最后发觉,取像的
pixelSize()为0
qreal nPix = painter->font().pixelSize();
qDebug("nPix %d", nPix);解决方法调用前先设置自己要的字体大小:
QFont font = painter->font();
//TODO: change font size
font.setPixelSize(9);
painter->setFont(font);问题解决
边栏推荐
- leetcode 91. Decode Ways 解码方法(中等)
- PTA:6-73 函数调用
- 深度学习 简介
- 离线数仓建模中常见的概念-术语
- How to ensure application security
- Online JSON to CSharp (c) class tool
- [deep learning] deep learning reasoning framework tensorrt MNN openvino onnxruntime
- 2022年起重机械安全管理考试题库及答案
- 语料库数据处理个案实例(词性赋码、词性还原)
- Svg+js smart home monitoring grid layout
猜你喜欢

How does flutter achieve different zoom animation effects

摆烂LuoGu刷题记

Implementation of VGA protocol based on FPGA

svg d3. JS generate tree tree view

12 excellent practices of wireless network security

制造型企业开发的SRM供应商管理系统特点是什么

Xiaojinwei, chairman of Chenglian Technology: implement the national strategy of data economy and lead the development of new consumption in the digital era!

How to use MySQL index well

A summary of PostgreSQL data types. All the people are here

Zhongang Mining: the demand for fluorite in the new energy and new material industry chain has increased greatly
随机推荐
语料库数据处理个案实例(分词和分句、词频统计、排序)
Pta:6-33 student ranking table (destructor)
PTA:7-60 宠物的生长
Lighthouse locally deployed TCA code analysis tool
OpenJudge NOI 1.13 50:数根
麦肯锡:2021年量子计算市场投资增长强劲,人才缺口扩大
Introduction and use of MySQL view
How to ensure application security
QMainWindow
8 key indicators to measure technology debt in 2022
flutter系列之:flutter中的Wrap
If you want to understand PostgreSQL, you must first brush the architecture
Flutter series: wrap in flutter
【Pytorch】用自动微分求sin(x)的导数
PTA:6-71 时钟模拟
2022年烷基化工艺考题及模拟考试
Sequence table lookup
深度学习 简介
Getting started with tensorflow
【一起上水硕系列】Day Three - preview4