On Thursday 11 August 2011 14:05:39 Grissiom wrote: > On Mon, Jan 3, 2011 at 7:00 PM, Hugo Parente Lima > > <[email protected]> wrote: > > On Friday 31 December 2010 06:02:09 机械唯物主义 : linjunhalida wrote: > >> ok, still my pysideqwt project, I'm wrapping QwtData, > >> in QwtData: http://qwt.sourceforge.net/qwt__data_8h-source.html > >> > >> 00047 class QWT_EXPORT QwtData > >> 00048 { > >> 00049 public: > >> 00050 QwtData(); > >> 00051 virtual ~QwtData(); > >> 00052 > >> 00054 virtual QwtData *copy() const = 0; > >> 00055 > >> 00057 virtual size_t size() const = 0; > >> 00058 > >> 00064 virtual double x(size_t i) const = 0; > >> 00070 virtual double y(size_t i) const = 0; > >> 00071 > >> 00072 virtual QwtDoubleRect boundingRect() const; > >> 00073 > >> 00074 protected: > >> 00078 QwtData &operator=(const QwtData &); > >> 00079 }; > >> > >> and xml typesystem: > >> > >> <object-type name="QwtData"> > >> </object-type> > >> > >> and qwtdata_wrapper: > >> > >> class QwtDataWrapper : public QwtData > >> { > >> public: > >> QwtDataWrapper(); > >> virtual QRectF boundingRect() const; > >> virtual QwtData * copy() const; > >> virtual ~QwtDataWrapper(); > >> }; > > > > The generator probably doesn't know what is "size_t" due to a missing > > include file. > > > > If I'm correct, find and add the include file or add size_t as primitive > > type on your typesystem using the tag: > > > > <primitive-type name="size_t" default-constructor="0" target-lang-api- > > name="PyLong" /> > > Thank you very much for your answer. It's loong time from linjunhalida > stopped working on pysideqwt. So I'm going to try to continue with it. > I got the same problem when I try qt4examples/SimpleDemo.py: > > ./SimpleDemo.py:89: RuntimeWarning: Invalid return value in function > QwtData.size, expected size_t, got int > > How to deal with it?
Add size_t or std::size_t (depends how it was written on C++ header file) as primitive type on your type system, e.g: <primitive-type name="std::size" target-lang-api-name="PyInt" /> > Besides, it seems in PyQwt it's safe to do something like > QwtPlotCurve.setData(SimpleData(math.sin, 100)). But pysideqwt will > segfault if we don't keep a reference to SimpleData(math.sin, 100). Is > there any better way to deal with it? > > Thanks very much. -- Hugo Parente Lima INdT - Instituto Nokia de Tecnologia
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ PySide mailing list [email protected] http://lists.pyside.org/listinfo/pyside
