[PyQt] PyQwt and QwtPlotRasterItem

Matti Lyra matti.lyra at gmail.com
Tue Aug 31 16:44:12 BST 2010

I'm trying to add a raster element on top of a plot created with PyQwt but I get the following error when invoking the raster item constructor.

    self.crosshair = Qwt.QwtPlotRasterItem("path/to/img.png")

results in

    TypeError: PyQt4.Qwt5.Qwt.QwtPlotRasterItem represents a C++ abstract class and cannot be instantiated

I get the same error trying to load a JPEG or omitting the path altogether. It doesn't say in the Qwt docs that the class is abstract and in the PyQwt docs it says that the class is fully implemented.

[Qwt docs] : http://qwt.sourceforge.net/class_qwt_plot_raster_item.html
[PyQwt docs] : http://pyqwt.sourceforge.net/doc5/reference.html#PyQt4.Qwt5.QwtPlotRasterItem

What to do??

More information about the PyQt mailing list