[PyKDE] signal with return value
hok kakada
hokkakada at khmeros.info
Mon Nov 13 12:05:54 GMT 2006
On Saturday 11 November 2006 01:26, Phil Thompson wrote:
> 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.
Ok, so my solution would be ping and pong.i.e. sending signal back and forth.
da
> Phil
>
> _______________________________________________
> PyKDE mailing list PyKDE at mats.imk.fraunhofer.de
> http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
--
Ms. Hok Kakada
Open Source Engineer
KhmerOS project
H/P:012 653 155
More information about the PyQt
mailing list