[PyQt] Multiple inheritance with pyqt and python class

Phil Thompson phil at riverbankcomputing.com
Fri Jun 11 22:30:51 BST 2010


On Fri, 11 Jun 2010 13:06:10 -0700, brian downing
<brian.downing at yakkadesign.com> wrote:
> I know multiple inheritance with 2 pyqt objects isn't allowed. Is there 
> any problems with a single pyqt object and another python class?
> 
> Here is an example:
> ---------------------------------------------
> class myMethods:
> def __init__(self, val):
> self.val=val
> def method1(self):
> ….
> 
> classMyWidget(QWidget, myMethods)
> def __init__(self, parent=None):
> myMethods.__init__(self, 2)
> QWidget.__init__(self, parent)
> ---------------------------------------------
> 
> This seems to work. The examples I've looked at uses a single pyqt 
> object and the super method. I wanted to be sure I'm not doing something 
> that will cause headaches in the future.

Shouldn't be a problem.

Phil


More information about the PyQt mailing list