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:
@@ -36,7 +36,7 @@ tryload(QPixmap& pm, const char* fn)
|
||||
{
|
||||
if (!pm.load(fn)) {
|
||||
QString msg;
|
||||
msg.sprintf("Cannot load \"%s\"", fn);
|
||||
msg = QString::asprintf("Cannot load \"%s\"", fn);
|
||||
QMessageBox::warning(NetHackQtBind::mainWidget(), "IO Error", msg);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user