[PyKDE] Static member functions
Hihn, Jason
Jason.Hihn at verint.com
Tue Dec 14 20:37:46 GMT 2004
Followup: I seem to have found sender(), but I get the usual 'you can't
do this because it was not created in python' error.
So I still don't know how to go about it. Here's a sample class that I
just typed up:
class testDlg:
def __init__(self):
self.dlg=QWidgetFactory.create('lineedit.ui') #just a
dialog with 2 lineedit boxes named lineedit1 and lineedit2, clicking
between them should print out different instances
self.dlg.connect(self.dlg.child('lineedit1'),
SIGNAL('lostFocus()'), self.lostFocus)
def lostFocus(self):
print self.dlg.sender() # error here
def show(self):
self.dlg.show()
if __name__=='__main__':
d=testDlg()
d.show()
qApp.exec_loop()
> -----Original Message-----
> From: pykde-bounces at mats.imk.fraunhofer.de [mailto:pykde-
> bounces at mats.imk.fraunhofer.de] On Behalf Of Hihn, Jason
> Sent: Tuesday, December 14, 2004 3:20 PM
> To: Phil Thompson; Diez B. Roggisch
> Cc: pykde at mats.imk.fraunhofer.de
> Subject: RE: [PyKDE] Static member functions
>
>
> I think this is exactly what I want, but I do not know how to use it.
>
> Can I get an example in PyQt?
>
> Thanks again!
>
> > -----Original Message-----
> > From: pykde-bounces at mats.imk.fraunhofer.de [mailto:pykde-
> > bounces at mats.imk.fraunhofer.de] On Behalf Of Phil Thompson
> > Sent: Tuesday, December 14, 2004 11:09 AM
> > To: Diez B. Roggisch
> > Cc: pykde at mats.imk.fraunhofer.de
> > Subject: Re: [PyKDE] Static member functions
> >
>
> > > Hi,
> > >
> > > I think I understand your problem as follows: You have a non-
> > parametrized
> > > signal, lostFocus, that you want to connect to one slot - but then
> > somehow
> > > "magically" there shall be a reference to the object the signal
came
> > from
> > > is
> > > passed.
> >
>
> > If that's the case then just use QObject.sender(). The slot must be
a
> > method of a QObject derived class - but that wouldn't seem to be a
> problem
> > in this case.
> >
>
> > Phil
> >
>
> > _______________________________________________
> > PyKDE mailing list PyKDE at mats.imk.fraunhofer.de
> > http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
>
>
>
>
________________________________________________________________________
__
> ________________
> This electronic message may contain proprietary and confidential
> information of Verint Systems Inc., its affiliates and/or
subsidiaries.
> The information is intended to be for the use of the individual(s) or
> entity(ies) named above. If you are not the intended recipient (or
> authorized to receive this e-mail for the intended recipient), you may
not
> use, copy, disclose or distribute to anyone this message or any
> information contained in this message. If you have received this
> electronic message in error, please notify us by replying to this
e-mail.
> (1)
>
> _______________________________________________
> PyKDE mailing list PyKDE at mats.imk.fraunhofer.de
> http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
__________________________________________________________________________________________
This electronic message may contain proprietary and confidential information of Verint Systems Inc., its affiliates and/or subsidiaries.
The information is intended to be for the use of the individual(s) or
entity(ies) named above. If you are not the intended recipient (or authorized to receive this e-mail for the intended recipient), you may not use, copy, disclose or distribute to anyone this message or any information contained in this message. If you have received this electronic message in error, please notify us by replying to this e-mail. (1)
More information about the PyQt
mailing list