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

@@ -244,7 +244,7 @@ NetHackQtExtCmdRequestor::NetHackQtExtCmdRequestor(QWidget *parent) :
for (i = 0; extcmdlist[i].ef_txt; ++i) {
if (interesting_command(i, set)) {
++ncmds;
butw = std::max(butw, 30 + fm.horizontalAdvance(extcmdlist[i].ef_txt));
butw = std::max(butw, 30 + fm.QFM_WIDTH(extcmdlist[i].ef_txt));
}
}
// if any of the choice buttons were bigger than the control buttons,