QTextStream::setCodec was removed in Qt6.
It was not deprecated in 5.15, see
There is no mention of setCodec in the new documentation, see
There is no mention of QTextStream in the porting guide
And there is no mention of QTextStream in the changes to Qt Core:
Please add a paragraph about the changes to QTextStream to a suitable place.