UI: Don't use QTextStream::setCodec in Qt6

In Qt6, QTextStream::setCodec has been replaced by
QTextStream::setEncoding. However, all text is assumed to be UTF-8, so
we don't need to specify UTF-8 in Qt6.

https://doc.qt.io/qt-5/qtextstream.html#setCodec-1
https://doc.qt.io/qt-6/qtextstream.html#setEncoding
master
Ryan Foster 2021-03-09 09:11:19 -05:00
parent 05d29aa4e3
commit e81f8e3857
1 changed files with 1 additions and 3 deletions

View File

@ -101,9 +101,7 @@ void OBSLogViewer::InitLog()
if (file.open(QIODevice::ReadOnly)) {
QTextStream in(&file);
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
in.setEncoding(QStringConverter::Utf8);
#else
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
in.setCodec("UTF-8");
#endif