[PyQt] PyQwt Signals [Was: Old vs New Signals]

Phil Thompson phil at riverbankcomputing.com
Thu Jul 12 13:25:11 BST 2012

Taking your examples in turn...

self.picker.connect(self.picker, SIGNAL('selected(QwtPolygon)'),

...this works as expected.


...this doesn't work because...

- PyQwt does not expose QwtPolygon as a Python type
- selected(QwtPolygon) is a signal of QwtPicker, not QwtPlotPicker
- the call to connect() is missing

The following is correct...

super(QwtPlotPicker, self.picker).selected.connect(self.slotQwtPolygon)

The following is also correct and would be needed if QwtPicker.selected()
was overloaded and the 'QwtPolygon' overload was not the default...

super(QwtPlotPicker, self.picker).selected['QwtPolygon'].connect(

These work because PyQwt has told sip how to convert a C++ QwtPolygon to a
Python object.

The last two examples...

        SIGNAL('selected(QwtArray<QwtDoublePoint>)'), self.slotQwtArray)



...can never work because PyQwt hasn't told sip how to convert a C++
QwtArray<QwtDoublePoint> to a Python object. This is a PyQwt bug. It
should provide a %MappedType for QwtArray<QwtDoublePoint>.


More information about the PyQt mailing list