[PyQt] Sip and pure virtual functions

Shaheed Haque srhaque at theiet.org
Wed Jan 4 09:18:34 GMT 2017


Just a guess...did you add the /Abstract/ annotation to your class? See...

http://pyqt.sourceforge.net/Docs/sip4/annotations.html

On 4 January 2017 at 08:16, Guðjón Guðjónsson <gudjon.i.gudjonsson at gmail.com
> wrote:

> Hi list
>
> I have been writing a python wrapper to the qwt6 library. It is new code,
> doesn't
> build on PyQwt5.
>
> Qwt library:
> http://qwt.sourceforge.net/
>
> My python wrapper:
> https://github.com/GauiStori/PyQt-Qwt
>
> 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
> script.
> Can anyone point me to another example?
>
> Regards
> Gudjon
>
>
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> https://www.riverbankcomputing.com/mailman/listinfo/pyqt
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20170104/5822df07/attachment-0001.html>


More information about the PyQt mailing list