138 executed in parallel for one host/port combination. |
138 executed in parallel for one host/port combination. |
139 |
139 |
140 A more involved example, assuming the manager is already existent, |
140 A more involved example, assuming the manager is already existent, |
141 can be: |
141 can be: |
142 \snippet doc/src/snippets/code/src_network_access_qnetworkaccessmanager.cpp 1 |
142 \snippet doc/src/snippets/code/src_network_access_qnetworkaccessmanager.cpp 1 |
|
143 |
|
144 \section1 Network and Roaming support |
|
145 |
|
146 With the addition of the \l {Bearer Management} API to Qt 4.7 |
|
147 QNetworkAccessManager gained the ability to manage network connections. |
|
148 QNetworkAccessManager can start the network interface if the device is |
|
149 offline and terminates the interface if the current process is the last |
|
150 one to use the uplink. Note that some platform utilize grace periods from |
|
151 when the last application stops using a uplink until the system actually |
|
152 terminates the connectivity link. Roaming is equally transparent. Any |
|
153 queued/pending network requests are automatically transferred to new |
|
154 access point. |
|
155 |
|
156 Clients wanting to utilize this feature should not require any changes. In fact |
|
157 it is likely that existing platform specific connection code can simply be |
|
158 removed from the application. |
|
159 |
|
160 \note The network and roaming support in QNetworkAccessManager is conditional |
|
161 upon the platform supporting connection management. The |
|
162 \l QNetworkConfigurationManager::NetworkSessionRequired can be used to |
|
163 detect whether QNetworkAccessManager utilizes this feature. Currently only |
|
164 Meego/Harmattan and Symbian platforms provide connection management support. |
|
165 |
|
166 \note This feature cannot be used in combination with the Bearer Management |
|
167 API as provided by QtMobility. Applications have to migrate to the Qt version |
|
168 of Bearer Management. |
143 |
169 |
144 \section1 Symbian Platform Security Requirements |
170 \section1 Symbian Platform Security Requirements |
145 |
171 |
146 On Symbian, processes which use this class must have the |
172 On Symbian, processes which use this class must have the |
147 \c NetworkServices platform security capability. If the client |
173 \c NetworkServices platform security capability. If the client |
436 QNetworkAccessManager::~QNetworkAccessManager() |
462 QNetworkAccessManager::~QNetworkAccessManager() |
437 { |
463 { |
438 #ifndef QT_NO_NETWORKPROXY |
464 #ifndef QT_NO_NETWORKPROXY |
439 delete d_func()->proxyFactory; |
465 delete d_func()->proxyFactory; |
440 #endif |
466 #endif |
|
467 |
|
468 // Delete the QNetworkReply children first. |
|
469 // Else a QAbstractNetworkCache might get deleted in ~QObject |
|
470 // before a QNetworkReply that accesses the QAbstractNetworkCache |
|
471 // object in its destructor. |
|
472 qDeleteAll(findChildren<QNetworkReply *>()); |
|
473 // The other children will be deleted in this ~QObject |
|
474 // FIXME instead of this "hack" make the QNetworkReplyImpl |
|
475 // properly watch the cache deletion, e.g. via a QWeakPointer. |
441 } |
476 } |
442 |
477 |
443 #ifndef QT_NO_NETWORKPROXY |
478 #ifndef QT_NO_NETWORKPROXY |
444 /*! |
479 /*! |
445 Returns the QNetworkProxy that the requests sent using this |
480 Returns the QNetworkProxy that the requests sent using this |