当前位置:网站首页>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);问题解决
边栏推荐
- Xiaojinwei, chairman of Chenglian Technology: implement the national strategy of data economy and lead the development of new consumption in the digital era!
- Halcon glue line detection - template matching, pose transformation, glue width, glue continuity detection
- Online JSON to CSharp (c) class tool
- [pytoch] calculate the derivative of sin (x) by automatic differentiation
- Fundamentals of 3D mathematics [16] formulas for uniformly accelerated linear motion
- [acnoi2022] no way without guessing
- 2022年烷基化工艺考题及模拟考试
- Cocos学习日记1——节点
- svg d3. JS generate tree tree view
- Introduction and use of MySQL view
猜你喜欢

photoshop PS 查看像素坐标、像素颜色、像素HSB颜色

LabVIEW在同一表中同时显示十六进制字符和普通字符

Pytoch --- use pytoch's pre training model to realize four weather classification problems

Pytorch---Pytorch进行自定义Dataset

Leetcode 1208. Try to make the strings equal as much as possible (finally solved, good night)

Please use the NLTK Downloader to obtain the resource

Introduction to deep learning

Svg+js smart home monitoring grid layout

【二叉树进阶】AVLTree - 平衡二叉搜索树

【Pytorch】用自动微分求sin(x)的导数
随机推荐
IDEA-导入模块
What is the open source database under Linux
Sessions and Daemons
Tables de recherche statiques et tables de recherche statiques
解决使用Exception抛出后,@Transactional不生效
It supports running in kubernetes, adds multiple connectors, and seatunnel version 2.1.2 is officially released!
leetcode 91. Decode ways (medium)
Audio and video development journey (63) - animation and rendering of Lottie source code analysis
Review the SQL row column conversion, and the performance has been improved
PTA:7-65 饮料的价格
PTA:7-64 该日是该年的第几天
Leetcode 1208. Make strings as equal as possible
【一起上水硕系列】Day Three - preview4
PTA:6-29 虚基类的应用-人与教师学生
距离度量 —— 余弦距离(Cosine Distance)
理想汽车×OceanBase:当造车新势力遇上数据库新势力
2022金属非金属矿山(露天矿山)安全管理人员考试题模拟考试题库及答案
PTA: Simulation Implementation of 7-86 set (function template)
[multimode] unimo
QMainWindow