[PyQt] Connect and signal question

Phil Thompson phil at riverbankcomputing.com
Wed Sep 23 14:06:06 BST 2009


On Wed, 23 Sep 2009 15:01:24 +0200, Michele Petrazzo - Unipex
<michele.petrazzo at unipex.it> wrote:
> Hi all,
> I'm trying to use qt/pyqt for the first time and I found the first
> problems...
> I see that when I connect a signal to a widget, if I create a wrong
> signal, qt don't say me that I'm wrong let me crazing to find why qt
> don't call my callback... So, there is a method for say to qt to warning
> me?
> 
> Example:
> 
> right:
> self.connect(self.my_rb, QtCore.SIGNAL("toggled(bool)"), self._evt_my_rb)
> wrong:
> self.connect(self.my_rb, QtCore.SIGNAL("toggled()"), self._evt_my_rb)

Assuming you have a recent version then use the new connection syntax...

    self.my_rb.toggled.connect(self._evt_my_rb)

Phil


More information about the PyQt mailing list