I have an interface class in C++ that consists of pure virtual member functions, which I want to make parent of all the QWidgets
in my app. It has lots of signals and slots, so it must inherit from QObject
. The problem is that I can't make my other objects derive from this:
class Interface : public QObject {
public slots:
virtual void slotA() = 0;
signals:
void signalA();
};
Now if I want to create a widget implementing this interface I would need to do something like
class MyWidget : public QWidget, public Interface {
};
This however can't be done because it can't inherit twice from QObject
. How can I do this?
Note: QObject Multiple Inheritance does not answer to this as it does not post a satisfatory answer in my opinion