Ok so I changed so only the interface derived from QObject and the class inherit from the interface, like below. However I am not sure how to handle the passing of the parent object to the base class. I guess without this I will loose the memory managment, or? See comment in the source file below:
#include <QObject>
class ICallHandler : public QObject
{
public:
virtual ~ICallHandler(){};
public slots:
virtual void onIncomingCall() = 0;
};
and for the class implementing the interface:
#include <QObject>
class CallHandler : public ICallHandler
{
Q_OBJECT
public:
CallHandler(QObject *parent);
~CallHandler();
public slots:
void onIncomingCall();
};
and for the source file:
#include "callhandler.h"
CallHandler::CallHandler(QObject *parent)
: ICallHandler() //How handle the parent object here?
{
}
CallHandler::~CallHandler()
{
}
void CallHandler:nIncomingCall()
{}
Bookmarks