- Qt 6.6
- Qt Core
- Obsolete Members for QtFuture
- Qt 6.6.1 Reference Documentation

# Obsolete Members for QtFuture

The following members of class QtFuture are deprecated. They are provided to keep old source code working. We strongly advise against using them in new code.

## Functions

`(deprecated (6.10))` QFuture<std::decay_t<T>> | makeReadyFuture(T &&value)
`(deprecated (6.10))` QFuture<T> | makeReadyFuture(const QList<T> &values)
`(deprecated (6.10))` QFuture<void> | makeReadyFuture()

## Function Documentation

### `[since 6.1]` template <typename T, typename> QFuture<std::decay_t<T>> QtFuture::makeReadyFuture(T &&value)

This function is deprecated since 6.10. We strongly advise against using it in new code.

This is an overloaded function.

Use makeReadyValueFuture() instead

The QtFuture::makeReadyFuture() method should be avoided because it has an inconsistent set of overloads. It will be deprecated in future Qt releases. Use QtFuture::makeReadyVoidFuture(), QtFuture::makeReadyValueFuture() or QtFuture::makeReadyRangeFuture() instead.

Creates and returns a QFuture which already has a result value. The returned QFuture has a type of std::decay_t<T>, where T is not void.

     auto f = QtFuture::makeReadyFuture(std::make_unique<int>(42));
     ...
     const int result = *f.takeResult(); // result == 42

This function was introduced in Qt 6.1.

See also QFuture, QtFuture::makeReadyVoidFuture(), QtFuture::makeReadyValueFuture(), QtFuture::makeReadyRangeFuture(), and QtFuture::makeExceptionalFuture().

### `[since 6.1]` template <typename T> QFuture<T> QtFuture::makeReadyFuture(const QList<T> &values)

This function is deprecated since 6.10. We strongly advise against using it in new code.

This is an overloaded function.

Use makeReadyRangeFuture() instead

The QtFuture::makeReadyFuture() method should be avoided because it has an inconsistent set of overloads. It will be deprecated in future Qt releases. Use QtFuture::makeReadyVoidFuture(), QtFuture::makeReadyValueFuture() or QtFuture::makeReadyRangeFuture() instead.

Creates and returns a QFuture which already has multiple results set from values.

     const QList<int> values { 1, 2, 3 };
     auto f = QtFuture::makeReadyFuture(values);
     ...
     const int count = f.resultCount(); // count == 3
     const auto results = f.results(); // results == { 1, 2, 3 }

This function was introduced in Qt 6.1.

See also QFuture, QtFuture::makeReadyVoidFuture(), QtFuture::makeReadyValueFuture(), QtFuture::makeReadyRangeFuture(), and QtFuture::makeExceptionalFuture().

### `[since 6.1]` QFuture<void> QtFuture::makeReadyFuture()

This function is deprecated since 6.10. We strongly advise against using it in new code.

This is an overloaded function.

Use makeReadyVoidFuture() instead

The QtFuture::makeReadyFuture() method should be avoided because it has an inconsistent set of overloads. It will be deprecated in future Qt releases. Use QtFuture::makeReadyVoidFuture(), QtFuture::makeReadyValueFuture() or QtFuture::makeReadyRangeFuture() instead.

Creates and returns a void QFuture. Such QFuture can't store any result. One can use it to query the state of the computation. The returned QFuture will always be in the finished state.

     auto f = QtFuture::makeReadyFuture();
     ...
     const bool started = f.isStarted(); // started == true
     const bool running = f.isRunning(); // running == false
     const bool finished = f.isFinished(); // finished == true

This function was introduced in Qt 6.1.

See also QFuture, QFuture::isStarted(), QFuture::isRunning(), QFuture::isFinished(), QtFuture::makeReadyVoidFuture(), QtFuture::makeReadyValueFuture(), QtFuture::makeReadyRangeFuture(), and QtFuture::makeExceptionalFuture().