[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: [PyQt] need help with new signals
From: Phil Thompson <phil () riverbankcomputing ! com>
Date: 2012-10-24 16:49:29
Message-ID: 5e337f0d045353bb2834f417f1b58ce3 () localhost
[Download RAW message or body]
On Tue, 23 Oct 2012 22:30:12 +0100, Matthew Ngaha <chigga101@gmail.com>
wrote:
> im trying to figure out how i can change the old signal syntax to new.
the
> program im reading through creates a widget that inherits from QSpinBox.
>
> zerospinbox = ZeroSpinBox()
>
> It then emits its custom signal, then that signal is connected to a
python
> method. Here are the 2 codes i need help converting.
>
> self.emit(SIGNAL("atzero"), self.zeros) #this is zerospinbox
emitting
> a custom "atzero" signal
>
> self.connect(zerospinbox, SIGNAL("atzero"), self.announce) #and
here
> is the same signal being connected to a python method.
The above code doesn't look right - "atzero" is not a proper signature.
> As you can see this code example uses the old style syntax, can anyone
> please convert it for me into the newer style syntax.
Assuming atzero has been defined properly with pyqtSignal(), then to
emit...
self.atzero.emit(self.zeros)
...and connect...
zerospinbox.atzero.connect(self.announce)
Phil
_______________________________________________
PyQt mailing list PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic