I have to deal with two kinds of network requests when using QtWebKit; synchronous and asynchronous. Synchronous requests are those that are sent to download all external resources referenced by some web page. Asynchronous ones are those that are sent after a web page is loaded and are triggered by JavaScript code and/or user's actions. When all synchronous requests are finished and the page is complete QWebPage (or QWebFrame in case of single frame) emits loadFinished() signal. However QtWebKit does not signal when asynchronous request is finished. To know when they are finished I had to subclass QNetworkAccessManager used by QtWebKit.

Now I'm wondering how should I subclass QNetworkReply so that I have two subclasses, one for each kind of request?

Simply declaring
Qt Code:
  1. class SynchReply : public QNetworkReply {};
To copy to clipboard, switch view to plain text mode 
and
Qt Code:
  1. class AsynchReply : public QNetworkReply {};
To copy to clipboard, switch view to plain text mode 
won't work as there's no way of setting its QNetworkReply part after receiving QNetworkReply from QNetworkAccessManager in a call like this
QNetworkReply * reply = QNetworkAccessManager::createRequest(op, req, outgoingData);
from within my subclass of QNetworkAccessManager.