title: Failed to start QThread when using QNetworkAccessManager
body: <p>I'm currently trying to make a software that downloads a lot of files from Google Drive. Downloading is currently not a problem.</p>
  
  <p>Nevertheless, I encounter an issue when launching 500+ simultaneous downloads. I use a slightly modified version of this tutorial : <a href="https://wiki.qt.io/Download_Data_from_URL" rel="nofollow noreferrer">https://wiki.qt.io/Download_Data_from_URL</a>.</p>
  
  <p>Here is the .h file :</p>
  
  <pre><code>class FileDownloader : public QObject
  {
      Q_OBJECT
  public:
      explicit FileDownloader(QUrl url, QObject *parent = 0, int number = 0);
      QByteArray downloadedData() const;
      void launchNewDownload(QUrl url);
      QByteArray m_DownloadedData;
      QNetworkReply* reply;
  
      static QNetworkAccessManager *m_WebCtrl;
  
  signals:
      void downloaded();
  
  private slots:
      void fileDownloaded(QNetworkReply* pReply);
  };
  </code></pre>
  
  <p>And here is the .cpp file :</p>
  
  <pre><code>QNetworkAccessManager* FileDownloader::m_WebCtrl = nullptr;
  
  FileDownloader::FileDownloader(QUrl url, QObject *parent) :
      QObject(parent)
  {
      if (m_WebCtrl == nullptr) {
          m_WebCtrl = new QNetworkAccessManager(this);
      }
      connect(m_WebCtrl, SIGNAL (finished(QNetworkReply*)),this, SLOT (fileDownloaded(QNetworkReply*)));
  
      launchNewDownload(url);
  }
  
  void FileDownloader::launchNewDownload(QUrl url) {
      QNetworkRequest request(url);
      this-&gt;reply = m_WebCtrl-&gt;get(request);
  }
  
  void FileDownloader::fileDownloaded(QNetworkReply* pReply) {
      m_DownloadedData = pReply-&gt;readAll();
  
      //emit a signal
      pReply-&gt;deleteLater();
      emit downloaded();
  }
  
  QByteArray FileDownloader::downloadedData() const {
      return m_DownloadedData;
  }
  </code></pre>
  
  <p>The issue is "QThread::start: Failed to create thread ()" when reaching about the 500th download. I tried to limit the number of downloads which run at the same time - but I always get the same issue. Besides, I tried to delete every downloader when finishing its task - it did nothing else than crashing the program ;)</p>
  
  <p>I think that it is coming from the number of threads allowed for an only process, but I'm not able to solve it !</p>
  
  <p>Does anyone have an idea that could help me ?</p>
  
  <p>Thank you !</p>