Hi, I am trying to download images so I can show them in a label widget by setting the pixmap.
My code works fine for images with an url that end with an image file type. However, some of the urls are like this: "http://example.com/image.php" on which the content-type header is set to "image/png" and an image is returned, but my code doesn't work in these cases.
This is the code:
QNetworkRequest request
(QUrl("http://example.com/image.png"));
manager->get(request);
QNetworkRequest request(QUrl("http://example.com/image.png"));
manager->get(request);
To copy to clipboard, switch view to plain text mode
@slot:
image.loadFromData(reply->readAll());
ui->lblPic->setPixmap(image);
QPixmap image;
image.loadFromData(reply->readAll());
ui->lblPic->setPixmap(image);
To copy to clipboard, switch view to plain text mode
Help is appreciated
Bookmarks