Hi,
i have a object in my UI thread and i send a pointer of this object to another thread then i emit a signal of object but connected slot don't called:
...
void checkMyEvents() [
...
emit processfinished();
...
}
void start() {
...
othread->start();
...
}
signals:
void processfinished();
private:
MyThread* otherad;
}
{
public:
void run() {
...
obj->checkMyEvents();
...
}
MyObject* obj;
}
main() {
....
MyObject obj;
QObject::connect(&obj,
SIGNAL(processfinished
()),
&anotherObj,
SLOT(showresults
());
....
}
class MyObject : public QObject {
...
void checkMyEvents() [
...
emit processfinished();
...
}
void start() {
...
othread->start();
...
}
signals:
void processfinished();
private:
MyThread* otherad;
}
class MyThread : public QThread
{
public:
void run() {
...
obj->checkMyEvents();
...
}
MyObject* obj;
}
main() {
....
MyObject obj;
QObject::connect(&obj, SIGNAL(processfinished()), &anotherObj, SLOT(showresults());
....
}
To copy to clipboard, switch view to plain text mode
in debug mode i can see signals emitted but slot don't call 
whats wrong in my code?
Bookmarks