You mean how to replace QTextCodec with QStringConverter? (QTextStream remains the same in Qt6 as in Qt5)
I've only used QStringConverter for the case shown above but there are more info for example here