danvratil / qcoro

C++ Coroutines for Qt
https://qcoro.dvratil.cz
MIT License
326 stars 53 forks source link

Add support for connecting signals with QPrivateSignal #193

Closed danvratil closed 10 months ago

danvratil commented 10 months ago

Initial commit that adds support for co_awaiting signals with QPrivateSignal in their signature ("private signals"). This basically requries detecting the QPrivateSignal type in the arguments and omitting it when preparing the holder for signal parameters and when storing the signal parameters into the result holder.

Currently the QPrivateSignal detection is using a bit whacky hack, but I couldn't figure out anything better due to the QPrivateSignal always being a private struct in the sender class, so we cannot access it from QCoro to do e.g. std::same_as check.