int height = 1;
foreach(QTextLayout::FormatRange fr, styledText.formats) {
height = qMax(height, QFontMetrics(fr.format.font()).height());
}
int height = 1;
foreach(QTextLayout::FormatRange fr, styledText.formats) {
height = qMax(height, QFontMetrics(fr.format.font()).height());
}