[PyQt] Autoconnecting two signals to the same method.

Algis Kabaila akabaila at pcug.org.au
Sat Mar 15 22:15:32 GMT 2008


> Date: Sat, 15 Mar 2008 12:05:43 +0100
> From: "Rocco Orlando Rossi" <rocco.rossi at gmail.com>
> Subject: Re: [PyQt] Autoconnecting two signals to the same method.
> To: "Phil Thompson" <phil at riverbankcomputing.com>
> Cc: pyqt at riverbankcomputing.com
> Message-ID:
> 	<720198610803150405o1995a4d7y5085345892b12852 at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Uhmmmmm ... I've just realized that the whole pyqtSignature decorator is
> implemented in C++. Therefore I'm afraid there's nothing much I can
> personally do regarding this issue. I'm a C and Python programmer, but,
> unfortunately absolutely no C++ :(
>
Rocco,

I read the above as saying that decorators are only in C++.  Not so.  They are 
implemented in Python, too.  The implementation may well be a "wrapper" of a 
C++ code, but why you or I should care?  Like you, I am new to PyQt, though 
being very  old, I am hardly new to anything... Important thing is that 
decorators are in Python and they do work in Python, even though AFAIK they 
were introduced to it recently.

You are lucky - you are a C programmer.  I am not a programmer at all, though 
I use and love Python and have programmed and sometimes taught  a whole range 
of programming languages - George II, Fortran, APL, Basic, Pascal...

So don't feel alone amongst these masters of PyQt. like Phil, Andreas etc,  
Mugs like I read with interest your mail, too!

Kind regards,
OldAl. 

> I do hope though that maybe someone can implement the functionality we've
> been discussing,
>
> Thank you.
>
> 2008/3/15, Rocco Orlando Rossi <rocco.rossi at gmail.com>:
> > Yes. That would really be nice.
> >
> > If you think it's possible to make it work, I'll give it a try myself,
> > although my own experience with decorators is at the moment rather
> > limited
> >
> > :) But I'm doing some study in that respect.
> >
> > It would definitely be cool if this functionality were implemented,
> > because I have the feeling it's not the kind of rare need that comes up
> > only once in a while.
> >
> > 2008/3/15, Phil Thompson <phil at riverbankcomputing.com>:
> > > On Saturday 15 March 2008, Rocco Orlando Rossi wrote:
> > > > Thanks.
> > > >
> > > > OK. I understand that.
> > > >
> > > > And what if the decorator @QtCore.pyqtSignature were modified to
> > >
> > > accept
> > >
> > > > more than one argument, so that you could do something like the
> > >
> > > following?
> > >
> > > > @QtCore.pyqtSignature("on_pushButton1_clicked()",
> > > > "on_pushButton2_clicked()")
> > > >     def on_pushButton_clicked(self):
> > > >         print "Hi Man!"
> > > >
> > > > Perhaps this is something that can be achieved.
> > > >
> > > > What do you think?
> > >
> > > That may break other uses of pyqtSignature(). However I don't see why
> > > the
> > > following shouldn't be made to work...
> > >
> > >     @QtCore.pyqtSignature("on_pushButton1_clicked()")
> > >     @QtCore.pyqtSignature("on_pushButton2_clicked()")
> > >
> > >     def on_pushButton_clicked(self):
> > >         print "Hi Man!"
> > >
> > >
> > > Phil
> > >
> > > _______________________________________________
> > > PyQt mailing list    PyQt at riverbankcomputing.com
> > > http://www.riverbankcomputing.com/mailman/listinfo/pyqt
> >
> > --
> > Rocco Rossi
> >
> > -----------------------------------------------------------------
> >
> > "Alcuni vedono le cose come sono e dicono perché? Io sogno cose non
> > ancora esistite e chiedo perché no?"
> >
> > G.B. Shaw



-- 
Algis Kabaila (Dr)
http://akabaila.pcug.org.au/StructuralAnalysis/



More information about the PyQt mailing list