QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
QgsNetworkAccessManager Class Reference

network access manager for QGIS More...

#include <qgsnetworkaccessmanager.h>

Inheritance diagram for QgsNetworkAccessManager:
Inheritance graph
[legend]

Public Slots

Q_DECL_DEPRECATED void deleteReply (QNetworkReply *reply)
 Abort and delete reply. More...
 
Q_DECL_DEPRECATED void sendGet (const QNetworkRequest &request)
 Send GET request, calls get(). More...
 

Signals

void requestAboutToBeCreated (QNetworkAccessManager::Operation, const QNetworkRequest &, QIODevice *)
 
void requestCreated (QNetworkReply *)
 
void requestSent (QNetworkReply *reply, QObject *sender)
 Emitted when request was sent by request() More...
 
void requestTimedOut (QNetworkReply *)
 

Public Member Functions

 QgsNetworkAccessManager (QObject *parent=nullptr)
 
 ~QgsNetworkAccessManager ()
 destructor More...
 
const QStringListexcludeList () const
 retrieve exclude list (urls shouldn't use the fallback proxy) More...
 
const QNetworkProxyfallbackProxy () const
 retrieve fall back proxy (for urls that no factory returned proxies for) More...
 
void insertProxyFactory (QNetworkProxyFactory *factory)
 insert a factory into the proxy factories list More...
 
const QList< QNetworkProxyFactory * > proxyFactories () const
 retrieve proxy factory list More...
 
void removeProxyFactory (QNetworkProxyFactory *factory)
 remove a factory from the proxy factories list More...
 
void setFallbackProxyAndExcludes (const QNetworkProxy &proxy, const QStringList &excludes)
 set fallback proxy and URL that shouldn't use it. More...
 
void setupDefaultProxyAndCache ()
 Setup the NAM according to the user's settings. More...
 
bool useSystemProxy () const
 return whether the system proxy should be used More...
 
- Public Member Functions inherited from QNetworkAccessManager
 QNetworkAccessManager (QObject *parent)
 
 ~QNetworkAccessManager ()
 
QNetworkConfiguration activeConfiguration () const
 
void authenticationRequired (QNetworkReply *reply, QAuthenticator *authenticator)
 
QAbstractNetworkCachecache () const
 
QNetworkConfiguration configuration () const
 
QNetworkCookieJarcookieJar () const
 
QNetworkReplydeleteResource (const QNetworkRequest &request)
 
void finished (QNetworkReply *reply)
 
QNetworkReplyget (const QNetworkRequest &request)
 
QNetworkReplyhead (const QNetworkRequest &request)
 
NetworkAccessibility networkAccessible () const
 
void networkAccessibleChanged (QNetworkAccessManager::NetworkAccessibility accessible)
 
QNetworkReplypost (const QNetworkRequest &request, QHttpMultiPart *multiPart)
 
QNetworkReplypost (const QNetworkRequest &request, QIODevice *data)
 
QNetworkReplypost (const QNetworkRequest &request, const QByteArray &data)
 
QNetworkProxy proxy () const
 
void proxyAuthenticationRequired (const QNetworkProxy &proxy, QAuthenticator *authenticator)
 
QNetworkProxyFactoryproxyFactory () const
 
QNetworkReplyput (const QNetworkRequest &request, QIODevice *data)
 
QNetworkReplyput (const QNetworkRequest &request, const QByteArray &data)
 
QNetworkReplyput (const QNetworkRequest &request, QHttpMultiPart *multiPart)
 
QNetworkReplysendCustomRequest (const QNetworkRequest &request, const QByteArray &verb, QIODevice *data)
 
void setCache (QAbstractNetworkCache *cache)
 
void setConfiguration (const QNetworkConfiguration &config)
 
void setCookieJar (QNetworkCookieJar *cookieJar)
 
void setNetworkAccessible (NetworkAccessibility accessible)
 
void setProxy (const QNetworkProxy &proxy)
 
void setProxyFactory (QNetworkProxyFactory *factory)
 
void sslErrors (QNetworkReply *reply, const QList< QSslError > &errors)
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
 QObject (QObject *parent, const char *name)
 
virtual ~QObject ()
 
bool blockSignals (bool block)
 
QObjectchild (const char *objName, const char *inheritsClass, bool recursiveSearch) const
 
const QObjectList & children () const
 
const char * className () const
 
bool connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const QObject *receiver, const char *method)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method)
 
void dumpObjectInfo ()
 
void dumpObjectTree ()
 
QList< QByteArraydynamicPropertyNames () const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name) const
 
QList< T > findChildren (const QRegExp &regExp) const
 
QList< T > findChildren (const QString &name) const
 
bool inherits (const char *className) const
 
void insertChild (QObject *object)
 
void installEventFilter (QObject *filterObj)
 
bool isA (const char *className) const
 
bool isWidgetType () const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const
 
void moveToThread (QThread *targetThread)
 
const char * name () const
 
const char * name (const char *defaultName) const
 
QString objectName () const
 
QObjectparent () const
 
QVariant property (const char *name) const
 
void removeChild (QObject *object)
 
void removeEventFilter (QObject *obj)
 
void setName (const char *name)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const
 
int startTimer (int interval)
 
QThreadthread () const
 

Static Public Member Functions

static QNetworkRequest::CacheLoadControl cacheLoadControlFromName (const QString &theName)
 Get QNetworkRequest::CacheLoadControl from name. More...
 
static QString cacheLoadControlName (QNetworkRequest::CacheLoadControl theControl)
 Get name for QNetworkRequest::CacheLoadControl. More...
 
static QgsNetworkAccessManagerinstance ()
 returns a pointer to the single instance More...
 
- Static Public Member Functions inherited from QObject
bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 

Protected Member Functions

virtual QNetworkReplycreateRequest (QNetworkAccessManager::Operation op, const QNetworkRequest &req, QIODevice *outgoingData=nullptr) override
 
- Protected Member Functions inherited from QNetworkAccessManager
virtual QNetworkReplycreateRequest (Operation op, const QNetworkRequest &req, QIODevice *outgoingData)
 
- Protected Member Functions inherited from QObject
bool checkConnectArgs (const char *signal, const QObject *object, const char *method)
 
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const char *signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const char *signal)
 
int receivers (const char *signal) const
 
QObjectsender () const
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *event)
 

Additional Inherited Members

- Static Protected Member Functions inherited from QObject
QByteArray normalizeSignalSlot (const char *signalSlot)
 
- Properties inherited from QNetworkAccessManager
 networkAccessible
 
- Properties inherited from QObject
 objectName
 

Detailed Description

network access manager for QGIS

Since
1.5

This class implements the QGIS network access manager. It's a singleton that can be used across QGIS.

Plugins can insert proxy factories and thereby redirect requests to individual proxies.

If no proxy factories are there or none returns a proxy for an URL a fallback proxy can be set. There's also a exclude list that defines URLs that the fallback proxy should not be used for, then no proxy will be used.

Definition at line 44 of file qgsnetworkaccessmanager.h.

Constructor & Destructor Documentation

◆ QgsNetworkAccessManager()

QgsNetworkAccessManager::QgsNetworkAccessManager ( QObject parent = nullptr)

Definition at line 117 of file qgsnetworkaccessmanager.cpp.

◆ ~QgsNetworkAccessManager()

QgsNetworkAccessManager::~QgsNetworkAccessManager ( )

destructor

Definition at line 125 of file qgsnetworkaccessmanager.cpp.

Member Function Documentation

◆ cacheLoadControlFromName()

QNetworkRequest::CacheLoadControl QgsNetworkAccessManager::cacheLoadControlFromName ( const QString theName)
static

Get QNetworkRequest::CacheLoadControl from name.

Definition at line 267 of file qgsnetworkaccessmanager.cpp.

◆ cacheLoadControlName()

QString QgsNetworkAccessManager::cacheLoadControlName ( QNetworkRequest::CacheLoadControl  theControl)
static

Get name for QNetworkRequest::CacheLoadControl.

Definition at line 249 of file qgsnetworkaccessmanager.cpp.

◆ createRequest()

QNetworkReply * QgsNetworkAccessManager::createRequest ( QNetworkAccessManager::Operation  op,
const QNetworkRequest req,
QIODevice outgoingData = nullptr 
)
overrideprotectedvirtual

Definition at line 173 of file qgsnetworkaccessmanager.cpp.

◆ deleteReply

void QgsNetworkAccessManager::deleteReply ( QNetworkReply reply)
slot

Abort and delete reply.

Parameters
replyreply to be aborted.
Deprecated:
use abort() and deleteLayer() on the reply directly

Definition at line 397 of file qgsnetworkaccessmanager.cpp.

◆ excludeList()

const QStringList & QgsNetworkAccessManager::excludeList ( ) const

retrieve exclude list (urls shouldn't use the fallback proxy)

Definition at line 144 of file qgsnetworkaccessmanager.cpp.

◆ fallbackProxy()

const QNetworkProxy & QgsNetworkAccessManager::fallbackProxy ( ) const

retrieve fall back proxy (for urls that no factory returned proxies for)

Definition at line 149 of file qgsnetworkaccessmanager.cpp.

◆ insertProxyFactory()

void QgsNetworkAccessManager::insertProxyFactory ( QNetworkProxyFactory factory)

insert a factory into the proxy factories list

Definition at line 129 of file qgsnetworkaccessmanager.cpp.

◆ instance()

QgsNetworkAccessManager * QgsNetworkAccessManager::instance ( )
static

returns a pointer to the single instance

Definition at line 103 of file qgsnetworkaccessmanager.cpp.

◆ proxyFactories()

const QList< QNetworkProxyFactory * > QgsNetworkAccessManager::proxyFactories ( ) const

retrieve proxy factory list

Definition at line 139 of file qgsnetworkaccessmanager.cpp.

◆ removeProxyFactory()

void QgsNetworkAccessManager::removeProxyFactory ( QNetworkProxyFactory factory)

remove a factory from the proxy factories list

Definition at line 134 of file qgsnetworkaccessmanager.cpp.

◆ requestAboutToBeCreated

void QgsNetworkAccessManager::requestAboutToBeCreated ( QNetworkAccessManager::Operation  ,
const QNetworkRequest ,
QIODevice  
)
signal

◆ requestCreated

void QgsNetworkAccessManager::requestCreated ( QNetworkReply )
signal

◆ requestSent

void QgsNetworkAccessManager::requestSent ( QNetworkReply reply,
QObject sender 
)
signal

Emitted when request was sent by request()

Parameters
replyrequest reply
senderthe object which called request() slot.
Deprecated:
only emitted from deprecated sendGet

◆ requestTimedOut

void QgsNetworkAccessManager::requestTimedOut ( QNetworkReply )
signal

◆ sendGet

void QgsNetworkAccessManager::sendGet ( const QNetworkRequest request)
slot

Send GET request, calls get().

Emits requestSent().

Parameters
requestrequest to be sent
Deprecated:
use get() directly

Definition at line 391 of file qgsnetworkaccessmanager.cpp.

◆ setFallbackProxyAndExcludes()

void QgsNetworkAccessManager::setFallbackProxyAndExcludes ( const QNetworkProxy proxy,
const QStringList excludes 
)

set fallback proxy and URL that shouldn't use it.

Definition at line 154 of file qgsnetworkaccessmanager.cpp.

◆ setupDefaultProxyAndCache()

void QgsNetworkAccessManager::setupDefaultProxyAndCache ( )

Setup the NAM according to the user's settings.

Definition at line 288 of file qgsnetworkaccessmanager.cpp.

◆ useSystemProxy()

bool QgsNetworkAccessManager::useSystemProxy ( ) const
inline

return whether the system proxy should be used

Definition at line 86 of file qgsnetworkaccessmanager.h.


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