eQrt
19th November 2011, 12:17
Hi,
as far as I know there is no way to emit a signal and retrieve the value returned by the matching connected slot (please correct me if I am wrong).
So, how big a crime is it if i pass a parameter as an "out_value" to the slot, and the slot writes its return value in that "out_value" pointer?
something like:
self.connect( self, SIGNAL("mysignal(param,param)"), self.myslot )
self.out_var = {}
emit( SIGNAL( "mysignal(param,param)"), paramval1,self.out_var ) // slot is now executed, and return value
// is written to self.out_var
return_value = self.out_var['return']
and myslot :
def myslot(self,param1,param2):
param2['return'] = param1+param2;
return param2;
as far as I know there is no way to emit a signal and retrieve the value returned by the matching connected slot (please correct me if I am wrong).
So, how big a crime is it if i pass a parameter as an "out_value" to the slot, and the slot writes its return value in that "out_value" pointer?
something like:
self.connect( self, SIGNAL("mysignal(param,param)"), self.myslot )
self.out_var = {}
emit( SIGNAL( "mysignal(param,param)"), paramval1,self.out_var ) // slot is now executed, and return value
// is written to self.out_var
return_value = self.out_var['return']
and myslot :
def myslot(self,param1,param2):
param2['return'] = param1+param2;
return param2;