[PyQt] Old style signals/slots: Some parameter types don't work in 4.7.4/4.7.5 that did work in 4.7.2
Phil Thompson
phil at riverbankcomputing.com
Thu Sep 2 14:50:47 BST 2010
On Thu, 2 Sep 2010 15:21:16 +0200, Tim dos Santos
<dos.santos at physik.uni-wuppertal.de> wrote:
> Hi list,
>
>
> I developed a little log viewer app in QT 4.6.2, PyQT 4.7.2 (sip 4.10.1)
> on
> linux. In it, I often used signals/slots like the following:
>
>
> QObject.connect(self.model, SIGNAL("dataLoaded(list)"), self.dataLoaded)
>
> ...
>
> def dataLoaded(self, foo):
> print len(foo) # foo is a list
>
>
> Now, I tried to run this app (unchanged) on a machine with QT 4.7
> (qtsdk-2010.04), with PyQT 4.7.4 (sip 4.10.5) and also with PyQT 4.7.5
> (sip
> 4.11), and I get this error:
>
> exceptions.TypeError: type 'list' is not supported as a slot argument
type
>
> (in 4.7.5, it reads: "exceptions.TypeError: C++ type 'list' is not
> supported
> as a slot argument type")
>
>
> did the API change? Is this intended? How could I pass python lists now
> from
> python code to python code through a signal/slot? The new behaviour also
> makes onSelectionChanged events from a QListView not work anymore...
As far as I can remember that style was never documented/supported. If you
want to pass a Python type then use PyQt_PyObject, see...
http://www.riverbankcomputing.com/static/Docs/PyQt4/pyqt4ref.html#the-pyqt-pyobject-signal-argument-type
Phil
More information about the PyQt
mailing list