ReactivePlusPlus
ReactiveX implementation for C++20
Loading...
Searching...
No Matches

RppQt is extension of RPP which enables support of Qt library. More...

Topics

 QT Operators
 QT Operators is set of RPP operators but applied to QObjects.
 
 QT Schedulers
 Scheduler is the way to introduce multi-threading in your application via RPP.
 

Detailed Description

RppQt is extension of RPP which enables support of Qt library.

RppQt is set of wrappers to connect QT world with RPP.

Example:
auto button = new QPushButton("Click me!");
auto label = new QLabel();
rppqt::source::from_signal(*button, &QPushButton::clicked) // <------ react on signals
| rpp::ops::tap([](int) { std::this_thread::sleep_for(std::chrono::milliseconds{500}); }) // some heavy job
| rpp::operators::scan(0, [](int seed, auto) { return ++seed; })
| rpp::operators::observe_on(rppqt::schedulers::main_thread_scheduler{}) // <--- go back to main QT scheduler
| rpp::operators::subscribe([&label](int clicks) {
label->setText(QString{"Clicked %1 times in total!"}.arg(clicks));
});