From 9fdbd9dce917e90f0e644bedd8dca183f88304d6 Mon Sep 17 00:00:00 2001 From: Jussi Witick Date: Wed, 25 Apr 2018 11:22:13 +0300 Subject: [PATCH] Specify that you need an instance of QNetworkAccessManager per thread MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The class is not thread safe, so one instance is not enough for whole application. Mention that QNetworkAccessManager instance can only be used from the thread it belongs to because it is a QObject. Change-Id: I56184e4f8fbd36aca3f6677310431eab88346e6e Reviewed-by: MÃ¥rten Nordheim Reviewed-by: Timur Pocheptsov --- src/network/access/qnetworkaccessmanager.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp index 07644b869f..35e79a69f2 100644 --- a/src/network/access/qnetworkaccessmanager.cpp +++ b/src/network/access/qnetworkaccessmanager.cpp @@ -178,7 +178,9 @@ static void ensureInitialized() it sends. It contains the proxy and cache configuration, as well as the signals related to such issues, and reply signals that can be used to monitor the progress of a network operation. One QNetworkAccessManager - should be enough for the whole Qt application. + instance should be enough for the whole Qt application. Since + QNetworkAccessManager is based on QObject, it can only be used from the + thread it belongs to. Once a QNetworkAccessManager object has been created, the application can use it to send requests over the network. A group of standard functions