O'Reilly logo

Qt 5 Projects by Marco Piccolino

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Subclassing the ReceiverChannel

Just like we did for BroadcasterChannel, we will implement the abstract ReceiverChannel API that we have already created for the Bluetooth implementation in Chapter 8, Building a Mobile Dashboard to Display Real-Time Sensor Data. To do so, we will add a ReceiverHttp class to the already existing channel_receiver.pri file. The following is the header file containing the class, which extends ReceiverChannel:

// receiver_http.h#ifndef RECEIVER_HTTP_H#define RECEIVER_HTTP_H#include <QObject>#include "receiver_channel.h"namespace channels {class ReceiverHttp : public ReceiverChannel{    Q_OBJECTpublic:    explicit ReceiverHttp(QObject *parent = nullptr);    ~ReceiverHttp();    Q_INVOKABLE void init() override;public slots: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required