[PyKDE] signal with return value

Phil Thompson phil at riverbankcomputing.co.uk
Fri Nov 10 18:26:27 GMT 2006


On Friday 10 November 2006 4:12 am, hok kakada wrote:
> Hi,
>
> 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"),
> self.operator.makeNewHeader)
>
> 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?

SIP/PyQt do not support returning values from signals.

Phil




More information about the PyQt mailing list