Hello everyone,

i'm trying to let the user draw a curve on my plot canvas, to emit a signal after releasing the mouse and send the array of points to another method for further processing.

Right now my code looks like this:

Qt Code:
  1. (...)
  2. self.plotPicker = Qwt.QwtPlotPicker(Qwt.QwtPlot.xBottom, Qwt.QwtPlot.yLeft, Qwt.QwtPicker.PolygonSelection, Qwt.QwtPlotPicker.PolygonRubberBand, Qwt.QwtPicker.AlwaysOn, plot.canvas())
  3. self.plotPicker.setRubberBandPen(QPen(Qt.green))
  4. self.plotPicker.setTrackerPen(QPen(Qt.cyan))
  5. self.connect(self.plotPicker, SIGNAL('selected(const QwtArrayQwtDoublePoint &)'), self.onSelection)
  6.  
  7.  
  8. def onSelection(self, points):
  9. print 'i got triggered'
To copy to clipboard, switch view to plain text mode 

This does not work, the method does not get triggered. If i replace QwtPicker.PolygonSelection with QwtPicker.PointSelection and change the SIGNAL accordingly it works just fine.

Where am i going wrong here? Thanks a lot in advance!