Important: Please read the Qt Code of Conduct -

QNetworkAccessManager Signals and Slots

  • Hello,
    I'm using a single QNetworkAccessManager object to load many thumbnails at once. I've been able to do this just fine, but I'm having problems sending signals to the correct slots.
    If each thumbnail object connects to the finished signal of the one QNetworkAccessManager, then they all get the finished signal for each thumbnail downloaded instead of only one thumbnail per finished signal emitted.
    What's an elegant way to deal with this?

  • Create a thumbnail manager that connects to the finished signal, rather than a set of thumbnail objects that manage themselves.

    QNetworkAccessManager::finished() includes a reply object that provides information for mapping back to the original request. Create a mapping from some identifiable portion of the request to the object displaying the thumbnail.

  • Thanks for the quick reply. I've got this working.

Log in to reply