title: QtConcurrent::run how to stop background task
body: <p>I have the same situation like this: <a href="https://stackoverflow.com/questions/18845579/stop-thread-started-by-qtconcurrentrun">stop thread started by qtconcurrent::run</a></p>
  <p>I need to close child thread (started with QtConcurrent::run) on closeEvent in QMainWindow.
  But my function in child thread use code from *.dll: I can`t use loop because all that I do - is calling the <strong>external</strong> dll like</p>
  <pre><code>QFuture&lt;void&gt; = QtConcurrent::run(obj-&gt;useDllfunc_with_longTermJob());
  </code></pre>
  <p>And when I close the app with x-button my gui is closed, but second thread with_longTermJob() still worked and when is finished I have an error.
  I know some decisions for this:</p>
  <ol>
  <li>using other functions like map() or something else with
  QFuture.cancel/stop functionality, not QtConcurrent::run().But I need only one function call. run() is what I need.</li>
  <li>or use QThread instead Concurrent.But it`s not good for me.</li>
  </ol>
  <p>What method more simple and better and how can I implement this? Is there a method that I don`t listed?
  Could you provide small code sample for decision. Thx!</p>