From ec3b000264e1afee2bb17f268efac0e6016caa4c Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Thu, 15 Oct 2020 18:57:04 -0500 Subject: [PATCH] QTextStream::setCodec() is gone in Qt 6.0, so use the replacement setEncoding() function --- app/backend/autoupdatechecker.cpp | 5 +++++ app/backend/nvhttp.cpp | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/app/backend/autoupdatechecker.cpp b/app/backend/autoupdatechecker.cpp index 7db57334..6d607beb 100644 --- a/app/backend/autoupdatechecker.cpp +++ b/app/backend/autoupdatechecker.cpp @@ -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(); diff --git a/app/backend/nvhttp.cpp b/app/backend/nvhttp.cpp index db6d7c56..6c50004d 100644 --- a/app/backend/nvhttp.cpp +++ b/app/backend/nvhttp.cpp @@ -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;