hubbobubbo
13th January 2010, 17:47
Hi
I am building a dll and I want the user of the dll to pass certain objects to this dll. My intention is to provide an interface to the user but I am not sure if this is the right approach or if it is applicable to Qt.
My idea was something like this:
class ICallHandler
{
public:
virtual ~ICallHandler(){};
//public slots:
virtual void onIncomingCall() = 0;
};
However if I try to put the Qt includes in this .h file I get alot of errors because of multiple inheritance. The other class that would implement the interface would look like this:
#include ".\Interfaces\ICallHandler.h"
#include <QObject>
class CallHandler : public QObject, public ICallHandler
{
Q_OBJECT
public:
CallHandler(QObject *parent);
virtual ~CallHandler();
virtual void onIncomingCall();
};
I guess I could live without defining
public slots:
in the interface .h file but I am not sure if I am doing this the right way. Does any one have suggestions on the best way to achive this. The goal is that the user of the dll should provide a pointer to a class following this interface when calling the dll since I want to connect some signals to slots inside the dll.
Thanks
I am building a dll and I want the user of the dll to pass certain objects to this dll. My intention is to provide an interface to the user but I am not sure if this is the right approach or if it is applicable to Qt.
My idea was something like this:
class ICallHandler
{
public:
virtual ~ICallHandler(){};
//public slots:
virtual void onIncomingCall() = 0;
};
However if I try to put the Qt includes in this .h file I get alot of errors because of multiple inheritance. The other class that would implement the interface would look like this:
#include ".\Interfaces\ICallHandler.h"
#include <QObject>
class CallHandler : public QObject, public ICallHandler
{
Q_OBJECT
public:
CallHandler(QObject *parent);
virtual ~CallHandler();
virtual void onIncomingCall();
};
I guess I could live without defining
public slots:
in the interface .h file but I am not sure if I am doing this the right way. Does any one have suggestions on the best way to achive this. The goal is that the user of the dll should provide a pointer to a class following this interface when calling the dll since I want to connect some signals to slots inside the dll.
Thanks