class INotifyer { virtual ~INotifyer() {} virtual void someSignal() = 0; virtual void someSlot() = 0;};class Notifyer : public QObject, public INotifyer { Q_OBJECTsignals: virtual void someSignal() = 0;public slots: virtual void someSlot() = 0;};class IPlugin { virtual ~IPlugin() {} virtual INotifyer* notifyer() = 0;};class Plugin : public IPlugin { Q_OBJECT Q_INTERFACES(IPlugin)public: INotifyer* notifyer() { if (!m_Notifyer) m_Notifyer = new Notifyer(); return m_Notifyer; }private: Notifyer *m_Notifyer;};
emit m_Notifyer->someSignal()
connect(plugin->notifyer(), SIGNAL(someSignal()), this, SLOT(applicationSlot()));
virtual QObject *instance() = 0;
virtual QObject *instance() { return this; }
connect(plugin->notifyer()->instance(), SIGNAL(someSignal()), this, SLOT(applicationSlot()));
class INotifyer : public QObject { virtual ~INotifyer() {} virtual void someSignal() = 0; virtual void someSlot() = 0;};class Notifyer : public INotifyer { Q_OBJECTsignals: void someSignal();public slots: void someSlot();};