diff --git a/src/frontends/qt4/qt_helpers.cpp b/src/frontends/qt4/qt_helpers.cpp index 1e3befc79f..92b1187317 100644 --- a/src/frontends/qt4/qt_helpers.cpp +++ b/src/frontends/qt4/qt_helpers.cpp @@ -614,17 +614,16 @@ QString formatToolTip(QString text, int em) QFont const font = QToolTip::font(); int const px_width = em * QFontMetrics(font).width("M"); // Determine the ideal width of the tooltip - QTextDocument td(""); - td.setHtml(text); - td.setDefaultFont(QToolTip::font()); - td.setTextWidth(px_width); - double best_width = td.idealWidth(); + QTextDocument td(""); + td.setHtml(text); + td.setDefaultFont(QToolTip::font()); + td.setTextWidth(px_width); + double best_width = td.idealWidth(); // Set the line wrapping with appropriate width return QString("" "" "
%2
") .arg(QString::number(int(best_width) + 1), text); - return text; }