mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-07 02:28:35 +00:00
address deprecation warning
This commit is contained in:
parent
28dd0e1f21
commit
4fdcf0e929
@ -703,7 +703,11 @@ QString formatToolTip(QString text, int em)
|
||||
text = Qt::convertFromPlainText(text, Qt::WhiteSpaceNormal);
|
||||
// Compute desired width in pixels
|
||||
QFont const font = QToolTip::font();
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
|
||||
int const px_width = em * QFontMetrics(font).horizontalAdvance("M");
|
||||
#else
|
||||
int const px_width = em * QFontMetrics(font).width("M");
|
||||
#endif
|
||||
// Determine the ideal width of the tooltip
|
||||
QTextDocument td("");
|
||||
td.setHtml(text);
|
||||
|
Loading…
Reference in New Issue
Block a user