QTextStream::setCodec() is gone in Qt 6.0, so use the replacement setEncoding() function

This commit is contained in:
Cameron Gutman 2020-10-15 18:57:04 -05:00
parent 90a513dc3d
commit ec3b000264
2 changed files with 11 additions and 0 deletions

View file

@ -68,7 +68,12 @@ void AutoUpdateChecker::handleUpdateCheckRequestFinished(QNetworkReply* reply)
if (reply->error() == QNetworkReply::NoError) {
QTextStream stream(reply);
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
stream.setEncoding(QStringConverter::Utf8);
#else
stream.setCodec("UTF-8");
#endif
// Read all data and queue the reply for deletion
QString jsonString = stream.readAll();

View file

@ -414,7 +414,13 @@ NvHTTP::openConnectionToString(QUrl baseUrl,
QString ret;
QTextStream stream(reply);
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
stream.setEncoding(QStringConverter::Utf8);
#else
stream.setCodec("UTF-8");
#endif
ret = stream.readAll();
delete reply;