qcoro icon indicating copy to clipboard operation
qcoro copied to clipboard

QML support

Open danvratil opened this issue 2 years ago • 1 comments

So far QCoro can only be used in C++ code. However, it should be possible to return QCoro::Task<T> from a QObject's invokable method that can be called from QML.

Unfortunately, we are unable to extend the QML engine in such a way to support "async" and "await" keywords to duplicate the ES8 Promise/Async/Await API. However, we should still be able to wrap QCoro::Task<T> into some QML-friendly wrapper that can expose the existing .then() continuations, so that it's possible to asynchronously handle a C++ coroutine result in QML.

danvratil avatar Jul 09 '22 22:07 danvratil