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 ;

Qt Code:
  1. QPixmap pixmap;
  2. pixmap.loadFromData(currentReply->readAll(), "PNG");
  3. _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;

Qt Code:
  1. QFile temp("msn_temp_avatar.PNG");
  2.  
  3. if(temp.open(QIODevice::ReadWrite))
  4. {
  5. temp.write(currentReply->readAll());
  6. }
To copy to clipboard, switch view to plain text mode 

and then pass the name of the file to the QPixmap like;

Qt Code:
  1. QPixmap pixmap(temp.fileName());
To copy to clipboard, switch view to plain text mode 

it works..

What might be the problem here?