[PySide] binding qwt-6.0.1 with shiboken, got stuck on template class...

340 views
Skip to first unread message

Grissiom

unread,
Aug 12, 2011, 4:55:09 AM8/12/11
to pys...@lists.openbossa.org
Hi all,

I forked halida's pysideqwt on github(
https://github.com/grissiom/pysideqwt ) and working on binding
Qwt-6.0.1. I made some adjustment on the typesystem_qwt.xml and
global.h to suppress most of the generator warnings. But I got error
when compiling. Here is the full log:

==========================================================
[ 1%] Running generator for libqwt...
Generating class model... [WARNING]
enum 'QPixmap::ShareMode' does not have a type entry or is not an enum
Unable to decide type of property: 'BackgroundStyles' in class
'QwtSlider'


Generating enum model... [OK]
Generating namespace model... [OK]
Resolving typedefs... [OK]
Fixing class inheritance... [WARNING]
Ignoring template parameter from QwtSeriesData< T >, because
I don't know what it is.


Detecting inconsistencies in class model... [OK]
[OK]
type 'QPyTextObject' is specified in typesystem, but not
defined. This could potentially lead to compilation errors.

Could not find a AbstractMetaClass for type T


Done, 5 warnings (1047 known issues)
[ 2%] Building CXX object
qwt/CMakeFiles/PySideQwt.dir/PySideQwt/pysideqwt_module_wrapper.cpp.o
In file included from
/home/grissiom/projects/pysideqwt/build/qwt/PySideQwt/pysideqwt_python.h:18:0,
from
/home/grissiom/projects/pysideqwt/build/qwt/PySideQwt/pysideqwt_module_wrapper.cpp:6:
/usr/include/PySide/QtCore/pyside_qtcore_python.h: In static member
function ‘static bool
Shiboken::Converter<QDateTime>::isConvertible(PyObject*)’:
/usr/include/PySide/QtCore/pyside_qtcore_python.h:3489:9: warning:
deprecated conversion from string constant to ‘char*’
/usr/include/PySide/QtCore/pyside_qtcore_python.h:3489:9: warning:
deprecated conversion from string constant to ‘char*’
/usr/include/PySide/QtCore/pyside_qtcore_python.h: In static member
function ‘static QDateTime
Shiboken::Converter<QDateTime>::toCpp(PyObject*)’:
/usr/include/PySide/QtCore/pyside_qtcore_python.h:3499:9: warning:
deprecated conversion from string constant to ‘char*’
/usr/include/PySide/QtCore/pyside_qtcore_python.h:3499:9: warning:
deprecated conversion from string constant to ‘char*’
/usr/include/PySide/QtCore/pyside_qtcore_python.h: In static member
function ‘static bool
Shiboken::Converter<QDate>::isConvertible(PyObject*)’:
/usr/include/PySide/QtCore/pyside_qtcore_python.h:3544:9: warning:
deprecated conversion from string constant to ‘char*’
/usr/include/PySide/QtCore/pyside_qtcore_python.h:3544:9: warning:
deprecated conversion from string constant to ‘char*’
/usr/include/PySide/QtCore/pyside_qtcore_python.h: In static member
function ‘static QDate Shiboken::Converter<QDate>::toCpp(PyObject*)’:
/usr/include/PySide/QtCore/pyside_qtcore_python.h:3553:9: warning:
deprecated conversion from string constant to ‘char*’
/usr/include/PySide/QtCore/pyside_qtcore_python.h:3553:9: warning:
deprecated conversion from string constant to ‘char*’
/usr/include/PySide/QtCore/pyside_qtcore_python.h: In static member
function ‘static bool
Shiboken::Converter<QTime>::isConvertible(PyObject*)’:
/usr/include/PySide/QtCore/pyside_qtcore_python.h:3656:9: warning:
deprecated conversion from string constant to ‘char*’
/usr/include/PySide/QtCore/pyside_qtcore_python.h:3656:9: warning:
deprecated conversion from string constant to ‘char*’
/usr/include/PySide/QtCore/pyside_qtcore_python.h: In static member
function ‘static QTime Shiboken::Converter<QTime>::toCpp(PyObject*)’:
/usr/include/PySide/QtCore/pyside_qtcore_python.h:3665:9: warning:
deprecated conversion from string constant to ‘char*’
/usr/include/PySide/QtCore/pyside_qtcore_python.h:3665:9: warning:
deprecated conversion from string constant to ‘char*’
In file included from
/home/grissiom/projects/pysideqwt/build/qwt/PySideQwt/pysideqwt_module_wrapper.cpp:6:0:
/home/grissiom/projects/pysideqwt/build/qwt/PySideQwt/pysideqwt_python.h:
At global scope:
/home/grissiom/projects/pysideqwt/build/qwt/PySideQwt/pysideqwt_python.h:295:33:
error: template-id ‘SbkType<template<class T> class
QwtArraySeriesData>’ for ‘PyTypeObject* Shiboken::SbkType()’ does not
match any template declaration
/home/grissiom/projects/pysideqwt/build/qwt/PySideQwt/pysideqwt_python.h:296:33:
error: template-id ‘SbkType<template<class T> class QwtSeriesData>’
for ‘PyTypeObject* Shiboken::SbkType()’ does not match any template
declaration
/home/grissiom/projects/pysideqwt/build/qwt/PySideQwt/pysideqwt_python.h:372:33:
error: template-id ‘SbkType<template<class T> class
QwtPlotSeriesItem>’ for ‘PyTypeObject* Shiboken::SbkType()’ does not
match any template declaration
/home/grissiom/projects/pysideqwt/build/qwt/PySideQwt/pysideqwt_python.h:911:41:
error: template argument 1 is invalid
/home/grissiom/projects/pysideqwt/build/qwt/PySideQwt/pysideqwt_python.h:911:87:
error: type/value mismatch at argument 1 in template parameter list
for ‘template<class T> struct Shiboken::ObjectTypeConverter’
/home/grissiom/projects/pysideqwt/build/qwt/PySideQwt/pysideqwt_python.h:911:87:
error: expected a type, got ‘QwtArraySeriesData’
/home/grissiom/projects/pysideqwt/build/qwt/PySideQwt/pysideqwt_python.h:916:40:
error: type/value mismatch at argument 1 in template parameter list
for ‘template<class T> struct Shiboken::Converter’
/home/grissiom/projects/pysideqwt/build/qwt/PySideQwt/pysideqwt_python.h:916:40:
error: expected a type, got ‘QwtArraySeriesData’
/home/grissiom/projects/pysideqwt/build/qwt/PySideQwt/pysideqwt_python.h:916:95:
error: type/value mismatch at argument 1 in template parameter list
for ‘template<class T> struct Shiboken::ObjectTypeReferenceConverter’
/home/grissiom/projects/pysideqwt/build/qwt/PySideQwt/pysideqwt_python.h:916:95:
error: expected a type, got ‘QwtArraySeriesData’
/home/grissiom/projects/pysideqwt/build/qwt/PySideQwt/pysideqwt_python.h:921:36:
error: template argument 1 is invalid
/home/grissiom/projects/pysideqwt/build/qwt/PySideQwt/pysideqwt_python.h:921:77:
error: type/value mismatch at argument 1 in template parameter list
for ‘template<class T> struct Shiboken::ObjectTypeConverter’
/home/grissiom/projects/pysideqwt/build/qwt/PySideQwt/pysideqwt_python.h:921:77:
error: expected a type, got ‘QwtSeriesData’
/home/grissiom/projects/pysideqwt/build/qwt/PySideQwt/pysideqwt_python.h:926:35:
error: type/value mismatch at argument 1 in template parameter list
for ‘template<class T> struct Shiboken::Converter’
/home/grissiom/projects/pysideqwt/build/qwt/PySideQwt/pysideqwt_python.h:926:35:
error: expected a type, got ‘QwtSeriesData’
/home/grissiom/projects/pysideqwt/build/qwt/PySideQwt/pysideqwt_python.h:926:85:
error: type/value mismatch at argument 1 in template parameter list
for ‘template<class T> struct Shiboken::ObjectTypeReferenceConverter’
/home/grissiom/projects/pysideqwt/build/qwt/PySideQwt/pysideqwt_python.h:926:85:
error: expected a type, got ‘QwtSeriesData’
/home/grissiom/projects/pysideqwt/build/qwt/PySideQwt/pysideqwt_python.h:1546:40:
error: template argument 1 is invalid
/home/grissiom/projects/pysideqwt/build/qwt/PySideQwt/pysideqwt_python.h:1546:85:
error: type/value mismatch at argument 1 in template parameter list
for ‘template<class T> struct Shiboken::ObjectTypeConverter’
/home/grissiom/projects/pysideqwt/build/qwt/PySideQwt/pysideqwt_python.h:1546:85:
error: expected a type, got ‘QwtPlotSeriesItem’
/home/grissiom/projects/pysideqwt/build/qwt/PySideQwt/pysideqwt_python.h:1551:39:
error: type/value mismatch at argument 1 in template parameter list
for ‘template<class T> struct Shiboken::Converter’
/home/grissiom/projects/pysideqwt/build/qwt/PySideQwt/pysideqwt_python.h:1551:39:
error: expected a type, got ‘QwtPlotSeriesItem’
/home/grissiom/projects/pysideqwt/build/qwt/PySideQwt/pysideqwt_python.h:1551:93:
error: type/value mismatch at argument 1 in template parameter list
for ‘template<class T> struct Shiboken::ObjectTypeReferenceConverter’
/home/grissiom/projects/pysideqwt/build/qwt/PySideQwt/pysideqwt_python.h:1551:93:
error: expected a type, got ‘QwtPlotSeriesItem’
make[2]: *** [qwt/CMakeFiles/PySideQwt.dir/PySideQwt/pysideqwt_module_wrapper.cpp.o]
Error 1
make[1]: *** [qwt/CMakeFiles/PySideQwt.dir/all] Error 2
make: *** [all] Error 2
==================================================================

I think the error indicate shiboken could not cope with the template
class QwtArraySeriesData. But as it is a base template class for many
others( http://qwt.sourceforge.net/class_qwt_array_series_data.html ),
I think I could not go any further without solve this problem.

I'm new to pyside and shiboken. Any help will be appreciated thanks!

--
Cheers,
Grissiom
_______________________________________________
PySide mailing list
PyS...@lists.pyside.org
http://lists.pyside.org/listinfo/pyside

Yinhm .

unread,
Sep 5, 2011, 1:14:03 PM9/5/11
to pys...@googlegroups.com, pys...@lists.openbossa.org
hi, all

I just forked https://github.com/grissiom/pysideqwt and pushed my changes.
I got build 100% pass, but not the test results due to C++ templates.

It based on Qwt 6.1.0-svn.

I have the same question with Grissiom, here is the build log related to templates:
{{{
Resolving typedefs...                        [OK]
Fixing class inheritance...                  [WARNING]
class not found for setup inheritance 'QGraphicsObject'
template baseclass 'QwtPlotSeriesItem<QwtIntervalSample>' of 'QwtPlotIntervalCurve' is not known
class 'QGraphicsWidget' inherits from unknown base class 'QGraphicsObject'
template baseclass 'QwtSeriesData<QPointF>' of 'QwtCPointerData' is not known
class 'QGraphicsTextItem' inherits from unknown base class 'QGraphicsObject'
template baseclass 'QwtArraySeriesData<QwtSetSample>' of 'QwtSetSeriesData' is not known
template baseclass 'QwtArraySeriesData<QPointF>' of 'QwtPointSeriesData' is not known
template baseclass 'QwtArraySeriesData<QwtPoint3D>' of 'QwtPoint3DSeriesData' is not known
template baseclass 'QwtPlotSeriesItem<QPointF>' of 'QwtPlotCurve' is not known
template baseclass 'QwtSeriesData<QPointF>' of 'QwtPointArrayData' is not known
template baseclass 'QwtPlotSeriesItem<QwtIntervalSample>' of 'QwtPlotHistogram' is not known
template baseclass 'QwtSeriesData<QPointF>' of 'QwtSyntheticPointData' is not known
template baseclass 'QwtArraySeriesData<QwtOHLCSample>' of 'QwtTradingChartData' is not known
template baseclass 'QwtPlotSeriesItem<QwtPoint3D>' of 'QwtPlotSpectroCurve' is not known
template baseclass 'QwtArraySeriesData<QwtIntervalSample>' of 'QwtIntervalSeriesData' is not known
}}}

For example, The QwtPlotCurve definition:

  class QWT_EXPORT QwtPlotCurve: public QwtPlotSeriesItem<QPointF>

QwtPlotSeriesItem which is the class using template:

  class QWT_EXPORT QwtPlotAbstractSeriesItem: public QwtPlotItem

  template <typename T>
  class QwtPlotSeriesItem: public QwtPlotAbstractSeriesItem


And the
QwtPlotItem:

  class QWT_EXPORT QwtPlotItem: public QwtLegendItemManager


CTest failed due to some method in QwtPlotItem did exposed to QwtPlotCurve:

{{{
1: ERROR: testQwt (__main__.QwtTest)
1: Test case for qwtplot class from qwt module.
1: ----------------------------------------------------------------------
1: Traceback (most recent call last):
1:   File "/home/josh/quant/qwt/pysideqwt/tests/qwt_test.py", line 32, in testQwt
1:     curve.attach(plot)
1: AttributeError: 'PySideQwt.QwtPlotCurve' object has no attribute 'attach'
}}}

So, my question is, what should I do to make attach method available in QwtPlotCurve or
how do I convert C++ template to shiboken definitions.

maxime-esa

unread,
Feb 8, 2012, 6:50:06 AM2/8/12
to pys...@googlegroups.com, pys...@lists.openbossa.org
Hi,

I tried to compile the project but without success so far.
According to the README.txt file, the following command should be sufficient to make the build:
$ make install  
However when you look at the makefile, the following line:
cd build_object; $(MAKE)
cannot work (there is no 'build_object' directory in the tree).

Prior to running the makefile, I ran the following command : "cmake ." - it went fine. 

I then tried to go into the qwt subdirectory and run make. It starts well but fail here:
(...)

Could not find a minimal constructor for type 'Array'. This will result in a compilation error.
Aborted
make[2]: *** [qwt/PySideQwt/pysideqwt_module_wrapper.cpp] Error 134

make[1]: *** [qwt/CMakeFiles/PySideQwt.dir/all] Error 2
make: *** [all] Error 2

I am not sure what I could have done wrong - I am not very familiar with shiboken yet.
Have you experienced this issue?

Thanks for any help you could provide

Maxime



Reply all
Reply to author
Forward
0 new messages