by using a method that returns a QByteArray. You'll find it in the documentation.

just to mention it the 134281246874th time:

This class is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.