blob: d7b17ab735a9b0689aeec5e78cac4f3de2bf42ea (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
//! [0]
QFont font("times", 24);
QFontMetrics fm(font);
int pixelsWide = fm.width("What's the width of this text?");
int pixelsHigh = fm.height();
//! [0]
//! [1]
QFont font("times", 24);
QFontMetricsF fm(font);
qreal pixelsWide = fm.width("What's the width of this text?");
qreal pixelsHigh = fm.height();
//! [1]
|