Logo Search packages:      
Sourcecode: qt4-x11 version File versions

QNetworkReply Class Reference

Inheritance diagram for QNetworkReply:

QIODevice QObject QPatternist::QIODeviceDelegate

List of all members.

Detailed Description

The QNetworkReply class contains the data and headers for a request posted with QNetworkAccessManager.

4.4 QtNetwork
The QNetworkReply class contains the data and meta data related to a request posted with QNetworkAccessManager. Like QNetworkRequest, it contains a URL and headers (both in parsed and raw form), some information about the reply's state and the contents of the reply itself.

QNetworkReply is a sequential-access QIODevice, which means that once data is read from the object, it no longer kept by the device. It is therefore the application's responsibility to keep this data if it needs to. Whenever more data is received from the network and processed, the readyRead() signal is emitted.

The downloadProgress() signal is also emitted when data is received, but the number of bytes contained in it may not represent the actual bytes received, if any transformation is done to the contents (for example, decompressing and removing the protocol overhead).

Even though QNetworkReply is a QIODevice connected to the contents of the reply, it also emits the uploadProgress() signal, which indicates the progress of the upload for operations that have such content.

See also:
QNetworkRequest, QNetworkAccessManager

Definition at line 60 of file qnetworkreply.h.

Public Types

enum  NetworkError {
  NoError = 0, ConnectionRefusedError = 1, RemoteHostClosedError, HostNotFoundError,
  TimeoutError, OperationCanceledError, SslHandshakeFailedError, UnknownNetworkError = 99,
  ProxyConnectionRefusedError = 101, ProxyConnectionClosedError, ProxyNotFoundError, ProxyTimeoutError,
  ProxyAuthenticationRequiredError, UnknownProxyError = 199, ContentAccessDenied = 201, ContentOperationNotPermittedError,
  ContentNotFoundError, AuthenticationRequiredError, UnknownContentError = 299, ProtocolUnknownError = 301,
  ProtocolInvalidOperationError, ProtocolFailure = 399
enum  OpenModeFlag {
  NotOpen = 0x0000, ReadOnly = 0x0001, WriteOnly = 0x0002, ReadWrite = ReadOnly | WriteOnly,
  Append = 0x0004, Truncate = 0x0008, Text = 0x0010, Unbuffered = 0x0020

Public Slots

void deleteLater ()
virtual void ignoreSslErrors ()


void aboutToClose ()
void bytesWritten (qint64 bytes)
void destroyed (QObject *=0)
void downloadProgress (qint64 bytesReceived, qint64 bytesTotal)
void error (QNetworkReply::NetworkError)
void finished ()
void metaDataChanged ()
void readChannelFinished ()
void readyRead ()
void sslErrors (const QList< QSslError > &errors)
void uploadProgress (qint64 bytesSent, qint64 bytesTotal)

Public Member Functions

virtual void abort ()=0
virtual bool atEnd () const
QVariant attribute (QNetworkRequest::Attribute code) const
bool blockSignals (bool b)
virtual qint64 bytesAvailable () const
virtual qint64 bytesToWrite () const
virtual bool canReadLine () const
const QObjectListchildren () const
virtual void close ()
bool connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const
bool disconnect (const QObject *receiver, const char *member=0)
bool disconnect (const char *signal=0, const QObject *receiver=0, const char *member=0)
void dumpObjectInfo ()
void dumpObjectTree ()
QList< QByteArraydynamicPropertyNames () const
NetworkError error () const
QString errorString () const
virtual bool event (QEvent *)
virtual bool eventFilter (QObject *, QEvent *)
template<typename T>
findChild (const QString &aName=QString()) const
template<typename T>
QList< T > findChildren (const QRegExp &re) const
template<typename T>
QList< T > findChildren (const QString &aName=QString()) const
bool getChar (char *c)
bool hasRawHeader (const QByteArray &headerName) const
QVariant header (QNetworkRequest::KnownHeaders header) const
bool inherits (const char *classname) const
void installEventFilter (QObject *)
bool isOpen () const
bool isReadable () const
virtual bool isSequential () const
bool isTextModeEnabled () const
bool isWidgetType () const
bool isWritable () const
void killTimer (int id)
QNetworkAccessManagermanager () const
void moveToThread (QThread *thread)
QString objectName () const
virtual bool open (OpenMode mode)
OpenMode openMode () const
QNetworkAccessManager::Operation operation () const
QObjectparent () const
QByteArray peek (qint64 maxlen)
qint64 peek (char *data, qint64 maxlen)
virtual qint64 pos () const
QVariant property (const char *name) const
bool putChar (char c)
QByteArray rawHeader (const QByteArray &headerName) const
QList< QByteArrayrawHeaderList () const
QByteArray read (qint64 maxlen)
qint64 read (char *data, qint64 maxlen)
QByteArray readAll ()
qint64 readBufferSize () const
QByteArray readLine (qint64 maxlen=0)
qint64 readLine (char *data, qint64 maxlen)
void removeEventFilter (QObject *)
QNetworkRequest request () const
virtual bool reset ()
virtual bool seek (qint64 pos)
void setObjectName (const QString &name)
void setParent (QObject *)
bool setProperty (const char *name, const QVariant &value)
virtual void setReadBufferSize (qint64 size)
void setSslConfiguration (const QSslConfiguration &configuration)
void setTextModeEnabled (bool enabled)
void setUserData (uint id, QObjectUserData *data)
bool signalsBlocked () const
virtual qint64 size () const
QSslConfiguration sslConfiguration () const
int startTimer (int interval)
QThreadthread () const
void ungetChar (char c)
QUrl url () const
QObjectUserData * userData (uint id) const
virtual bool waitForBytesWritten (int msecs)
virtual bool waitForReadyRead (int msecs)
qint64 write (const QByteArray &data)
qint64 write (const char *data)
qint64 write (const char *data, qint64 len)
 ~QNetworkReply ()

Static Public Member Functions

static bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
static bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
static uint registerUserData ()

Protected Member Functions

virtual void childEvent (QChildEvent *)
virtual void connectNotify (const char *signal)
virtual void customEvent (QEvent *)
virtual void disconnectNotify (const char *signal)
 QNetworkReply (QNetworkReplyPrivate &dd, QObject *parent)
 QNetworkReply (QObject *parent=0)
virtual qint64 readData (char *data, qint64 maxlen)=0
virtual qint64 readLineData (char *data, qint64 maxlen)
int receivers (const char *signal) const
QObjectsender () const
void setAttribute (QNetworkRequest::Attribute code, const QVariant &value)
void setError (NetworkError errorCode, const QString &errorString)
void setErrorString (const QString &errorString)
void setHeader (QNetworkRequest::KnownHeaders header, const QVariant &value)
void setOpenMode (OpenMode openMode)
void setOperation (QNetworkAccessManager::Operation operation)
void setRawHeader (const QByteArray &headerName, const QByteArray &value)
void setRequest (const QNetworkRequest &request)
void setUrl (const QUrl &url)
virtual void timerEvent (QTimerEvent *)
virtual qint64 writeData (const char *data, qint64 len)

Protected Attributes

QObjectData * d_ptr

Static Protected Attributes

static const QMetaObject staticQtMetaObject


QString objectName
 the name of this object


class QApplication
class QApplicationPrivate
class QCoreApplication
class QCoreApplicationPrivate
struct QMetaObject
class QThreadData
class QWidget

Related Functions

(Note that these are not member functions.)

qFindChild (const QObject *obj, const QString &name)
qFindChildqFindChildren (const QObject *obj, const QString &name=QString(), T dummy=0)()
QList< T > qFindChildren (const QObject *obj, const QString &name)
QList< T > qFindChildrenqFindChildren (const QObject *obj, const QString &name=QString(), T dummy=0)()
QList< T > qFindChildrenqFindChildren (const QObject *obj, const QRegExp &regExp)()
T * qobject_cast (QObject *object)
void * qt_find_obj_child (QObject *parent, const char *type, const QString &name)

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index