Can't receive signal from different thread if event(..) is redefined
-
Hello,
Code is specially simplified. the construction like below doesn't works i.e. TestWidget doesn't receives signal; but if we comment bool Event(QEvent* event); everything works fine. Is it known bug or my code is wrong? Signals from buttons and i.e. works fine.@class TestWidget : public QWidget {
Q_OBJECT
public:
TestWidget(QWidget* parent):QWidet(parent)
{
TestThread* t = new TestThread;
connect(t,SIGNAL(test_signal),this,SLOT(test_slot));
t->start();
}
private slots:
void test_slot();
protected:
bool event(QEvent* event){return false;}
}QTestThread: public QThread
{
Q_OBJECT;
public:
QThread(QObject* parant=0):QThread(parent){}
protected:
void run()
{
emit test_signal();
}
signals:
void test_signal();
}@