[PyKDE] QWidget.reparent trouble

Phil Thompson phil at river-bank.demon.co.uk
Mon May 21 23:26:44 BST 2001


>===== Original Message From Greg Green <gregory.p.green at boeing.com> =====
>> Hi all,
>>
>> When trying to use ("self" being a subclass of QDialog) :
>>
>> self.reparent(self.find(0), qt.QPoint(10, 10))
>>
>> I get this error :
>> TypeError: Argument 2 of QWidget.reparent() has an invalid type
>>
>> This is working (found in the Qt documentation) :
>>
>> self.reparent(self.find(0),
>>               self.getWFlags() & (~(qt.Qt.WType_Mask)),
>>               qt.QPoint(10, 10))
>>
>> So, is the first version (redefinition of the second one according
>to
>> the Qt documentation) missing in PyQt ?
>
>Overloaded methods don't work in PyQt right now. You have to either
>change the sip source to give the method a different name and
>recompile :( or figure out a different way. I had the same problem
>with QWMatrix.map if you look at the archives.

99% of overloaded methods do work. The small number that don't (of which 
QWMatrix.map is one) is because they they have signatures that are too similar 
and SIP can't distinguish between them.

I have a patch from Toby Sargeant that might fix this which I'll look at once 
I've finished integrating his OpenGL support.

The real problem with QWidget.reparent() is that the second overloaded method 
is simply missing. I should get around to adding it to the CVS later this 
week.

Phil





More information about the PyQt mailing list