Hi,
I have a QNetworkReply which contains a picture(PNG) as bytes.
The problem is; when I try to read all bytes in the the reply like ;
pixmap.loadFromData(currentReply->readAll(), "PNG");
_tempForMSNAvatarLoading->setAvatar(pixmap);
QPixmap pixmap;
pixmap.loadFromData(currentReply->readAll(), "PNG");
_tempForMSNAvatarLoading->setAvatar(pixmap);
To copy to clipboard, switch view to plain text mode
it doesn't load the image.
However, if I first write the image to a QFile;
QFile temp
("msn_temp_avatar.PNG");
{
temp.write(currentReply->readAll());
}
QFile temp("msn_temp_avatar.PNG");
if(temp.open(QIODevice::ReadWrite))
{
temp.write(currentReply->readAll());
}
To copy to clipboard, switch view to plain text mode
and then pass the name of the file to the QPixmap like;
QPixmap pixmap(temp.fileName());
To copy to clipboard, switch view to plain text mode
it works..
What might be the problem here?
Bookmarks