#include <rpp/rpp.hpp>
#include <rppqt/rppqt.hpp>
#include <QApplication>
#include <QLabel>
#include <QMainWindow>
#include <QPushButton>
#include <QVBoxLayout>
#include <iostream>
int main(int argc, char** argv)
{
QApplication app{argc, argv};
auto button = new QPushButton("Click me!");
auto label = new QLabel();
| rpp::ops::tap([](int) { std::this_thread::sleep_for(std::chrono::milliseconds{500}); })
label->setText(QString{"Clicked %1 times in total!"}.arg(clicks));
});
QMainWindow window{};
auto vbox = new QVBoxLayout();
vbox->addWidget(button);
vbox->addWidget(label);
window.setCentralWidget(new QWidget);
window.centralWidget()->setLayout(vbox);
window.show();
return app.exec();
}
Scheduler which schedules invoking of schedulables to another thread via queueing tasks with priority...
Definition new_thread.hpp:31
Schedule provided schedulables to main GUI QT thread (where QApplication placed)
Definition main_thread.hpp:32
auto from_signal(const TObject &object, R(TSignalQObject::*signal)(Args...))
Creates rpp::observable that emits a items from provided QT signal.
Definition from_signal.hpp:76
auto subscribe(observer< Type, ObserverStrategy > &&observer)
Subscribes passed observer to emissions from this observable.
Definition subscribe.hpp:226
auto observe_on(Scheduler &&scheduler, rpp::schedulers::duration delay_duration={})
Specify the Scheduler on which an observer will observe this Observable.
Definition observe_on.hpp:38