Obsolete Members for QNetworkAccessManager

以下成员源于类 QNetworkAccessManager 已过时。 提供它们是为使旧源代码能继续工作。强烈建议不要在新代码中使用它们。

公共类型

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

特性

公共函数

(obsolete) QNetworkConfiguration activeConfiguration () const
(obsolete) QNetworkConfiguration configuration () const
(obsolete) QNetworkAccessManager::NetworkAccessibility networkAccessible () const
(obsolete) void setConfiguration (const QNetworkConfiguration & config )
(obsolete) void setNetworkAccessible (QNetworkAccessManager::NetworkAccessibility accessible )

信号

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

成员类型文档编制

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.

常量 描述
QNetworkAccessManager::UnknownAccessibility -1 网络的可访问性不能确定。
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 网络是可访问的。

另请参阅 networkAccessible .

特性文档编制

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);
					

注意: 调用 setNetworkAccessible () does not change the network state.

该特性在 Qt 4.7 引入。

访问函数:

QNetworkAccessManager::NetworkAccessibility networkAccessible () const
void setNetworkAccessible (QNetworkAccessManager::NetworkAccessibility accessible )

通知程序信号:

void networkAccessibleChanged (QNetworkAccessManager::NetworkAccessibility accessible )

成员函数文档编制

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

此函数已过时。提供它是为使旧源代码能继续工作。强烈建议不要在新代码中使用它。

This signal is emitted when the value of the networkAccessible 特性改变。 accessible is the new network accessibility.

注意: 通知程序信号对于特性 networkAccessible .

QNetworkConfiguration QNetworkAccessManager:: activeConfiguration () const

此函数已过时。提供它是为使旧源代码能继续工作。强烈建议不要在新代码中使用它。

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.

该函数在 Qt 4.7 引入。

另请参阅 configuration ().

QNetworkConfiguration QNetworkAccessManager:: configuration () const

此函数已过时。提供它是为使旧源代码能继续工作。强烈建议不要在新代码中使用它。

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

该函数在 Qt 4.7 引入。

另请参阅 setConfiguration () 和 activeConfiguration ().

QNetworkAccessManager::NetworkAccessibility QNetworkAccessManager:: networkAccessible () const

此函数已过时。提供它是为使旧源代码能继续工作。强烈建议不要在新代码中使用它。

Returns the current network accessibility.

注意: Getter function for property networkAccessible.

该函数在 Qt 4.7 引入。

另请参阅 setNetworkAccessible ().

void QNetworkAccessManager:: setConfiguration (const QNetworkConfiguration & config )

此函数已过时。提供它是为使旧源代码能继续工作。强烈建议不要在新代码中使用它。

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());
					

该函数在 Qt 4.7 引入。

另请参阅 configuration () 和 QNetworkSession .

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

此函数已过时。提供它是为使旧源代码能继续工作。强烈建议不要在新代码中使用它。

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.

注意: setter 函数对于特性 networkAccessible .

该函数在 Qt 4.7 引入。

另请参阅 networkAccessible ().