[PyQt] Sip and virtual functions

Guðjón Guðjónsson gudjon.i.gudjonsson at gmail.com
Wed Jan 3 09:53:19 GMT 2018


Hi list

I have been writing a new python wrapper for the Qwt library [1,2]
And I still have problems with virtual function definitions.
I got the advice to add the /Abstract/ keyword to the class definitions
and this has led to the full wrapper compiling but running with the
following error messages:

NotImplementedError: QwtPlotHistogram.dataSize() is abstract and must be
overridden
TypeError: Qwt.QwtPlotMultiBarChart represents a C++ abstract class and
cannot be instantiated

I have also been playing with setting virtual functions = 0 or not. This
led to a missing
symbols error but with the /Abstract/ keyword in the right  place this
error has disappeared.

There is a patch for the Qwt c++ library on Github that instantiates the
pure virtual functions
and by using that patch my python wrapper works perfectly but the wrapper
must work
without the patch.


Regards
Gudjon

Ps. I got the advice earlier to use template functions in the sip files.

I would very much prefer to get the wrapper working without any patches to Qwt

first and then change to template classes and functions.


[1] Qwt library:http://qwt.sourceforge.net/

[2] My python wrapper:https://github.com/GauiStori/PyQt-Qwt
[3] https://riverbankcomputing.com/pipermail/pyqt/2017-January/038480.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20180103/ecf47d60/attachment.html>


More information about the PyQt mailing list