[PyQt] Sip and pure virtual functions

Guðjón Guðjónsson gudjon.i.gudjonsson at gmail.com
Wed Jan 4 08:16:11 GMT 2017

Hi list

I have been writing a python wrapper to the qwt6 library. It is new code,
build on PyQwt5.

Qwt library:

My python wrapper:

I do have a problem with pure virtual functions in Qwt. My solution is to
provide a default implementation for these functions but I really don't like
adding a patch to the Qwt library.

The patch looks like this:
--- a/src/qwt_series_data.h
+++ b/src/qwt_series_data.h
@@ -54,14 +54,14 @@
     virtual ~QwtSeriesData();

     //! \return Number of samples
-    virtual size_t size() const = 0;
+    virtual size_t size() const {return 0;};

       Return a sample
       \param i Index
       \return Sample at position i
-    virtual T sample( size_t i ) const = 0;
+    virtual T sample( size_t i ) const {return T();};

        Calculate the bounding rect of all samples

Is anyone willing to help me with this?

Another problem is getting the Qt include dir into the configure.py script.
I have to admit that I don't understand how it is done in the QScintilla
Can anyone point me to another example?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20170104/839a334b/attachment.html>

More information about the PyQt mailing list