emit not working in constructor
Consider the scenario:
I have 3 CLASS. 1st and 2nd CLASS can be accessed via 3rd CLASS..So i place a connect() inside 3rd CLASS connecting 1st CLASS signal() to 2nd CLASS slot().....But if i place my emit signal in 1st CLASS constructor, its not hitting the slot in 2nd CLASS....But in 1st CLASS, if i place a timer and in its timeout() i emit the signal then appropriate slot is called in 2nd CLASS...
I need to know the reason why emit is not valid inside 1st CLASS constructor....
NOTE: 2nd CLASS object is created before 1st CLASS..So there should not have been a problem with calling emit() from 1st CLASS constructor....
Re: emit not working in constructor
Show the code : crystal ball does not work.
PS.
To connect the signal to the slot you first need to create a sender and receiver objects. Thus, the emission signal in the constructor of the sender does not make any sense.
Re: emit not working in constructor
Its simple CLASS1 is not created when signal is emitted.Since you have given in constructor of CLASS1 it will not work.
Re: emit not working in constructor
Thank for the reply....I got it now.........
Re: emit not working in constructor
Quote:
Originally Posted by
vinothrajendran
Consider the scenario:
I have 3 CLASS. 1st and 2nd CLASS can be accessed via 3rd CLASS..So i place a connect() inside 3rd CLASS connecting 1st CLASS signal() to 2nd CLASS slot().....But if i place my emit signal in 1st CLASS constructor, its not hitting the slot in 2nd CLASS....But in 1st CLASS, if i place a timer and in its timeout() i emit the signal then appropriate slot is called in 2nd CLASS...
I need to know the reason why emit is not valid inside 1st CLASS constructor....
NOTE: 2nd CLASS object is created before 1st CLASS..So there should not have been a problem with calling emit() from 1st CLASS constructor....
see example *URL removed by moderator*