QGIS API Documentation
2.18.21-Las Palmas (9fba24a)
|
network access manager for QGIS More...
#include <qgsnetworkaccessmanager.h>
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 QStringList & | excludeList () const |
retrieve exclude list (urls shouldn't use the fallback proxy) More... | |
const QNetworkProxy & | fallbackProxy () 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... | |
![]() | |
QNetworkAccessManager (QObject *parent) | |
~QNetworkAccessManager () | |
QNetworkConfiguration | activeConfiguration () const |
void | authenticationRequired (QNetworkReply *reply, QAuthenticator *authenticator) |
QAbstractNetworkCache * | cache () const |
QNetworkConfiguration | configuration () const |
QNetworkCookieJar * | cookieJar () const |
QNetworkReply * | deleteResource (const QNetworkRequest &request) |
void | finished (QNetworkReply *reply) |
QNetworkReply * | get (const QNetworkRequest &request) |
QNetworkReply * | head (const QNetworkRequest &request) |
NetworkAccessibility | networkAccessible () const |
void | networkAccessibleChanged (QNetworkAccessManager::NetworkAccessibility accessible) |
QNetworkReply * | post (const QNetworkRequest &request, QHttpMultiPart *multiPart) |
QNetworkReply * | post (const QNetworkRequest &request, QIODevice *data) |
QNetworkReply * | post (const QNetworkRequest &request, const QByteArray &data) |
QNetworkProxy | proxy () const |
void | proxyAuthenticationRequired (const QNetworkProxy &proxy, QAuthenticator *authenticator) |
QNetworkProxyFactory * | proxyFactory () const |
QNetworkReply * | put (const QNetworkRequest &request, QIODevice *data) |
QNetworkReply * | put (const QNetworkRequest &request, const QByteArray &data) |
QNetworkReply * | put (const QNetworkRequest &request, QHttpMultiPart *multiPart) |
QNetworkReply * | sendCustomRequest (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) |
![]() | |
QObject (QObject *parent) | |
QObject (QObject *parent, const char *name) | |
virtual | ~QObject () |
bool | blockSignals (bool block) |
QObject * | child (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< QByteArray > | dynamicPropertyNames () const |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
T | findChild (const QString &name) const |
QList< T > | findChildren (const QRegExp ®Exp) 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 QMetaObject * | metaObject () const |
void | moveToThread (QThread *targetThread) |
const char * | name () const |
const char * | name (const char *defaultName) const |
QString | objectName () const |
QObject * | parent () 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) |
QThread * | thread () 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 QgsNetworkAccessManager * | instance () |
returns a pointer to the single instance More... | |
![]() | |
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 QNetworkReply * | createRequest (QNetworkAccessManager::Operation op, const QNetworkRequest &req, QIODevice *outgoingData=nullptr) override |
![]() | |
virtual QNetworkReply * | createRequest (Operation op, const QNetworkRequest &req, QIODevice *outgoingData) |
![]() | |
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 |
QObject * | sender () const |
int | senderSignalIndex () const |
virtual void | timerEvent (QTimerEvent *event) |
Additional Inherited Members | |
![]() | |
QByteArray | normalizeSignalSlot (const char *signalSlot) |
![]() | |
networkAccessible | |
![]() | |
objectName | |
network access manager for QGIS
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.
QgsNetworkAccessManager::QgsNetworkAccessManager | ( | QObject * | parent = nullptr | ) |
Definition at line 117 of file qgsnetworkaccessmanager.cpp.
QgsNetworkAccessManager::~QgsNetworkAccessManager | ( | ) |
destructor
Definition at line 125 of file qgsnetworkaccessmanager.cpp.
|
static |
Get QNetworkRequest::CacheLoadControl from name.
Definition at line 267 of file qgsnetworkaccessmanager.cpp.
|
static |
Get name for QNetworkRequest::CacheLoadControl.
Definition at line 249 of file qgsnetworkaccessmanager.cpp.
|
overrideprotectedvirtual |
Definition at line 173 of file qgsnetworkaccessmanager.cpp.
|
slot |
Abort and delete reply.
reply | reply to be aborted. |
Definition at line 397 of file qgsnetworkaccessmanager.cpp.
const QStringList & QgsNetworkAccessManager::excludeList | ( | ) | const |
retrieve exclude list (urls shouldn't use the fallback proxy)
Definition at line 144 of file qgsnetworkaccessmanager.cpp.
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.
void QgsNetworkAccessManager::insertProxyFactory | ( | QNetworkProxyFactory * | factory | ) |
insert a factory into the proxy factories list
Definition at line 129 of file qgsnetworkaccessmanager.cpp.
|
static |
returns a pointer to the single instance
Definition at line 103 of file qgsnetworkaccessmanager.cpp.
const QList< QNetworkProxyFactory * > QgsNetworkAccessManager::proxyFactories | ( | ) | const |
retrieve proxy factory list
Definition at line 139 of file qgsnetworkaccessmanager.cpp.
void QgsNetworkAccessManager::removeProxyFactory | ( | QNetworkProxyFactory * | factory | ) |
remove a factory from the proxy factories list
Definition at line 134 of file qgsnetworkaccessmanager.cpp.
|
signal |
|
signal |
|
signal |
Emitted when request was sent by request()
reply | request reply |
sender | the object which called request() slot. |
|
signal |
|
slot |
Send GET request, calls get().
Emits requestSent().
request | request to be sent |
Definition at line 391 of file qgsnetworkaccessmanager.cpp.
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.
void QgsNetworkAccessManager::setupDefaultProxyAndCache | ( | ) |
Setup the NAM according to the user's settings.
Definition at line 288 of file qgsnetworkaccessmanager.cpp.
|
inline |
return whether the system proxy should be used
Definition at line 86 of file qgsnetworkaccessmanager.h.