June 2018
Intermediate to advanced
348 pages
8h 45m
English
As mentioned previously, the Qt framework has a robust event mechanism. We need to bridge between the Qt and RxCpp scheme of things. To get started with this application, we are going to write a header file, rx_eventfilter.h, wrapping the required RxCpp headers and the Qt event filter:
#include <rxcpp/rx.hpp>
#include <QEvent>
namespace rxevt {
// Event filter object class
class EventEater: public QObject {
Public:
EventEater(QObject* parent, QEvent::Type type, rxcpp::subscriber<QEvent*> s):
QObject(parent), eventType(type), eventSubscriber(s) {}
~EventEater(){ eventSubscriber.on_completed();}
The <rxcpp/rx.hpp> library is included to get the definitions for RxxCppsubscriber and observable, which we use ...