CSize fontMetricsCSize(QString source, QPainter *pDC);
CSize fontMetricsCSize(QString source, QPainter *pDC)
{
CSize sz;
QFontMetrics fontMetrics(pDC->font());
int nFontWidth = fontMetrics.width(source);
int nFontHeight = fontMetrics.height();
sz = CSize(nFontWidth, nFontHeight);
return sz;
}
原文地址:https://www.cnblogs.com/ShiShouTHS/p/11365548.html
时间: 2024-11-13 06:53:00