Sophie

Sophie

distrib > Mageia > 6 > armv5tl > media > core-updates > by-pkgid > 768f7d9f703884aa2562bf0a651086df > files > 394

qtbase5-doc-5.9.4-1.1.mga6.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qfuture.qdoc -->
  <title>QFuture Class | Qt Core 5.9</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td >Qt 5.9</td><td ><a href="qtcore-index.html">Qt Core</a></td><td ><a href="qtcore-module.html">C++ Classes</a></td><td >QFuture</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right">Qt 5.9.4 Reference Documentation</td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QFuture Class</h1>
<!-- $$$QFuture-brief -->
<p>The <a href="qfuture.html">QFuture</a> class represents the result of an asynchronous computation. <a href="#details">More...</a></p>
<!-- @@@QFuture -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QFuture&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += core</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Since:</td><td class="memItemRight bottomAlign">  Qt 4.4</td></tr></table></div><ul>
<li><a href="qfuture-members.html">List of all members, including inherited members</a></li>
</ul>
<p><b>Note:</b> All functions in this class are thread-safe with the following exceptions:</p>
<ul>
<li><a href="qfuture-const-iterator.html">const_iterator</a></li>
</ul>
<a name="public-types"></a>
<h2 id="public-types">Public Types</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> class </td><td class="memItemRight bottomAlign"><b><a href="qfuture-const-iterator.html">const_iterator</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> typedef </td><td class="memItemRight bottomAlign"><b><a href="qfuture.html#ConstIterator-typedef">ConstIterator</a></b></td></tr>
</table></div>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qfuture.html#QFuture">QFuture</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const_iterator </td><td class="memItemRight bottomAlign"><b><a href="qfuture.html#begin">begin</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qfuture.html#cancel">cancel</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const_iterator </td><td class="memItemRight bottomAlign"><b><a href="qfuture.html#constBegin">constBegin</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const_iterator </td><td class="memItemRight bottomAlign"><b><a href="qfuture.html#constEnd">constEnd</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const_iterator </td><td class="memItemRight bottomAlign"><b><a href="qfuture.html#end">end</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qfuture.html#isCanceled">isCanceled</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qfuture.html#isFinished">isFinished</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qfuture.html#isPaused">isPaused</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qfuture.html#isResultReadyAt">isResultReadyAt</a></b>(int <i>index</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qfuture.html#isRunning">isRunning</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qfuture.html#isStarted">isStarted</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qfuture.html#pause">pause</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qfuture.html#progressMaximum">progressMaximum</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qfuture.html#progressMinimum">progressMinimum</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qfuture.html#progressText">progressText</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qfuture.html#progressValue">progressValue</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> T </td><td class="memItemRight bottomAlign"><b><a href="qfuture.html#result">result</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> T </td><td class="memItemRight bottomAlign"><b><a href="qfuture.html#resultAt">resultAt</a></b>(int <i>index</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qfuture.html#resultCount">resultCount</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;T&gt; </td><td class="memItemRight bottomAlign"><b><a href="qfuture.html#results">results</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qfuture.html#resume">resume</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qfuture.html#setPaused">setPaused</a></b>(bool <i>paused</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qfuture.html#togglePaused">togglePaused</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qfuture.html#waitForFinished">waitForFinished</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qfuture.html#operator-T">operator T</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qfuture.html#operator-not-eq">operator!=</a></b>(const QFuture &amp;<i>other</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qfuture.html#operator-eq-eq">operator==</a></b>(const QFuture &amp;<i>other</i>) const</td></tr>
</table></div>
<a name="details"></a>
<!-- $$$QFuture-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qfuture.html">QFuture</a> class represents the result of an asynchronous computation.</p>
<p>To start a computation, use one of the APIs in the <a href="../qtconcurrent/qtconcurrent-index.html">Qt Concurrent</a> framework.</p>
<p><a href="qfuture.html">QFuture</a> allows threads to be synchronized against one or more results which will be ready at a later point in time. The result can be of any type that has a default constructor and a copy constructor. If a result is not available at the time of calling the <a href="qfuture.html#result">result</a>(), <a href="qfuture.html#resultAt">resultAt</a>(), or <a href="qfuture.html#results">results</a>() functions, <a href="qfuture.html">QFuture</a> will wait until the result becomes available. You can use the <a href="qfuture.html#isResultReadyAt">isResultReadyAt</a>() function to determine if a result is ready or not. For <a href="qfuture.html">QFuture</a> objects that report more than one result, the <a href="qfuture.html#resultCount">resultCount</a>() function returns the number of continuous results. This means that it is always safe to iterate through the results from 0 to <a href="qfuture.html#resultCount">resultCount</a>().</p>
<p><a href="qfuture.html">QFuture</a> provides a <a href="containers.html#java-style-iterators">Java-style iterator</a> (<a href="qfutureiterator.html">QFutureIterator</a>) and an <a href="containers.html#stl-style-iterators">STL-style iterator</a> (<a href="qfuture-const-iterator.html">QFuture::const_iterator</a>). Using these iterators is another way to access results in the future.</p>
<p><a href="qfuture.html">QFuture</a> also offers ways to interact with a runnning computation. For instance, the computation can be canceled with the <a href="qfuture.html#cancel">cancel</a>() function. To pause the computation, use the <a href="qfuture.html#setPaused">setPaused</a>() function or one of the <a href="qfuture.html#pause">pause</a>(), <a href="qfuture.html#resume">resume</a>(), or <a href="qfuture.html#togglePaused">togglePaused</a>() convenience functions. Be aware that not all asynchronous computations can be canceled or paused. For example, the future returned by <a href="../qtconcurrent/qtconcurrent.html#run">QtConcurrent::run</a>() cannot be canceled; but the future returned by <a href="../qtconcurrent/qtconcurrent.html#mappedReduced-1">QtConcurrent::mappedReduced</a>() can.</p>
<p>Progress information is provided by the <a href="qfuture.html#progressValue">progressValue</a>(), <a href="qfuture.html#progressMinimum">progressMinimum</a>(), <a href="qfuture.html#progressMaximum">progressMaximum</a>(), and <a href="qfuture.html#progressText">progressText</a>() functions. The <a href="qfuture.html#waitForFinished">waitForFinished</a>() function causes the calling thread to block and wait for the computation to finish, ensuring that all results are available.</p>
<p>The state of the computation represented by a <a href="qfuture.html">QFuture</a> can be queried using the <a href="qfuture.html#isCanceled">isCanceled</a>(), <a href="qfuture.html#isStarted">isStarted</a>(), <a href="qfuture.html#isFinished">isFinished</a>(), <a href="qfuture.html#isRunning">isRunning</a>(), or <a href="qfuture.html#isPaused">isPaused</a>() functions.</p>
<p><a href="qfuture.html">QFuture</a> is a lightweight reference counted class that can be passed by value.</p>
<p><a href="qfuture.html">QFuture</a>&lt;void&gt; is specialized to not contain any of the result fetching functions. Any <a href="qfuture.html">QFuture</a>&lt;T&gt; can be assigned or copied into a <a href="qfuture.html">QFuture</a>&lt;void&gt; as well. This is useful if only status or progress information is needed - not the actual result data.</p>
<p>To interact with running tasks using signals and slots, use <a href="qfuturewatcher.html">QFutureWatcher</a>.</p>
</div>
<p><b>See also </b><a href="qfuturewatcher.html">QFutureWatcher</a> and <a href="../qtconcurrent/qtconcurrent-index.html">Qt Concurrent</a>.</p>
<!-- @@@QFuture -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$ConstIterator -->
<h3 class="fn" id="ConstIterator-typedef"><a name="ConstIterator-typedef"></a>typedef QFuture::<span class="name">ConstIterator</span></h3>
<p>Qt-style synonym for <a href="qfuture-const-iterator.html">QFuture::const_iterator</a>.</p>
<!-- @@@ConstIterator -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QFuture[overload1]$$$QFuture -->
<h3 class="fn" id="QFuture"><a name="QFuture"></a>QFuture::<span class="name">QFuture</span>()</h3>
<p>Constructs an empty, canceled future.</p>
<!-- @@@QFuture -->
<!-- $$$begin[overload1]$$$begin -->
<h3 class="fn" id="begin"><a name="begin"></a><span class="type"><a href="qfuture-const-iterator.html">const_iterator</a></span> QFuture::<span class="name">begin</span>() const</h3>
<p>Returns a const <a href="containers.html#stl-style-iterators">STL-style iterator</a> pointing to the first result in the future.</p>
<p><b>See also </b><a href="qfuture.html#constBegin">constBegin</a>() and <a href="qfuture.html#end">end</a>().</p>
<!-- @@@begin -->
<!-- $$$cancel[overload1]$$$cancel -->
<h3 class="fn" id="cancel"><a name="cancel"></a><span class="type">void</span> QFuture::<span class="name">cancel</span>()</h3>
<p>Cancels the asynchronous computation represented by this future. Note that the cancelation is asynchronous. Use <a href="qfuture.html#waitForFinished">waitForFinished</a>() after calling cancel() when you need synchronous cancelation.</p>
<p>Results currently available may still be accessed on a canceled future, but new results will <i>not</i> become available after calling this function. Any <a href="qfuturewatcher.html">QFutureWatcher</a> object that is watching this future will not deliver progress and result ready signals on a canceled future.</p>
<p>Be aware that not all asynchronous computations can be canceled. For example, the future returned by <a href="../qtconcurrent/qtconcurrent.html#run">QtConcurrent::run</a>() cannot be canceled; but the future returned by <a href="../qtconcurrent/qtconcurrent.html#mappedReduced-1">QtConcurrent::mappedReduced</a>() can.</p>
<!-- @@@cancel -->
<!-- $$$constBegin[overload1]$$$constBegin -->
<h3 class="fn" id="constBegin"><a name="constBegin"></a><span class="type"><a href="qfuture-const-iterator.html">const_iterator</a></span> QFuture::<span class="name">constBegin</span>() const</h3>
<p>Returns a const <a href="containers.html#stl-style-iterators">STL-style iterator</a> pointing to the first result in the future.</p>
<p><b>See also </b><a href="qfuture.html#begin">begin</a>() and <a href="qfuture.html#constEnd">constEnd</a>().</p>
<!-- @@@constBegin -->
<!-- $$$constEnd[overload1]$$$constEnd -->
<h3 class="fn" id="constEnd"><a name="constEnd"></a><span class="type"><a href="qfuture-const-iterator.html">const_iterator</a></span> QFuture::<span class="name">constEnd</span>() const</h3>
<p>Returns a const <a href="containers.html#stl-style-iterators">STL-style iterator</a> pointing to the imaginary result after the last result in the future.</p>
<p><b>See also </b><a href="qfuture.html#constBegin">constBegin</a>() and <a href="qfuture.html#end">end</a>().</p>
<!-- @@@constEnd -->
<!-- $$$end[overload1]$$$end -->
<h3 class="fn" id="end"><a name="end"></a><span class="type"><a href="qfuture-const-iterator.html">const_iterator</a></span> QFuture::<span class="name">end</span>() const</h3>
<p>Returns a const <a href="containers.html#stl-style-iterators">STL-style iterator</a> pointing to the imaginary result after the last result in the future.</p>
<p><b>See also </b><a href="qfuture.html#begin">begin</a>() and <a href="qfuture.html#constEnd">constEnd</a>().</p>
<!-- @@@end -->
<!-- $$$isCanceled[overload1]$$$isCanceled -->
<h3 class="fn" id="isCanceled"><a name="isCanceled"></a><span class="type">bool</span> QFuture::<span class="name">isCanceled</span>() const</h3>
<p>Returns <code>true</code> if the asynchronous computation has been canceled with the <a href="qfuture.html#cancel">cancel</a>() function; otherwise returns <code>false</code>.</p>
<p>Be aware that the computation may still be running even though this function returns <code>true</code>. See <a href="qfuture.html#cancel">cancel</a>() for more details.</p>
<!-- @@@isCanceled -->
<!-- $$$isFinished[overload1]$$$isFinished -->
<h3 class="fn" id="isFinished"><a name="isFinished"></a><span class="type">bool</span> QFuture::<span class="name">isFinished</span>() const</h3>
<p>Returns <code>true</code> if the asynchronous computation represented by this future has finished; otherwise returns <code>false</code>.</p>
<!-- @@@isFinished -->
<!-- $$$isPaused[overload1]$$$isPaused -->
<h3 class="fn" id="isPaused"><a name="isPaused"></a><span class="type">bool</span> QFuture::<span class="name">isPaused</span>() const</h3>
<p>Returns <code>true</code> if the asynchronous computation has been paused with the <a href="qfuture.html#pause">pause</a>() function; otherwise returns <code>false</code>.</p>
<p>Be aware that the computation may still be running even though this function returns <code>true</code>. See <a href="qfuture.html#setPaused">setPaused</a>() for more details.</p>
<p><b>See also </b><a href="qfuture.html#setPaused">setPaused</a>() and <a href="qfuture.html#togglePaused">togglePaused</a>().</p>
<!-- @@@isPaused -->
<!-- $$$isResultReadyAt[overload1]$$$isResultReadyAtint -->
<h3 class="fn" id="isResultReadyAt"><a name="isResultReadyAt"></a><span class="type">bool</span> QFuture::<span class="name">isResultReadyAt</span>(<span class="type">int</span> <i>index</i>) const</h3>
<p>Returns <code>true</code> if the result at <i>index</i> is immediately available; otherwise returns <code>false</code>.</p>
<p><b>See also </b><a href="qfuture.html#resultAt">resultAt</a>() and <a href="qfuture.html#resultCount">resultCount</a>().</p>
<!-- @@@isResultReadyAt -->
<!-- $$$isRunning[overload1]$$$isRunning -->
<h3 class="fn" id="isRunning"><a name="isRunning"></a><span class="type">bool</span> QFuture::<span class="name">isRunning</span>() const</h3>
<p>Returns <code>true</code> if the asynchronous computation represented by this future is currently running; otherwise returns <code>false</code>.</p>
<!-- @@@isRunning -->
<!-- $$$isStarted[overload1]$$$isStarted -->
<h3 class="fn" id="isStarted"><a name="isStarted"></a><span class="type">bool</span> QFuture::<span class="name">isStarted</span>() const</h3>
<p>Returns <code>true</code> if the asynchronous computation represented by this future has been started; otherwise returns <code>false</code>.</p>
<!-- @@@isStarted -->
<!-- $$$pause[overload1]$$$pause -->
<h3 class="fn" id="pause"><a name="pause"></a><span class="type">void</span> QFuture::<span class="name">pause</span>()</h3>
<p>Pauses the asynchronous computation represented by this future. This is a convenience method that simply calls <a href="qfuture.html#setPaused">setPaused</a>(true).</p>
<p><b>See also </b><a href="qfuture.html#resume">resume</a>().</p>
<!-- @@@pause -->
<!-- $$$progressMaximum[overload1]$$$progressMaximum -->
<h3 class="fn" id="progressMaximum"><a name="progressMaximum"></a><span class="type">int</span> QFuture::<span class="name">progressMaximum</span>() const</h3>
<p>Returns the maximum <a href="qfuture.html#progressValue">progressValue</a>().</p>
<p><b>See also </b><a href="qfuture.html#progressValue">progressValue</a>() and <a href="qfuture.html#progressMinimum">progressMinimum</a>().</p>
<!-- @@@progressMaximum -->
<!-- $$$progressMinimum[overload1]$$$progressMinimum -->
<h3 class="fn" id="progressMinimum"><a name="progressMinimum"></a><span class="type">int</span> QFuture::<span class="name">progressMinimum</span>() const</h3>
<p>Returns the minimum <a href="qfuture.html#progressValue">progressValue</a>().</p>
<p><b>See also </b><a href="qfuture.html#progressValue">progressValue</a>() and <a href="qfuture.html#progressMaximum">progressMaximum</a>().</p>
<!-- @@@progressMinimum -->
<!-- $$$progressText[overload1]$$$progressText -->
<h3 class="fn" id="progressText"><a name="progressText"></a><span class="type"><a href="qstring.html">QString</a></span> QFuture::<span class="name">progressText</span>() const</h3>
<p>Returns the (optional) textual representation of the progress as reported by the asynchronous computation.</p>
<p>Be aware that not all computations provide a textual representation of the progress, and as such, this function may return an empty string.</p>
<!-- @@@progressText -->
<!-- $$$progressValue[overload1]$$$progressValue -->
<h3 class="fn" id="progressValue"><a name="progressValue"></a><span class="type">int</span> QFuture::<span class="name">progressValue</span>() const</h3>
<p>Returns the current progress value, which is between the <a href="qfuture.html#progressMinimum">progressMinimum</a>() and <a href="qfuture.html#progressMaximum">progressMaximum</a>().</p>
<p><b>See also </b><a href="qfuture.html#progressMinimum">progressMinimum</a>() and <a href="qfuture.html#progressMaximum">progressMaximum</a>().</p>
<!-- @@@progressValue -->
<!-- $$$result[overload1]$$$result -->
<h3 class="fn" id="result"><a name="result"></a><span class="type">T</span> QFuture::<span class="name">result</span>() const</h3>
<p>Returns the first result in the future. If the result is not immediately available, this function will block and wait for the result to become available. This is a convenience method for calling <a href="qfuture.html#resultAt">resultAt</a>(0).</p>
<p><b>See also </b><a href="qfuture.html#resultAt">resultAt</a>() and <a href="qfuture.html#results">results</a>().</p>
<!-- @@@result -->
<!-- $$$resultAt[overload1]$$$resultAtint -->
<h3 class="fn" id="resultAt"><a name="resultAt"></a><span class="type">T</span> QFuture::<span class="name">resultAt</span>(<span class="type">int</span> <i>index</i>) const</h3>
<p>Returns the result at <i>index</i> in the future. If the result is not immediately available, this function will block and wait for the result to become available.</p>
<p><b>See also </b><a href="qfuture.html#result">result</a>(), <a href="qfuture.html#results">results</a>(), and <a href="qfuture.html#resultCount">resultCount</a>().</p>
<!-- @@@resultAt -->
<!-- $$$resultCount[overload1]$$$resultCount -->
<h3 class="fn" id="resultCount"><a name="resultCount"></a><span class="type">int</span> QFuture::<span class="name">resultCount</span>() const</h3>
<p>Returns the number of continuous results available in this future. The real number of results stored might be different from this value, due to gaps in the result set. It is always safe to iterate through the results from 0 to resultCount().</p>
<p><b>See also </b><a href="qfuture.html#result">result</a>(), <a href="qfuture.html#resultAt">resultAt</a>(), and <a href="qfuture.html#results">results</a>().</p>
<!-- @@@resultCount -->
<!-- $$$results[overload1]$$$results -->
<h3 class="fn" id="results"><a name="results"></a><span class="type"><a href="qlist.html">QList</a></span>&lt;<span class="type">T</span>&gt; QFuture::<span class="name">results</span>() const</h3>
<p>Returns all results from the future. If the results are not immediately available, this function will block and wait for them to become available.</p>
<p><b>See also </b><a href="qfuture.html#result">result</a>(), <a href="qfuture.html#resultAt">resultAt</a>(), and <a href="qfuture.html#resultCount">resultCount</a>().</p>
<!-- @@@results -->
<!-- $$$resume[overload1]$$$resume -->
<h3 class="fn" id="resume"><a name="resume"></a><span class="type">void</span> QFuture::<span class="name">resume</span>()</h3>
<p>Resumes the asynchronous computation represented by this future. This is a convenience method that simply calls <a href="qfuture.html#setPaused">setPaused</a>(false).</p>
<p><b>See also </b><a href="qfuture.html#pause">pause</a>().</p>
<!-- @@@resume -->
<!-- $$$setPaused[overload1]$$$setPausedbool -->
<h3 class="fn" id="setPaused"><a name="setPaused"></a><span class="type">void</span> QFuture::<span class="name">setPaused</span>(<span class="type">bool</span> <i>paused</i>)</h3>
<p>If <i>paused</i> is true, this function pauses the asynchronous computation represented by the future. If the computation is already paused, this function does nothing. Any <a href="qfuturewatcher.html">QFutureWatcher</a> object that is watching this future will stop delivering progress and result ready signals while the future is paused. Signal delivery will continue once the future is resumed.</p>
<p>If <i>paused</i> is false, this function resumes the asynchronous computation. If the computation was not previously paused, this function does nothing.</p>
<p>Be aware that not all computations can be paused. For example, the future returned by <a href="../qtconcurrent/qtconcurrent.html#run">QtConcurrent::run</a>() cannot be paused; but the future returned by <a href="../qtconcurrent/qtconcurrent.html#mappedReduced-1">QtConcurrent::mappedReduced</a>() can.</p>
<p><b>See also </b><a href="qfuture.html#isPaused">isPaused</a>(), <a href="qfuture.html#pause">pause</a>(), <a href="qfuture.html#resume">resume</a>(), and <a href="qfuture.html#togglePaused">togglePaused</a>().</p>
<!-- @@@setPaused -->
<!-- $$$togglePaused[overload1]$$$togglePaused -->
<h3 class="fn" id="togglePaused"><a name="togglePaused"></a><span class="type">void</span> QFuture::<span class="name">togglePaused</span>()</h3>
<p>Toggles the paused state of the asynchronous computation. In other words, if the computation is currently paused, calling this function resumes it; if the computation is running, it is paused. This is a convenience method for calling <a href="qfuture.html#setPaused">setPaused</a>(!<a href="qfuture.html#isPaused">isPaused</a>()).</p>
<p><b>See also </b><a href="qfuture.html#setPaused">setPaused</a>(), <a href="qfuture.html#pause">pause</a>(), and <a href="qfuture.html#resume">resume</a>().</p>
<!-- @@@togglePaused -->
<!-- $$$waitForFinished[overload1]$$$waitForFinished -->
<h3 class="fn" id="waitForFinished"><a name="waitForFinished"></a><span class="type">void</span> QFuture::<span class="name">waitForFinished</span>()</h3>
<p>Waits for the asynchronous computation to finish (including <a href="qfuture.html#cancel">cancel</a>()ed computations).</p>
<!-- @@@waitForFinished -->
<!-- $$$operator T[overload1]$$$operator T -->
<h3 class="fn" id="operator-T"><a name="operator-T"></a>QFuture::<span class="name">operator T</span>() const</h3>
<p>Returns the first result in the future. If the result is not immediately available, this function will block and wait for the result to become available. This is a convenience method for calling <a href="qfuture.html#result">result</a>() or <a href="qfuture.html#resultAt">resultAt</a>(0).</p>
<p><b>See also </b><a href="qfuture.html#result">result</a>(), <a href="qfuture.html#resultAt">resultAt</a>(), and <a href="qfuture.html#results">results</a>().</p>
<!-- @@@operator T -->
<!-- $$$operator!=[overload1]$$$operator!=constQFuture& -->
<h3 class="fn" id="operator-not-eq"><a name="operator-not-eq"></a><span class="type">bool</span> QFuture::<span class="name">operator!=</span>(const <span class="type"><a href="qfuture.html#QFuture">QFuture</a></span> &amp;<i>other</i>) const</h3>
<p>Returns <code>true</code> if <i>other</i> is <i>not</i> a copy of this future; otherwise returns false.</p>
<!-- @@@operator!= -->
<!-- $$$operator==[overload1]$$$operator==constQFuture& -->
<h3 class="fn" id="operator-eq-eq"><a name="operator-eq-eq"></a><span class="type">bool</span> QFuture::<span class="name">operator==</span>(const <span class="type"><a href="qfuture.html#QFuture">QFuture</a></span> &amp;<i>other</i>) const</h3>
<p>Returns <code>true</code> if <i>other</i> is a copy of this future; otherwise returns <code>false</code>.</p>
<!-- @@@operator== -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2017 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>