I don't think you can, from the simple fact, that QByteArray has non visible ASCII values (or can have).
What you need is not to be able to convert QByteArray to QString, but to apply the functionality you have in QStinrg for your QByteArray data.
As far as I understand it, you will have to implement that your self.