网站介绍:文章浏览阅读3.1w次。最近在用Qt做文字的滚屏效果,要计算字体的像素高度和像素宽度,用到以下几个函数: 1. QLabel::fontMetrics().width(QString s): 获取字符串s的总像素宽度。int QFontMetrics::width ( const QString & text, int len = -1 ) constReturns the width in pixels of the first len characters of te
- 链接地址:https://blog.csdn.net/hanzengyi/article/details/6305791
- 链接标题:Qt 中获取字体的像素高度和宽度-CSDN博客
- 所属网站:blog.csdn.net
- 被收藏次数:3944
- 网站标签:Qt 中获取字体的像素高度和宽度