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:
+1
-2
@@ -50,8 +50,7 @@ NetHackQtGlyphs::NetHackQtGlyphs()
|
||||
|
||||
tile_file = PIXMAPDIR "/x11tiles";
|
||||
if (!img.load(tile_file)) {
|
||||
QString msg;
|
||||
msg.sprintf("Cannot load 'nhtiles.bmp' or 'x11tiles'.");
|
||||
QString msg = QString::asprintf("Cannot load 'nhtiles.bmp' or 'x11tiles'.");
|
||||
QMessageBox::warning(0, "IO Error", msg);
|
||||
iflags.wc_ascii_map = 1;
|
||||
iflags.wc_tiled_map = 0;
|
||||
|
||||
Reference in New Issue
Block a user