Vesna
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
NetworkReplyTimeout.h
Go to the documentation of this file.
1 #ifndef NETWORKREPLYTIMEOUT_H
2 #define NETWORKREPLYTIMEOUT_H
3 
4 #include <QObject>
5 #include <QScopedPointer>
6 
7 class QNetworkReply;
8 
13 class NetworkReplyTimeout : public QObject
14 {
15  Q_OBJECT
16 public:
18  {
19  Abort = 0, // releases network resources immediately
20  Close = 1 // allows the request to finish but discards any data received
21  };
22 
23  static NetworkReplyTimeout* SetNetworkReplyTimeout( QNetworkReply *networkReply, const int replyTimeout, const NetworkReplyTimeoutHandlingMethod handlingMethod = Abort );
24 
25 private slots:
26  void OnTimeout();
27 
28 signals:
29  void Timeout();
30 
31 private:
32  explicit NetworkReplyTimeout( QNetworkReply *networkReply, const int replyTimeout, const NetworkReplyTimeoutHandlingMethod handlingMethod );
33  virtual ~NetworkReplyTimeout();
34 
35  class DataClass;
36  QScopedPointer<DataClass> d;
37 };
38 
39 #endif // NETWORKREPLYTIMEOUT_H
NetworkReplyTimeoutHandlingMethod
Definition: NetworkReplyTimeout.h:17
Definition: NetworkReplyTimeout.h:20
Definition: NetworkReplyTimeout.h:19
Definition: NetworkReplyTimeout.h:13
static NetworkReplyTimeout * SetNetworkReplyTimeout(QNetworkReply *networkReply, const int replyTimeout, const NetworkReplyTimeoutHandlingMethod handlingMethod=Abort)
Definition: NetworkReplyTimeout.cpp:28