[PyQt] No feedback on failed signal connection

Phil Thompson phil at riverbankcomputing.com
Sat May 24 10:47:57 BST 2008


On Saturday 24 May 2008 8:52:37 am Ville M. Vainio wrote:
> I'm been flailing around, trying to get SOME signal out of QListView
> to no avail (QListWidget works ok)
>
> Here is example code that silently fails:
>
>      print self.connect(self.listView, SIGNAL("foobar(QModelIndex
> *)"),  self.var_selected )
>      print self.connect(self.textEdit, SIGNAL("xxxtextChanged()"),
> self.var_selected )
>
> Both print True, and there are no error notifications on console.
>
> I'm using Ubuntu 8.04 LTS default pyqt4 packages (4.3.3-2ubuntu4)
>
>
> Also, is there a complete reference of all the values you can pass to
> SIGNAL (e.g. in source files)? It seems to be quite sensitive, e.g
> "foo*" is not same as "foo *".

If you specify a signal that it not a Qt signal then it is assumed that you 
are using a Python signal. Python signals are created on the fly, and the 
connect() will succeed.

Obviously Qt will never emit a Python signal - only your code will do that.

Phil


More information about the PyQt mailing list