Qt5: Replace deprecated functions of QString:

'QString& QString::vsprintf(const char*, __va_list_tag*)' is deprecated: Use vasprintf(), arg() or QTextStream instead [-Wdeprecated-declarations]
'QString& QString::sprintf(const char*, ...)' is deprecated: Use asprintf(), arg() or QTextStream instead [-Wdeprecated-declarations]
This commit is contained in:
wmayer
2020-06-11 23:09:13 +02:00
committed by wwmayer
parent aefd5e2358
commit a455927d4a
2 changed files with 9 additions and 0 deletions

View File

@@ -624,7 +624,11 @@ void Command::_doCommand(const char *file, int line, DoCmd_Type eType, const cha
va_list ap;
va_start(ap, sCmd);
QString s;
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
const QString cmd = s.vsprintf(sCmd, ap);
#else
const QString cmd = s.vasprintf(sCmd, ap);
#endif
va_end(ap);
// 'vsprintf' expects a utf-8 string for '%s'