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

Creating the channel base and derived classes

Before implementing the Bluetooth flavor of the channel initialization method, we need to create the abstract base class that will provide method signatures for all broadcast channel implementations. We create a class named BroadcasterChannel, with the header file broadcaster_channel.h and source broadcaster_channel.cpp, to provide a little functionality common to all specialized class implementations.

In the header file, we define the init method as a virtual function, and the constructor as protected, as it will only be invoked by concrete subclasses of this abstract class:

#ifndef BROADCASTER_CHANNEL_H#define BROADCASTER_CHANNEL_H#include <QObject>#include <QList>#include <QVariantMap>namespace ...

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