Design Patterns

1 post

15 min read

Using the Proxy Pattern with QNetworkReply in Qt

qt design-patterns
Using the Proxy Pattern with QNetworkReply in Qt

The proxy pattern can separate network replies from the code that processes their data. This Qt tutorial compares a signals-and-slots approach with an APIReply wrapper around QNetworkReply.

Background: Processing Network Replies in Qt

In a previous project that I worked on, we had to connect to backend API using Qt framework in order to download some files and display some content of these files, this thing might look easily done using QNetworkAccessManager and QNetworkReply. But we had other things to consider:

  • Size of the downloaded files was large.
  • No file should be stored in the device running the application.
Read more →