Okay this problem is some what complex but anyhow;
I have a plugin which have the following definition:
(each class has its own file)
Code:
{ public: UIDialog() { setupUi(this); connect(pushButton, SIGNAL(clicked), this, SLOT(someFunction())); }; public slots: void someFunction() { accept(); }; } class Interface { public: ~Interface() {}; void function1()=0; }; Q_DECLARE_INTERFACE(Interface,"dk.bhsribe.test/1.0") { Q_OBJECT Q_INTERFACES(Interface) public: void function1() { UIDialog *win = new UIDialog() win->exec(); delete win; }; }; Q_EXPORT_PLUGIN2(inter_imlp,InterfaceImpl)
and from the main binary the plugin is loaded and a pointer to an instance of Interface
is returned like this:
Code:
void Dlg::loadPlugin(int i) { // all valid plugin filenames curInter = qobject_cast<Interface *>(loader.instance()); } void Dlg::runPlugin() { curInter->function1(); }
the designed dialog is dislpayed as designed however when I do display the dialog the
debug tells me:
warning: Object::connect: No such slot QDialog::someFunction()
and the intended action for the pushButton can not be called when I click the button.
Why does Qt think that it is QDialog::someFunction() insted of UIDialog::someFunction()
I wish to connect the pushbuttons clicked signal to?