(self)
Cancel the current task (if any).
Cancel the current task (if any).
Cancel the current task ( if any ) .
def cancel(self):
        """
        Cancel the current task (if any).
        """
        if self._task is not None:
            self._task.cancel()
            assert self._task.future.done()
            # disconnect from the task
            self._task.done.disconnect(self._task_finished)
            self._task.progressChanged.disconnect(self.setProgressValue)
            self._task.deleteLater()
            self._task = None  # pylint: disable=attribute-defined-outside-init

        self.progressBarFinished()
        self.setBlocking(False)
def cancel ( self ) : if self . _task is not None : self . _task . cancel ( ) assert self . _task . future . done ( ) # disconnect from the task self . _task . done . disconnect ( self . _task_finished ) self . _task . progressChanged . disconnect ( self . setProgressValue ) self . _task . deleteLater ( ) self . _task = None # pylint: disable=attribute-defined-outside-init self . progressBarFinished ( ) self . setBlocking ( False )