QSslSocket, QTcpSocket, QFile, etc. are QIODevices. They provide low level data input/output, i.e. reading and writing blocks of data.
They don't interpret any data.
Applications or libraries using them can do with that data whatever they want, e.g. send it on, process it, discard it.
The application protocol layer knows how to interpret the data, in the case of IMAP it knows about tags and request and responses. And it is the one which has to know about compression and is the one that needs to handle it or pass this again on to the next layer.
Doing that has the additional advantage of separating transport from protocol, so each can be tested separately, or replaced, etc.
The code snippet you posted is doing exactly that.
Cheers,
_
Bookmarks