From e588b3c3a1052dfc063c9c058d361347329e7899 Mon Sep 17 00:00:00 2001 From: John Fultz Date: Sat, 15 Jul 2023 21:24:54 -0500 Subject: Make UTF8-encoding of QTextStream work in Qt5 and 6. QTextStream::setCodec() is no longer a thing in Qt6. Most of our call are to set the codec to UTF-8, which happens to be the default encoding in Qt6. So make a macro so this can compile in both Qt5 and Qt6. --- quacker/lexicondialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'quacker/lexicondialog.cpp') diff --git a/quacker/lexicondialog.cpp b/quacker/lexicondialog.cpp index 4f6d35d..88e86b1 100644 --- a/quacker/lexicondialog.cpp +++ b/quacker/lexicondialog.cpp @@ -218,7 +218,7 @@ void LexiconDialog::addWordsFromTextFile(const QString &textFile) return; QTextStream stream(&file); - stream.setCodec("UTF-8"); + SET_QTEXTSTREAM_TO_UTF8(stream); QString word; while (!stream.atEnd()) { -- cgit v1.2.3