qcoro6 for Mac
QCoro - Coroutines for Qt
qcoro6 — overview
QCoro - Coroutines for Qt
The QCoro library provides set of tools to make use of C++20 coroutines with Qt.
Take a look at the example below to see what an amazing thing coroutines are:
It requires a compiler with support for the couroutines TS, see documentation for a list of supported compilers and versions.
Documentation
? ? Documentation
Supported Qt Types
QCoro provides the tools necessary to make easy use of C++20 coroutines with Qt. The cornerstone of the library is QCoro::Task, which represents an executed coroutine and allows the result of the coroutine to be asynchronously awaited by its caller. Additionally, QCoro provides a set of wrappers for common Qt types, such as QTimer, QNetworkReply, QDBusPendingCall, QFuture and others, that allow to co_await their asynchronous operations directly.
Additionally, there's a magical qCoro() function that can wrap many native Qt functions and types to make them coroutine-friendly.
Go check the documentation for a full list of all supported features and Qt types.
QDBusPendingCall
QCoro can wait for an asynchronous D-Bus call to finish. There's no need to use QDBusPendingCallWatcher with QCoro - just co_await the result instead. While co_awaiting, the Qt event loop runs as usual.
? Full documentation here.
QFuture
QFuture represents a result of an asynchronous task. Normally you have to use QFutureWatcher to get notified when the future is ready. With QCoro, you can just co_await it!
? Full documentation here.
QNetworkReply
Doing network requests with Qt can be tedious - the signal/slot approach breaks the flow of your code. Chaining requests and error handling quickly become mess and your code is broken into numerous functions. But not with QCoro, where you can simply co_await the QNetworkReply to finish:
? Full documentation here.
QTimer
Maybe you want to delay executing your code for a second, maybe you want to execute some code in repeated interval. This becomes super-trivial with co_await:
? Full documentation here.
...and more!
Go check the full documentation to learn more.
.then() continuations
Sometimes it's not possible to use co_await to handle result of a coroutine - usually when interfacing with a 3rd party code that does not support coroutines. In those scenarios it's possible to chain a continuation callback to the coroutine which will get invoked asynchronously when the coroutine finishes.
The continuation callback can also be a coroutine and the result of the entire expression is Task where T is the return type of the continuation. Thanks to that it's possible to co_await the entire chain, or chain multiple .then() continuations.
? Full documentation here.
Generators
Generator is a coroutine that lazily produces multiple values. While there's nothing Qt-specific, QCoro provides the necessary tools for users to create custom generators in their Qt applications.
Details
C Qt 的协程
How to install qcoro6
- Open Terminal (press ⌘ + Space and type “Terminal”).
- If Homebrew is not installed yet, run the command below first.
- Run this command:
Latest 10 releases
Last updated 2026-02-13; current version v0.13.0, with the latest 10 releases listed.
| Version | Released | Type | Size | macOS | Windows | Linux |
|---|---|---|---|---|---|---|
| v0.13.0 | 2026-02-13 | Stable | — | — | — | — |
| v0.12.0 | 2025-04-03 | Stable | — | — | — | — |
| v0.11.0 | 2024-10-04 | Stable | — | — | — | — |
| v0.10.0 | 2023-12-05 | Stable | — | — | — | — |
| v0.9.0 | 2023-04-27 | Stable | — | — | — | — |
| v0.8.0 | 2023-01-31 | Stable | — | — | — | — |
| v0.7.0 | 2022-11-19 | Stable | — | — | — | — |
| v0.6.0 | 2022-07-09 | Stable | — | — | — | — |
| v0.5.1 | 2022-04-27 | Stable | — | — | — | — |
| v0.5.0 | 2022-04-25 | Stable | — | — | — | — |
Data from GitHub Releases; stable releases first, each group sorted newest first.
Compared with similar apps
Only public metadata is compared, with no subjective recommendation; see the compare pages for field-by-field comparisons.
| App | Version | License | Architecture | 30-day installs |
|---|---|---|---|---|
| qcoro6 | v0.13.0 | MIT | CLI | 6 |
| openssl@4 | openssl-4.1.0 | Apache-2.0 | CLI | 494,798 |
| xz | v5.8.4 | 0BSD AND GPL-2.0-or-later | CLI | 346,605 |
| pkgconf | pkgconf-3.0.10 | ISC | CLI | 311,054 |
Similar apps: Command-line Tools
openssl@4
Cryptography and SSL/TLS Toolkitxz
General-purpose data compression with high compression ratiopkgconf
pkgconf is a program which helps to configure compiler and linker flags for development…node
Node.js is an open-source, cross-platform JavaScript runtime environment.gh
GitHub command-line toolcmake
CMake is a cross-platform, open-source build system generator.Categories: Command-line Tools