02-13-2013 07:58 AM
Hi,
I am developing a static library which will be included in a caccades application. In the static library I want to use the SIGNALS and slots.
The problem is for example if I have the following class:
class MyLibClass:public QObject{
Q_OBJECT
public:
void aMethod();
public slots:
void aSlot();
}and when I include the library in my cascade app, I get linker error when compiling. I understand this is because of the Q_OBJECT macro which has not been procecced by qmake in my static library project. But I dont know how to run qmake before the qcc.
What is the standard (and easiest) way of having the signal/slot handling in me shared library?
Please let me know if I am missing any information in this regard.
Thanks
02-13-2013 10:25 AM
Is that all the code of your class?
Try this if so:
#include <QObject>
class MyLibClass:public QObject{
Q_OBJECT
public:
MyLibClass(QObject *parent=0) : QObject(parent) { }
void aMethod();
public slots:
void aSlot();
}
I'm not sure what the problem is if this does not resolve your problem.
02-13-2013 11:14 AM
Thanks Curahee. I did not want to bore people with all the code I wrote. Besides my project is quite large to be shared here. That's why I gave a cut down version. Moreover, this seems to be a spoken over subject. Had I not included
#include <QObject>
it would have failed during compilation and I wouldn't have progressed up to the linking stage.