Qt: deprecation warnings, again

Check Qt version for the QFontMetrics::width vs horizontalAdvance.
Of course can't just #define horizontalAdvance to width, that would
be too easy ...
This commit is contained in:
Pasi Kallinen
2021-08-15 10:58:39 +03:00
parent 29aca6276e
commit 98ec66e00c
7 changed files with 22 additions and 13 deletions

View File

@@ -145,7 +145,7 @@ void NetHackQtMapViewport::SetupTextmapFont(QPainter &painter)
QFont f(fontfamily, pts, maybebold);
painter.setFont(QFont(fontfamily, pts));
QFontMetrics fm = painter.fontMetrics();
if (fm.horizontalAdvance("M") > qt_settings->glyphs().width())
if (fm.QFM_WIDTH("M") > qt_settings->glyphs().width())
break;
if (fm.height() > qt_settings->glyphs().height())
break;