[PyKDE] PyQT/sip overloaded inheritance issue.
t.sargeant at inpharmatica.co.uk
Fri Jun 1 10:34:00 BST 2001
I've come across an interesting issue which has a workaround in python, but
which is, i think, worth mentioning.
QScrollView defines a virtual function
QScrollView also inherits from QFrame, which defines
If you derive from QScrollView in python, and implement the 6 argument version
of drawContents, you catch *both* the call to QFrame::drawContents, and the
call to QScrollView::drawContents, resulting in the following exception:
TypeError: drawContents() takes exactly 6 arguments (2 given)
as well as a successful call to the implementation of drawContents that the
python derived class provides.
the solution is to define the python drawContents function as:
I imagine that things get more hairy still when there are two overloads that
have the same number of arguments but different types.
:gurfle: /ger'fl/ interj. An expression of shocked disbelief.
"He said we have to recode this thing in FORTRAN by next week. Gurfle!"
[ Toby Sargeant : Inpharmatica : Developer : t.sargeant at inpharmatica.co.uk ]
[ http://www.inpharmatica.co.uk : 020 7074 4600 fax 020 7631 4844 ]
More information about the PyQt