The following situation:
I have a class (Parent
) in DLL A which has a signal (which is final). I have a class (Child
) in DLL B that inherits from A. I import both DLLs to my project. Then I have a class in my project get an instance of the Child
class and try to connect the signal of the Child
instance to the current object. Somehow this connection fails. Running the whole thing in debug mode only gives me: QObject::connect: signal not found in Child
. Checking the dumpbin shows me that the signal is in DLL A but not in DLL B. Both the class Parent
and the class Child
have the proper export statements but somehow the the signal for the Child
class doesn't get exported. Here is the whole thing as code:
a.dll:
class DLLA_SHAREDEXPORT ParentInterface{
public:
~ParentInterface(){}
virtual void test() = 0;
};
Q_DECLARE_INTERFACE(ParentInterface, "ParentInterface")
class DLLA_SHAREDEXPORT Parent : public QObject,
public ParentInterface{
Q_OBJECT
Q_INTERFACES(ParentInterface)
...
signals:
void test();
}
b.dll:
class DLLB_SHAREDEXPORT Child : public Parent{
Q_OBJECT
...
}
class in project:
class SomeClass : public QObject{
Q_OBJECT
public:
...
void someFunction(){
Parent* c = getChildObject(); //some call to get the Object of class Child
QObject::connect(c, &Parent::test,
this, &SomeClass::handle_test);
//QObject::connect: signal not found in Child
}
}
public slots:
void handle_test(){
//do something
}
}
So the problem seems to be somewhere is the proper export of everything in the DLL B but I can't figure out how to do it. Any help would be appreciated.