75 double height = font_metrics.height()/2;
77 for (
auto line:
m_text.split(
"\n")) {
78 height += font_metrics.height();
79 QRectF font_rect = font_metrics.boundingRect(line);
80 if (font_rect.width() > width) {
81 width = font_rect.width();
84 width += font_metrics.averageCharWidth()*2;
86 return QRectF(0, 0, width, height);