mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-05 17:09:56 +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);
|
text = Qt::convertFromPlainText(text, Qt::WhiteSpaceNormal);
|
||||||
// Compute desired width in pixels
|
// Compute desired width in pixels
|
||||||
QFont const font = QToolTip::font();
|
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");
|
int const px_width = em * QFontMetrics(font).width("M");
|
||||||
|
#endif
|
||||||
// Determine the ideal width of the tooltip
|
// Determine the ideal width of the tooltip
|
||||||
QTextDocument td("");
|
QTextDocument td("");
|
||||||
td.setHtml(text);
|
td.setHtml(text);
|
||||||
|
Loading…
Reference in New Issue
Block a user