39 : QNetworkReply (parent)
50 setError (error, text);
55 setHeader (header, value);
60 setHeader (QNetworkRequest::ContentTypeHeader, ct);
73 open (ReadOnly | Unbuffered);
75 SetHeader (QNetworkRequest::ContentLengthHeader, QVariant (Content_.size ()));
77 QTimer::singleShot (0,
79 SIGNAL (readyRead ()));
80 QTimer::singleShot (0,
82 SIGNAL (finished ()));
91 return Content_.size () - Offset_;
101 if (Offset_ >= Content_.size ())
105 std::memcpy (data, Content_.constData () + Offset_, number);
bool isSequential() const
Reimplemented from QNetworkReply::isSequential().
void SetHeader(QNetworkRequest::KnownHeaders header, const QVariant &value)
Sets the given header to the given value.
qint64 readData(char *, qint64)
void SetContentType(const QByteArray &type)
Sets the content type of this reply.
qint64 bytesAvailable() const
Reimplemented from QNetworkReply::bytesAvailable().
CustomNetworkReply(const QUrl &url, QObject *parent=0)
Creates the reply with the given url and parent.
void SetError(NetworkError error, const QString &reason=QString())
Sets the network error of this reply.
void abort()
Reimplemented from QNetworkReply::abort().
virtual ~CustomNetworkReply()
Virtual destructor.
void SetContent(const QString &string)
Sets content of this reply to the given string.