[PyKDE] signal with return value

hok kakada hokkakada at khmeros.info
Fri Nov 10 04:12:09 GMT 2006


I am not sure whether we can use signal for return value or not.

Let me give you my example:
I have 3 different classes: Main.py, Header.py, and Operator.py

In Main.py:
self.connect(self.headerDialog, QtCore.SIGNAL("makeHeader"), 

in Header.py
userProfileDic = {'charset':"CHARSET", 'encoding':"ENCODING", 
'project_id_version':None, 'pot_creation_date':None, 'po_revision_date':None, 
'last_translator':str(Last_Translator), 'language_team':str(Language_Team), 
'mime_version':None, 'plural_forms':None, 'report_msgid_bugs_to':None}
userProfileDic = self.emit(QtCore.SIGNAL("makeHeader"), userProfileDic)

in Operator.py
def makeNewHeader(self, headerDic):    
          header = self.store.makeheader(**headerDic)
          return po.poheader.parse(str(header))
The goal here is I emit makeHeader signal in Header.py and through in 
userProfileDic to makeNewHeader(self, headerDic) slot in Operator.py.
As a result, I want to get the str(header) back for other use. in Header.py

Unfortunately, the result I got is None. 
Can anybody give me a hint on how do this?

Lots of thanks,

Ms. Hok Kakada
Open Source Engineer
KhmerOS project
H/P:012 653 155

More information about the PyQt mailing list