[PyQt] Sip and pure virtual functions
Guðjón Guðjónsson
gudjon.i.gudjonsson at gmail.com
Wed Jan 4 14:37:31 GMT 2017
Hi Phil and Shaheed
Thanks Shaheed. I tried with the Abstract keyword but I couldn't make it
work
On Wed, Jan 4, 2017 at 11:40 AM, Phil Thompson <phil at riverbankcomputing.com>
wrote:
> On 4 Jan 2017, at 8:16 am, 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.
>
> So what is the problem?
>
If I don't use the patch, I get the following error:
g++ -c -g -g -O2 -fstack-protector-strong -Wformat
-Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Wall -W
-DNDEBUG -I. -I/usr/include/x86_64-linux-gnu/qt5/
-I/usr/include/x86_64-linux-gnu/qt5/QtCore/
-I/usr/include/x86_64-linux-gnu/qt5/QtGui/
-I/usr/include/x86_64-linux-gnu/qt5/QtWidgets/ -I/usr/include/qwt/
-I/usr/include/python3.5m -o sipQwtQwtSeriesStoreQwtSetSample.o
sipQwtQwtSeriesStoreQwtSetSample.cpp
./sipQwtQwtSeriesStoreQwtSetSample.cpp: In function ‘void*
array_QwtSeriesStoreQwtSetSample(Py_ssize_t)’:
./sipQwtQwtSeriesStoreQwtSetSample.cpp:372:52: error: invalid
new-expression of abstract class type ‘QwtSeriesStore<QwtSetSample>’
return new QwtSeriesStoreQwtSetSample[sipNrElem];
^
In file included from qwt_series_store.sip:68:0:
/usr/include/qwt/qwt_series_store.h:57:7: note: because the following
virtual functions are pure within ‘QwtSeriesStore<QwtSetSample>’:
class QwtSeriesStore: public virtual QwtAbstractSeriesStore
^~~~~~~~~~~~~~
/usr/include/qwt/qwt_series_store.h:31:18: note: virtual void
QwtAbstractSeriesStore::dataChanged()
virtual void dataChanged() = 0;
^~~~~~~~~~~
./sipQwtQwtSeriesStoreQwtSetSample.cpp: In function ‘void*
copy_QwtSeriesStoreQwtSetSample(const void*, Py_ssize_t)’:
./sipQwtQwtSeriesStoreQwtSetSample.cpp:379:114: error: invalid
new-expression of abstract class type ‘QwtSeriesStore<QwtSetSample>’
return new QwtSeriesStoreQwtSetSample(reinterpret_cast<const
QwtSeriesStoreQwtSetSample *>(sipSrc)[sipSrcIdx]);
^
Makefile:17: recipe for target 'sipQwtQwtSeriesStoreQwtSetSample.o' failed
make: *** [sipQwtQwtSeriesStoreQwtSetSample.o] Error 1
But if I use the patch everything works like charm. I would very much like
not to add this patch to the Qwt library because
I think there must be a way around it in Sip.
The sip files, patch and .h files are attached.
> > 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?
>
> Again, what is the problem?
>
I cannot find out how to obtain the Qt include directory automatically in
the configure.py script.
For PyQt4 it is simple
from PyQt4 import pyqtconfig
pyqtconfig.Configuration().qt_lib_dir
But I don't know how to do this for PyQt5.
Regards
Gudjon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20170104/22f23305/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qwt_series_data.sip
Type: application/octet-stream
Size: 4190 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20170104/22f23305/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qwt_series_store.sip
Type: application/octet-stream
Size: 3521 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20170104/22f23305/attachment-0003.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 06_python_compat.patch
Type: text/x-patch
Size: 1823 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20170104/22f23305/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qwt_series_data.h
Type: text/x-chdr
Size: 9156 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20170104/22f23305/attachment-0002.h>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qwt_series_store.h
Type: text/x-chdr
Size: 4816 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20170104/22f23305/attachment-0003.h>
More information about the PyQt
mailing list