Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-76305

Doc: QFuture::cancel() for QConcurrent::run() can be canceled if it is not being run yet

    XMLWordPrintable

Details

    • 93642992ae779f3d8c864e5680ff2dfdfa9d0331

    Description

      Documentation somewhat incorrectly states that tasks started by run() cannot be cancelled:

      Be aware that not all asynchronous computations can be canceled. For example, the future returned by QtConcurrent::run() cannot be canceled; but the future returned by QtConcurrent::mappedReduced() can.
      

      https://doc.qt.io/qt-5/qfuture.html#cancel

      Also it says similar in here:

      Note that the QFuture returned by QtConcurrent::run() does not support canceling, pausing, or progress reporting. The QFuture returned can only be used to query for the running/finished status and the return value of the function.
      

      https://doc.qt.io/qt-5/qtconcurrent.html#run

      But these tasks can be canceled if the task in question has not been started yet. ie. it could still be waiting in the queue.

      Attachments

        For Gerrit Dashboard: QTBUG-76305
        # Subject Branch Project Status CR V

        Activity

          People

            paulwicking Paul Wicking
            poikelin Joni Poikelin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes