Trouble accessing payload

Aleix Pol aleixpol at kde.org
Thu Mar 16 23:41:10 UTC 2017


On Fri, Mar 17, 2017 at 12:33 AM, Nicolas Fella <nicolas.fella at gmx.de> wrote:
> Hi,
>
> I'm trying to access a network packages payload (in this case PNG image
> data for notification images) and store it in a QByteArray. The most
> obvious approach would be using QIODevice.readAll(), however, it gives
> me an empty QByteArray (which could indicate an error according to QT
> docs). networkpackage.payload().size() is equal to zero, but there
> clearly is a payload since networkpackage.payloadSize() is >0. Can
> somebody help me accessing the payload data?

I know it's not the answer you're going for, but what are you trying
to do? Maybe if we understand it a bit we'll get to understand.

The short answer though is that it's a normal QIODevice and that you
can see all the code required in the FileTransferJob, which you
probably could use anyway.

Good luck!
Aleix


More information about the KDEConnect mailing list