Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

How to download an image from a .php page?



  • I am using QNetworkAccessManager to download images which I display in a label widget.
    This works for images that have an url ending with the file type:

    QNetworkRequest request(QUrl("http://my-url.png"));
    manager->get(request);
    

    @ Slot:

    QPixmap image;
    image.loadFromData(reply->readAll());
    
    ui->lblPic->setPixmap(image);
    

    But some of these images are on a .php that returns a png image, and this doesn't work for those. So how would I make it work for those?

    Thanks in advance.



  • HI and welcome to devnet,

    But some of these images are on a .php that returns a png image,

    can you explain better?? One example?
    Probably you have to pass some query parameters to the GET URL


Log in to reply