Qt: Fix Qt5 deprecation warnings
Mostly the warnings were about QString::sprintf and QFontMetrics::width. sprintf replacement is asprintf, which annoyingly behaves differently from sprintf - it seems to append to the string. Not thoroughly tested, but seems to work.
This commit is contained in:
@@ -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.width(extcmdlist[i].ef_txt));
|
||||
butw = std::max(butw, 30 + fm.horizontalAdvance(extcmdlist[i].ef_txt));
|
||||
}
|
||||
}
|
||||
// if any of the choice buttons were bigger than the control buttons,
|
||||
|
||||
Reference in New Issue
Block a user