Trouble accessing payload

Nicolas Fella nicolas.fella at gmx.de
Thu Mar 16 23:57:09 UTC 2017



On 03/17/2017 12:41 AM, Aleix Pol wrote:
> On Fri, Mar 17, 2017 at 12:33 AM, Nicolas Fella <nicolas.fella at gmx.de> wrote:
> 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
I'm trying to enable displaying the icon of a Notification in the
notifications Plugin. Therefor I need to access the payload, which is
the image data in PNG format and store it in a QPixmap (or an QByteArray
from where the QPixmap will load the data).

What surprises me is that payload->size() gives me 0 when
networkpackage.payloadSize() gives me the correct size (payload is of
type QSharedPointer<QIODevice>).

I had an almost working solution using FiletransferJob, but it only
worked the second time a notification was send, probably due to the
FileTransferJob working asynchronously (I guess?). Now I'm trying not to
use files at all and directly copying the payload data to the QPixmap

Thanks for your help

Nicolas


More information about the KDEConnect mailing list