Hello everybody
I've a network request that returns a jpeg image. But I get the data as raw QByteArray. How can I convert the QByteArray into a QPixmap?
The requestFinished(QNetworkReply *pReply) slot shown below is connected to the signal void finished(QNetworkReply *) of QNetworkManager.
Code:
void NetworkManagement::requestFinished(QNetworkReply *pReply) { if (!pReply->error()) { // I need the pixmap to show it in a list view (decoration role) // I try to save the pixmap as a jpg file to the disk. bool result = pixmap.save("test.jpg", "jpg"); // This fails, Don't know why. Q_ASSERT(result); } }
Any advice?
Thanks!
