Qt 4.8
Public Types | Public Functions | Properties | List of all members
QNetworkProxyQuery Class Reference

The QNetworkProxyQuery class is used to query the proxy settings for a socket. More...

#include <qnetworkproxy.h>

Public Types

enum  QueryType { TcpSocket, UdpSocket, TcpServer = 100, UrlRequest }
 Describes the type of one QNetworkProxyQuery query. More...
 

Public Functions

int localPort () const
 Returns the port number of the socket that will accept incoming packets from remote servers or -1 if the port is not known. More...
 
QNetworkConfiguration networkConfiguration () const
 Returns the network configuration of the proxy query. More...
 
bool operator!= (const QNetworkProxyQuery &other) const
 Returns true if this QNetworkProxyQuery object does not contain the same data as other. More...
 
QNetworkProxyQueryoperator= (const QNetworkProxyQuery &other)
 Copies the contents of other. More...
 
bool operator== (const QNetworkProxyQuery &other) const
 Returns true if this QNetworkProxyQuery object contains the same data as other. More...
 
QString peerHostName () const
 Returns the host name or IP address being of the outgoing connection being requested, or an empty string if the remote hostname is not known. More...
 
int peerPort () const
 Returns the port number for the outgoing request or -1 if the port number is not known. More...
 
QString protocolTag () const
 Returns the protocol tag for this QNetworkProxyQuery object, or an empty QString in case the protocol tag is unknown. More...
 
 QNetworkProxyQuery ()
 Constructs a default QNetworkProxyQuery object. More...
 
 QNetworkProxyQuery (const QUrl &requestUrl, QueryType queryType=UrlRequest)
 Constructs a QNetworkProxyQuery with the URL requestUrl and sets the query type to queryType. More...
 
 QNetworkProxyQuery (const QString &hostname, int port, const QString &protocolTag=QString(), QueryType queryType=TcpSocket)
 Constructs a QNetworkProxyQuery of type queryType and sets the protocol tag to be protocolTag. More...
 
 QNetworkProxyQuery (quint16 bindPort, const QString &protocolTag=QString(), QueryType queryType=TcpServer)
 Constructs a QNetworkProxyQuery of type queryType and sets the protocol tag to be protocolTag. More...
 
 QNetworkProxyQuery (const QNetworkProxyQuery &other)
 Constructs a QNetworkProxyQuery object that is a copy of other. More...
 
 QNetworkProxyQuery (const QNetworkConfiguration &networkConfiguration, const QUrl &requestUrl, QueryType queryType=UrlRequest)
 Constructs a QNetworkProxyQuery with the URL requestUrl and sets the query type to queryType. More...
 
 QNetworkProxyQuery (const QNetworkConfiguration &networkConfiguration, const QString &hostname, int port, const QString &protocolTag=QString(), QueryType queryType=TcpSocket)
 Constructs a QNetworkProxyQuery of type queryType and sets the protocol tag to be protocolTag. More...
 
 QNetworkProxyQuery (const QNetworkConfiguration &networkConfiguration, quint16 bindPort, const QString &protocolTag=QString(), QueryType queryType=TcpServer)
 Constructs a QNetworkProxyQuery of type queryType and sets the protocol tag to be protocolTag. More...
 
QueryType queryType () const
 Returns the query type. More...
 
void setLocalPort (int port)
 Sets the port number that the socket wishes to use locally to accept incoming packets from remote servers to port. More...
 
void setNetworkConfiguration (const QNetworkConfiguration &networkConfiguration)
 Sets the network configuration component of this QNetworkProxyQuery object to be networkConfiguration. More...
 
void setPeerHostName (const QString &hostname)
 Sets the hostname of the outgoing connection being requested to hostname. More...
 
void setPeerPort (int port)
 Sets the requested port number for the outgoing connection to be port. More...
 
void setProtocolTag (const QString &protocolTag)
 Sets the protocol tag for this QNetworkProxyQuery object to be protocolTag. More...
 
void setQueryType (QueryType type)
 Sets the query type of this object to be type. More...
 
void setUrl (const QUrl &url)
 Sets the URL component of this QNetworkProxyQuery object to be url. More...
 
QUrl url () const
 Returns the URL component of this QNetworkProxyQuery object in case of a query of type QNetworkProxyQuery::UrlRequest. More...
 
 ~QNetworkProxyQuery ()
 Destroys this QNetworkProxyQuery object. More...
 

Properties

QSharedDataPointer< QNetworkProxyQueryPrivated
 

Detailed Description

The QNetworkProxyQuery class is used to query the proxy settings for a socket.

Since
4.5
Attention
Module: QtNetwork

QNetworkProxyQuery holds the details of a socket being created or request being made. It is used by QNetworkProxy and QNetworkProxyFactory to allow applications to have a more fine-grained control over which proxy servers are used, depending on the details of the query. This allows an application to apply different settings, according to the protocol or destination hostname, for instance.

QNetworkProxyQuery supports the following criteria for selecting the proxy:

The destination host name is the host in the connection in the case of outgoing connection sockets. It is the hostName parameter passed to QTcpSocket::connectToHost() or the host component of a URL requested with QNetworkRequest.

The destination port number is the requested port to connect to in the case of outgoing sockets, while the local port number is the port the socket wishes to use locally before attempting the external connection. In most cases, the local port number is used by listening sockets only (QTcpSocket) or by datagram sockets (QUdpSocket).

The protocol name is an arbitrary string that indicates the type of connection being attempted. For example, it can match the scheme of a URL, like "http", "https" and "ftp". In most cases, the proxy selection will not change depending on the protocol, but this information is provided in case a better choice can be made, like choosing an caching HTTP proxy for HTTP-based connections, but a more powerful SOCKSv5 proxy for all others.

The network configuration specifies which configuration to use, when bearer management is used. For example on a mobile phone the proxy settings are likely to be different for the cellular network vs WLAN.

Some of the criteria may not make sense in all of the types of query. The following table lists the criteria that are most commonly used, according to the type of query.

Query type

Description

TcpSocket

Normal sockets requesting a connection to a remote server, like QTcpSocket. The peer hostname and peer port match the values passed to QTcpSocket::connectToHost(). The local port is usually -1, indicating the socket has no preference in which port should be used. The URL component is not used.

UdpSocket

Datagram-based sockets, which can both send and receive. The local port, remote host or remote port fields can all be used or be left unused, depending on the characteristics of the socket. The URL component is not used.

TcpServer

Passive server sockets that listen on a port and await incoming connections from the network. Normally, only the local port is used, but the remote address could be used in specific circumstances, for example to indicate which remote host a connection is expected from. The URL component is not used.

UrlRequest A more high-level request, such as those coming from QNetworkAccessManager. These requests will inevitably use an outgoing TCP socket, but the this query type is provided to indicate that more detailed information is present in the URL component. For ease of implementation, the URL's host and port are set as the destination address.

It should be noted that any of the criteria may be missing or unknown (an empty QString for the hostname or protocol name, -1 for the port numbers). If that happens, the functions executing the query should make their best guess or apply some implementation-defined default values.

See also
QNetworkProxy, QNetworkProxyFactory, QNetworkAccessManager, QAbstractSocket::setProxy()

Definition at line 60 of file qnetworkproxy.h.

Enumerations

◆ QueryType

Describes the type of one QNetworkProxyQuery query.

  • TcpSocket a normal, outgoing TCP socket
  • UdpSocket a datagram-based UDP socket, which could send to multiple destinations
  • TcpServer a TCP server that listens for incoming connections from the network
  • UrlRequest a more complex request which involves loading of a URL
See also
queryType(), setQueryType()
Enumerator
TcpSocket 
UdpSocket 
TcpServer 
UrlRequest 

Definition at line 63 of file qnetworkproxy.h.

Constructors and Destructors

◆ QNetworkProxyQuery() [1/8]

QNetworkProxyQuery::QNetworkProxyQuery ( )

Constructs a default QNetworkProxyQuery object.

By default, the query type will be QNetworkProxyQuery::TcpSocket.

Definition at line 907 of file qnetworkproxy.cpp.

908 {
909 }

◆ QNetworkProxyQuery() [2/8]

QNetworkProxyQuery::QNetworkProxyQuery ( const QUrl requestUrl,
QueryType  queryType = UrlRequest 
)

Constructs a QNetworkProxyQuery with the URL requestUrl and sets the query type to queryType.

See also
protocolTag(), peerHostName(), peerPort()

Definition at line 917 of file qnetworkproxy.cpp.

918 {
919  d->remote = requestUrl;
920  d->type = queryType;
921 }
QueryType queryType() const
Returns the query type.
QSharedDataPointer< QNetworkProxyQueryPrivate > d
QNetworkProxyQuery::QueryType type

◆ QNetworkProxyQuery() [3/8]

QNetworkProxyQuery::QNetworkProxyQuery ( const QString hostname,
int  port,
const QString protocolTag = QString(),
QueryType  queryType = TcpSocket 
)

Constructs a QNetworkProxyQuery of type queryType and sets the protocol tag to be protocolTag.

This constructor is suitable for QNetworkProxyQuery::TcpSocket queries, because it sets the peer hostname to hostname and the peer's port number to port.

Definition at line 930 of file qnetworkproxy.cpp.

933 {
934  d->remote.setScheme(protocolTag);
935  d->remote.setHost(hostname);
936  d->remote.setPort(port);
937  d->type = queryType;
938 }
void setHost(const QString &host)
Sets the host of the URL to host.
Definition: qurl.cpp:4821
QueryType queryType() const
Returns the query type.
QSharedDataPointer< QNetworkProxyQueryPrivate > d
void setPort(int port)
Sets the port of the URL to port.
Definition: qurl.cpp:4897
void setScheme(const QString &scheme)
Sets the scheme of the URL to scheme.
Definition: qurl.cpp:4533
QNetworkProxyQuery::QueryType type

◆ QNetworkProxyQuery() [4/8]

QNetworkProxyQuery::QNetworkProxyQuery ( quint16  bindPort,
const QString protocolTag = QString(),
QueryType  queryType = TcpServer 
)

Constructs a QNetworkProxyQuery of type queryType and sets the protocol tag to be protocolTag.

This constructor is suitable for QNetworkProxyQuery::TcpSocket queries because it sets the local port number to bindPort.

Note that bindPort is of type quint16 to indicate the exact port number that is requested. The value of -1 (unknown) is not allowed in this context.

See also
localPort()

Definition at line 952 of file qnetworkproxy.cpp.

954 {
955  d->remote.setScheme(protocolTag);
956  d->localPort = bindPort;
957  d->type = queryType;
958 }
QueryType queryType() const
Returns the query type.
QSharedDataPointer< QNetworkProxyQueryPrivate > d
void setScheme(const QString &scheme)
Sets the scheme of the URL to scheme.
Definition: qurl.cpp:4533
QNetworkProxyQuery::QueryType type

◆ QNetworkProxyQuery() [5/8]

QNetworkProxyQuery::QNetworkProxyQuery ( const QNetworkProxyQuery other)

Constructs a QNetworkProxyQuery object that is a copy of other.

Definition at line 1040 of file qnetworkproxy.cpp.

1041  : d(other.d)
1042 {
1043 }
QSharedDataPointer< QNetworkProxyQueryPrivate > d

◆ QNetworkProxyQuery() [6/8]

QNetworkProxyQuery::QNetworkProxyQuery ( const QNetworkConfiguration networkConfiguration,
const QUrl requestUrl,
QueryType  queryType = UrlRequest 
)

Constructs a QNetworkProxyQuery with the URL requestUrl and sets the query type to queryType.

Since
4.8

The specified networkConfiguration is used to resolve the proxy settings.

See also
protocolTag(), peerHostName(), peerPort(), networkConfiguration()

Definition at line 973 of file qnetworkproxy.cpp.

975 {
977  d->remote = requestUrl;
978  d->type = queryType;
979 }
QueryType queryType() const
Returns the query type.
QSharedDataPointer< QNetworkProxyQueryPrivate > d
QNetworkConfiguration networkConfiguration() const
Returns the network configuration of the proxy query.
QNetworkProxyQuery::QueryType type
QNetworkConfiguration config

◆ QNetworkProxyQuery() [7/8]

QNetworkProxyQuery::QNetworkProxyQuery ( const QNetworkConfiguration networkConfiguration,
const QString hostname,
int  port,
const QString protocolTag = QString(),
QueryType  queryType = TcpSocket 
)

Constructs a QNetworkProxyQuery of type queryType and sets the protocol tag to be protocolTag.

Since
4.8

This constructor is suitable for QNetworkProxyQuery::TcpSocket queries, because it sets the peer hostname to hostname and the peer's port number to port. The specified networkConfiguration is used to resolve the proxy settings.

See also
networkConfiguration()

Definition at line 996 of file qnetworkproxy.cpp.

1000 {
1002  d->remote.setScheme(protocolTag);
1003  d->remote.setHost(hostname);
1004  d->remote.setPort(port);
1005  d->type = queryType;
1006 }
void setHost(const QString &host)
Sets the host of the URL to host.
Definition: qurl.cpp:4821
QueryType queryType() const
Returns the query type.
QSharedDataPointer< QNetworkProxyQueryPrivate > d
QNetworkConfiguration networkConfiguration() const
Returns the network configuration of the proxy query.
void setPort(int port)
Sets the port of the URL to port.
Definition: qurl.cpp:4897
void setScheme(const QString &scheme)
Sets the scheme of the URL to scheme.
Definition: qurl.cpp:4533
QNetworkProxyQuery::QueryType type
QNetworkConfiguration config

◆ QNetworkProxyQuery() [8/8]

QNetworkProxyQuery::QNetworkProxyQuery ( const QNetworkConfiguration networkConfiguration,
quint16  bindPort,
const QString protocolTag = QString(),
QueryType  queryType = TcpServer 
)

Constructs a QNetworkProxyQuery of type queryType and sets the protocol tag to be protocolTag.

Since
4.8

This constructor is suitable for QNetworkProxyQuery::TcpSocket queries because it sets the local port number to bindPort. The specified networkConfiguration is used to resolve the proxy settings.

Note that bindPort is of type quint16 to indicate the exact port number that is requested. The value of -1 (unknown) is not allowed in this context.

See also
localPort(), networkConfiguration()

Definition at line 1026 of file qnetworkproxy.cpp.

1029 {
1031  d->remote.setScheme(protocolTag);
1032  d->localPort = bindPort;
1033  d->type = queryType;
1034 }
QueryType queryType() const
Returns the query type.
QSharedDataPointer< QNetworkProxyQueryPrivate > d
QNetworkConfiguration networkConfiguration() const
Returns the network configuration of the proxy query.
void setScheme(const QString &scheme)
Sets the scheme of the URL to scheme.
Definition: qurl.cpp:4533
QNetworkProxyQuery::QueryType type
QNetworkConfiguration config

◆ ~QNetworkProxyQuery()

QNetworkProxyQuery::~QNetworkProxyQuery ( )

Destroys this QNetworkProxyQuery object.

Definition at line 1048 of file qnetworkproxy.cpp.

1049 {
1050  // QSharedDataPointer automatically deletes
1051 }

Functions

◆ localPort()

int QNetworkProxyQuery::localPort ( ) const

Returns the port number of the socket that will accept incoming packets from remote servers or -1 if the port is not known.

See also
peerPort(), peerHostName(), setLocalPort()

Definition at line 1167 of file qnetworkproxy.cpp.

1168 {
1169  return d ? d->localPort : -1;
1170 }
QSharedDataPointer< QNetworkProxyQueryPrivate > d

◆ networkConfiguration()

QNetworkConfiguration QNetworkProxyQuery::networkConfiguration ( ) const

Returns the network configuration of the proxy query.

See also
setNetworkConfiguration()

Definition at line 1260 of file qnetworkproxy.cpp.

Referenced by setNetworkConfiguration(), and QNetworkProxyFactory::systemProxyForQuery().

1261 {
1262  return d ? d->config : QNetworkConfiguration();
1263 }
The QNetworkConfiguration class provides an abstraction of one or more access point configurations...
QSharedDataPointer< QNetworkProxyQueryPrivate > d
QNetworkConfiguration config

◆ operator!=()

bool QNetworkProxyQuery::operator!= ( const QNetworkProxyQuery other) const
inline

Returns true if this QNetworkProxyQuery object does not contain the same data as other.

Definition at line 90 of file qnetworkproxy.h.

91  { return !(*this == other); }

◆ operator=()

QNetworkProxyQuery & QNetworkProxyQuery::operator= ( const QNetworkProxyQuery other)

Copies the contents of other.

Definition at line 1056 of file qnetworkproxy.cpp.

1057 {
1058  d = other.d;
1059  return *this;
1060 }
QSharedDataPointer< QNetworkProxyQueryPrivate > d

◆ operator==()

bool QNetworkProxyQuery::operator== ( const QNetworkProxyQuery other) const

Returns true if this QNetworkProxyQuery object contains the same data as other.

Definition at line 1066 of file qnetworkproxy.cpp.

1067 {
1068  return d == other.d || (d && other.d && *d == *other.d);
1069 }
QSharedDataPointer< QNetworkProxyQueryPrivate > d

◆ peerHostName()

QString QNetworkProxyQuery::peerHostName ( ) const

Returns the host name or IP address being of the outgoing connection being requested, or an empty string if the remote hostname is not known.

If the query type is QNetworkProxyQuery::UrlRequest, this function returns the host component of the URL being requested.

See also
peerPort(), localPort(), setPeerHostName()

Definition at line 1139 of file qnetworkproxy.cpp.

Referenced by Maemo::ProxyConfPrivate::flush(), QWindowsSystemProxy::init(), macQueryInternal(), and QNetworkProxyFactory::systemProxyForQuery().

1140 {
1141  return d ? d->remote.host() : QString();
1142 }
The QString class provides a Unicode character string.
Definition: qstring.h:83
QString host() const
Returns the host of the URL if it is defined; otherwise an empty string is returned.
Definition: qurl.cpp:4837
QSharedDataPointer< QNetworkProxyQueryPrivate > d

◆ peerPort()

int QNetworkProxyQuery::peerPort ( ) const

Returns the port number for the outgoing request or -1 if the port number is not known.

If the query type is QNetworkProxyQuery::UrlRequest, this function returns the port number of the URL being requested. In general, frameworks will fill in the port number from their default values.

See also
peerHostName(), localPort(), setPeerPort()

Definition at line 1107 of file qnetworkproxy.cpp.

Referenced by QNetworkProxyFactory::systemProxyForQuery().

1108 {
1109  return d ? d->remote.port() : -1;
1110 }
int port() const
Returns the port of the URL, or -1 if the port is unspecified.
Definition: qurl.cpp:4916
QSharedDataPointer< QNetworkProxyQueryPrivate > d

◆ protocolTag()

QString QNetworkProxyQuery::protocolTag ( ) const

Returns the protocol tag for this QNetworkProxyQuery object, or an empty QString in case the protocol tag is unknown.

In the case of queries of type QNetworkProxyQuery::UrlRequest, this function returns the value of the scheme component of the URL.

See also
setProtocolTag(), url()

Definition at line 1205 of file qnetworkproxy.cpp.

Referenced by Maemo::ProxyConfPrivate::flush(), macQueryInternal(), parseServerList(), and QNetworkProxyFactory::systemProxyForQuery().

1206 {
1207  return d ? d->remote.scheme() : QString();
1208 }
The QString class provides a Unicode character string.
Definition: qstring.h:83
QSharedDataPointer< QNetworkProxyQueryPrivate > d
QString scheme() const
Returns the scheme of the URL.
Definition: qurl.cpp:4550

◆ queryType()

QNetworkProxyQuery::QueryType QNetworkProxyQuery::queryType ( ) const

Returns the query type.

Definition at line 1084 of file qnetworkproxy.cpp.

Referenced by filterProxyListByCapabilities(), QWindowsSystemProxy::init(), parseServerList(), and QNetworkProxyFactory::systemProxyForQuery().

1085 {
1086  return d ? d->type : TcpSocket;
1087 }
QSharedDataPointer< QNetworkProxyQueryPrivate > d
QNetworkProxyQuery::QueryType type

◆ setLocalPort()

void QNetworkProxyQuery::setLocalPort ( int  port)

Sets the port number that the socket wishes to use locally to accept incoming packets from remote servers to port.

The local port is most often used with the QNetworkProxyQuery::TcpServer and QNetworkProxyQuery::UdpSocket query types.

Valid values are 0 to 65535 (with 0 indicating that any port number will be acceptable) or -1, which means the local port number is unknown or not applicable.

In some circumstances, for special protocols, it's the local port number can also be used with a query of type QNetworkProxyQuery::TcpSocket. When that happens, the socket is indicating it wishes to use the port number port when connecting to a remote host.

See also
localPort(), setPeerPort(), setPeerHostName()

Definition at line 1190 of file qnetworkproxy.cpp.

1191 {
1192  d->localPort = port;
1193 }
QSharedDataPointer< QNetworkProxyQueryPrivate > d

◆ setNetworkConfiguration()

void QNetworkProxyQuery::setNetworkConfiguration ( const QNetworkConfiguration networkConfiguration)

Sets the network configuration component of this QNetworkProxyQuery object to be networkConfiguration.

Since
4.8

The network configuration can be used to return different proxy settings based on the network in use, for example WLAN vs cellular networks on a mobile phone.

In the case of "user choice" or "service network" configurations, you should first start the QNetworkSession and obtain the active configuration from its properties.

See also
networkConfiguration()

Definition at line 1282 of file qnetworkproxy.cpp.

1283 {
1285 }
QSharedDataPointer< QNetworkProxyQueryPrivate > d
QNetworkConfiguration networkConfiguration() const
Returns the network configuration of the proxy query.
QNetworkConfiguration config

◆ setPeerHostName()

void QNetworkProxyQuery::setPeerHostName ( const QString hostname)

Sets the hostname of the outgoing connection being requested to hostname.

An empty hostname can be used to indicate that the remote host is unknown.

The peer host name can also be used to indicate the expected source address of an incoming connection in the case of QNetworkProxyQuery::UdpSocket or QNetworkProxyQuery::TcpServer query types.

See also
peerHostName(), setPeerPort(), setLocalPort()

Definition at line 1156 of file qnetworkproxy.cpp.

1157 {
1158  d->remote.setHost(hostname);
1159 }
void setHost(const QString &host)
Sets the host of the URL to host.
Definition: qurl.cpp:4821
QSharedDataPointer< QNetworkProxyQueryPrivate > d

◆ setPeerPort()

void QNetworkProxyQuery::setPeerPort ( int  port)

Sets the requested port number for the outgoing connection to be port.

Valid values are 1 to 65535, or -1 to indicate that the remote port number is unknown.

The peer port number can also be used to indicate the expected port number of an incoming connection in the case of QNetworkProxyQuery::UdpSocket or QNetworkProxyQuery::TcpServer query types.

See also
peerPort(), setPeerHostName(), setLocalPort()

Definition at line 1124 of file qnetworkproxy.cpp.

1125 {
1126  d->remote.setPort(port);
1127 }
QSharedDataPointer< QNetworkProxyQueryPrivate > d
void setPort(int port)
Sets the port of the URL to port.
Definition: qurl.cpp:4897

◆ setProtocolTag()

void QNetworkProxyQuery::setProtocolTag ( const QString protocolTag)

Sets the protocol tag for this QNetworkProxyQuery object to be protocolTag.

The protocol tag is an arbitrary string that indicates which protocol is being talked over the socket, such as "http", "xmpp", "telnet", etc. The protocol tag is used by the backend to return a request that is more specific to the protocol in question: for example, a HTTP connection could be use a caching HTTP proxy server, while all other connections use a more powerful SOCKSv5 proxy server.

See also
protocolTag()

Definition at line 1224 of file qnetworkproxy.cpp.

1225 {
1226  d->remote.setScheme(protocolTag);
1227 }
QSharedDataPointer< QNetworkProxyQueryPrivate > d
void setScheme(const QString &scheme)
Sets the scheme of the URL to scheme.
Definition: qurl.cpp:4533

◆ setQueryType()

void QNetworkProxyQuery::setQueryType ( QueryType  type)

Sets the query type of this object to be type.

Definition at line 1092 of file qnetworkproxy.cpp.

1093 {
1094  d->type = type;
1095 }
int type
Definition: qmetatype.cpp:239
QSharedDataPointer< QNetworkProxyQueryPrivate > d
QNetworkProxyQuery::QueryType type

◆ setUrl()

void QNetworkProxyQuery::setUrl ( const QUrl url)

Sets the URL component of this QNetworkProxyQuery object to be url.

Setting the URL will also set the protocol tag, the remote host name and port number. This is done so as to facilitate the implementation of the code that determines the proxy server to be used.

See also
url(), peerHostName(), peerPort()

Definition at line 1249 of file qnetworkproxy.cpp.

1250 {
1251  d->remote = url;
1252 }
QSharedDataPointer< QNetworkProxyQueryPrivate > d
QUrl url() const
Returns the URL component of this QNetworkProxyQuery object in case of a query of type QNetworkProxyQ...

◆ url()

QUrl QNetworkProxyQuery::url ( ) const

Returns the URL component of this QNetworkProxyQuery object in case of a query of type QNetworkProxyQuery::UrlRequest.

See also
setUrl()

Definition at line 1235 of file qnetworkproxy.cpp.

Referenced by QWindowsSystemProxy::init(), macQueryInternal(), QGlobalNetworkProxy::proxyForQuery(), setUrl(), and QNetworkProxyFactory::systemProxyForQuery().

1236 {
1237  return d ? d->remote : QUrl();
1238 }
The QUrl class provides a convenient interface for working with URLs.
Definition: qurl.h:61
QSharedDataPointer< QNetworkProxyQueryPrivate > d

Properties

◆ d

QSharedDataPointer<QNetworkProxyQueryPrivate> QNetworkProxyQuery::d
private

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