I have a plugin interface
class TestInterface : public QObject
{
public:
virtual ~TestInterface () { }
virtual QString Description () = 0;
virtual int ID() = 0;
virtual bool setImplementation(QWidget* parent,QString fname) = 0;
signals:
void OnNewConfig (QString string);
};
Q_DECLARE_INTERFACE(TestInterface ,"xxxx/1.0")
In my client I implemented the slot with the same signature as OnNewConfig and I am trying to connect signal of the plugin to a slot at the client. When I retrieve interface from plugin I am doing following:
TestInterface* interface = <retrieve from plugin>
connect(interface, SIGNAL(OnNewConfig(QString)), this, SLOT(OnNewConfig(QString)));
Connect fails, in debug I see that it fails in if (signal_index < 0) {
err_method_notfound(QSIGNAL_CODE, sender, signal, "connect"); of the bool QObject::connect method.
My Questions are: Can Signal/slot mechanism be used in plugins
How to do it correctly (apparently I am doing something wrong but don't see what exactly).
Bookmarks