[Tutor] PyQT's signals and slots *correction

Brendon bren@europe.nl.com
Mon, 2 Jul 2001 13:08:42 +0200


On Monday 02 July 2001 10:08, you wrote:
> On Sun, 1 Jul 2001, Brendon wrote:
> > On Sunday 01 July 2001 12:43, you wrote:
> >
> >  	self.buttonConnect.connect(self.buttonConnect, SIGNAL("clicked()"),
> > ????, SLOT("conJ()")
>
> ??? = the object with the SLOT,
>       which itself is just a method (as you surmised)
>
> However, I think what you want is...
>
> self.connect(self.buttonConnect, PYSIGNAL("clicked()"), self.conJ)
>
> i.e., the widget connects the buttons "clicked" signal to the
> widgets's conJ method.  It is a PYSIGNAL because you are connecting
> between your own objects, not to Qt.

unless it was created in the class of a custom QT widget, correct? it seems 
to work fine with "SIGNAL".

> If your button was (say) a "quit" button (needed to signal the app),
> the connect() would have the fourth argument, and look like...
>
> self.connect(self.buttonConnect,SIGNAL('clicked()'),qApp,SLOT('quit()'))
>
> ...or so I gathered from translating the Qt tutorials into PyQt
> (awhile ago, and I haven't played with it much since, so don't be
> too surprised if I steered you wrong :)

which was what i ve been using to learn PyQT, it's a small world ;)

Brendon
-- 

"if we live by an "eye for an eye and a tooth for a tooth"...before long, 
the whole world will be blind and toothless." 
         --Tevye, Fiddler on the Roof