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 () 會被使用。

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