8#include <QNetworkProxy>
9#include <QNetworkAccessManager>
15, m_networkManager(
new QNetworkAccessManager(
this))
24 configure(parameters);
29 QString proxy = parameters.value(QStringLiteral(
"here.proxy")).toString();
30 if (proxy.isEmpty() && !m_customProxyToken.isEmpty())
31 proxy = parameters.value(m_customProxyToken).toString();
33 if (!proxy.isEmpty()) {
34#ifndef QT_NO_NETWORKPROXY
35 if (proxy.toLower() != QStringLiteral(
"system")) {
37 if (proxyUrl.isValid()) {
38 qDebug() <<
"Setting proxy to " << proxyUrl.toString();
39 m_networkManager->setProxy(
40 QNetworkProxy(QNetworkProxy::HttpProxy,
44 proxyUrl.password()));
46 }
else if (QNetworkProxy::applicationProxy().type() == QNetworkProxy::NoProxy) {
47 QNetworkProxyFactory::setUseSystemConfiguration(
true);
48 qDebug() <<
"Setting system proxy.";
51 qDebug() <<
"No proxy support";
54 qDebug() <<
"No proxy parameter specified.";
60 return m_networkManager->get(request);
65 return m_networkManager->post(request, data);
QNetworkReply * post(const QNetworkRequest &request, const QByteArray &data) override
QNetworkReply * get(const QNetworkRequest &request) override
QGeoIntrinsicNetworkAccessManager(const QVariantMap ¶meters, const QString &token=QString(), QObject *parent=nullptr)
Combined button and popup list for selecting options.