Re: [PyKDE] ConvertToSubClassCode

2003-11-19 Thread Gerard Vermeulen
On Tue, 18 Nov 2003 19:13:10 +
Phil Thompson [EMAIL PROTECTED] wrote:

[ snip ]
 
  were due to the fact that I did not implement ConvertToSubClassCode for
  the Qwt widgets.  Therefore, the 'is' operator did not work as expected.
 
  Since Qwt is more of a bunch of widgets than a neat hierarchy like PyKDE,
  the most natural choice is to convert down from a QObject to a specific
  subclass.
 
  As far as I understand, the sipc module knows how to handle more than
  one static  PyObject *sipSubClass_QObject(const QObject *sipCpp) (as
  long as they are implemented in different modules), but sip does not
  support it.
 
 I don't understand - sip does support it, look at qtable.sip or qcanvas.sip. 
 Or am I missing something?

My fault. Of course I looked at those *.sip files but not close enough to
the generated code. Sorry.

Gerard 

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde


Re: [PyKDE] ConvertToSubClassCode

2003-11-18 Thread Phil Thompson
On Tuesday 18 November 2003 7:35 am, Gerard Vermeulen wrote:
 Hi,

 My difficulties to translate this C++ idiom to Python:

 bool Plot::eventFilter(QObject *object, QEvent *e)
 {
 if ( e-type() == QEvent::Resize )
 {
 const QSize size = ((QResizeEvent *)e)-size();
 if ( object == (QObject *)axis(yLeft) )  // HOW TO THIS IN PYTHON?
 {
   // ...
 }
 }

 return QwtPlot::eventFilter(object, e);
 }

 were due to the fact that I did not implement ConvertToSubClassCode for
 the Qwt widgets.  Therefore, the 'is' operator did not work as expected.

 Since Qwt is more of a bunch of widgets than a neat hierarchy like PyKDE,
 the most natural choice is to convert down from a QObject to a specific
 subclass.

 As far as I understand, the sipc module knows how to handle more than
 one static  PyObject *sipSubClass_QObject(const QObject *sipCpp) (as
 long as they are implemented in different modules), but sip does not
 support it.

I don't understand - sip does support it, look at qtable.sip or qcanvas.sip. 
Or am I missing something?

Phil

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde