- Qt 5.15
- Qt Network
- C++ Classes
- QNetworkAccessManager
- Qt 5.15.15 Reference Documentation

# Obsolete Members for QNetworkAccessManager

The following members of class QNetworkAccessManager are obsolete. They are provided to keep old source code working. We strongly advise against using them in new code.

## Public Types

`(obsolete)` enum | NetworkAccessibility { UnknownAccessibility, NotAccessible, Accessible }

## Properties

- `(obsolete)` networkAccessible : NetworkAccessibility

## Public Functions

`(obsolete)` QNetworkConfiguration | activeConfiguration() const
`(obsolete)` QNetworkConfiguration | configuration() const
`(obsolete)` NetworkAccessibility | networkAccessible() const
`(obsolete)` void | setConfiguration(const QNetworkConfiguration &config)
`(obsolete)` void | setNetworkAccessible(NetworkAccessibility accessible)

## Signals

`(obsolete)` void | networkAccessibleChanged(QNetworkAccessManager::NetworkAccessibility accessible)

## Member Type Documentation

### enum QNetworkAccessManager::NetworkAccessibility

This enum is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

Indicates whether the network is accessible via this network access manager.

Constant | Value | Description
--- | --- | ---
`QNetworkAccessManager::UnknownAccessibility` | `-1` | The network accessibility cannot be determined.
`QNetworkAccessManager::NotAccessible` | `0` | The network is not currently accessible, either because there is currently no network coverage or network access has been explicitly disabled by a call to setNetworkAccessible().
`QNetworkAccessManager::Accessible` | `1` | The network is accessible.

See also networkAccessible.

## Property Documentation

### networkAccessible : NetworkAccessibility

This property is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

This property holds whether the network is currently accessible via this network access manager.

If the network is not accessible the network access manager will not process any new network requests, all such requests will fail with an error. Requests with URLs with the file:// scheme will still be processed.

By default the value of this property reflects the physical state of the device. Applications may override it to disable all network requests via this network access manager by calling

     networkAccessManager->setNetworkAccessible(QNetworkAccessManager::NotAccessible);

Network requests can be re-enabled again, and this property will resume to reflect the actual device state by calling

     networkAccessManager->setNetworkAccessible(QNetworkAccessManager::Accessible);

Note: Calling setNetworkAccessible() does not change the network state.

This property was introduced in Qt 4.7.

Access functions:

NetworkAccessibility | networkAccessible() const
void | setNetworkAccessible(NetworkAccessibility accessible)

Notifier signal:

void | networkAccessibleChanged(QNetworkAccessManager::NetworkAccessibility accessible)

## Member Function Documentation

### `[signal]` void QNetworkAccessManager::networkAccessibleChanged(QNetworkAccessManager::NetworkAccessibility accessible)

This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

This signal is emitted when the value of the networkAccessible property changes. accessible is the new network accessibility.

Note: Notifier signal for property networkAccessible.

### QNetworkConfiguration QNetworkAccessManager::activeConfiguration() const

This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

Returns the current active network configuration.

If the network configuration returned by configuration() is of type QNetworkConfiguration::ServiceNetwork this function will return the current active child network configuration of that configuration. Otherwise returns the same network configuration as configuration().

Use this function to return the actual network configuration currently in use by the network session.

This function was introduced in Qt 4.7.

See also configuration().

### QNetworkConfiguration QNetworkAccessManager::configuration() const

This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

Returns the network configuration that will be used to create the network session which will be used when processing network requests.

This function was introduced in Qt 4.7.

See also setConfiguration() and activeConfiguration().

### NetworkAccessibility QNetworkAccessManager::networkAccessible() const

This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

Returns the current network accessibility.

Note: Getter function for property networkAccessible.

This function was introduced in Qt 4.7.

See also setNetworkAccessible().

### void QNetworkAccessManager::setConfiguration(const QNetworkConfiguration &config)

This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

Sets the network configuration that will be used when creating the network session to config.

The network configuration is used to create and open a network session before any request that requires network access is process. If no network configuration is explicitly set via this function the network configuration returned by QNetworkConfigurationManager::defaultConfiguration() will be used.

To restore the default network configuration set the network configuration to the value returned from QNetworkConfigurationManager::defaultConfiguration().

Setting a network configuration means that the QNetworkAccessManager instance will only be using the specified one. In particular, if the default network configuration changes (upon e.g. Wifi being available), this new configuration needs to be enabled manually if desired.

     QNetworkConfigurationManager manager;
     networkAccessManager->setConfiguration(manager.defaultConfiguration());

If an invalid network configuration is set, a network session will not be created. In this case network requests will be processed regardless, but may fail. For example:

     networkAccessManager->setConfiguration(QNetworkConfiguration());

This function was introduced in Qt 4.7.

See also configuration() and QNetworkSession.

### void QNetworkAccessManager::setNetworkAccessible(NetworkAccessibility accessible)

This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

Overrides the reported network accessibility. If accessible is NotAccessible the reported network accessiblity will always be NotAccessible. Otherwise the reported network accessibility will reflect the actual device state.

Note: Setter function for property networkAccessible.

This function was introduced in Qt 4.7.

See also networkAccessible().