[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] Multiple Inheritance
From:       Phil Thompson <phil () riverbankcomputing ! com>
Date:       2011-04-20 17:08:52
Message-ID: f790900e9e6b0029eafc034f2768791f () localhost
[Download RAW message or body]

On Wed, 20 Apr 2011 13:01:57 +0200, Zoltan Szalai <defaultdict@gmail.com>
wrote:
> Hi All,
> 
> The PyQt Reference Guide says:
> "It is not possible to define a new Python class that sub-classes from 
> more than one Qt class."
> [ 
>
http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/gotchas.html#multiple-inheritance
> 
> ]
> 
> The code attached works here until you remove the comment before the 
> last line. Then it raises a TypeError.
> I should really use something like this in a PyQt app (if it's not a 
> very bad idea anyway) and I wonder what are the limitations here or what

> are the best practices to solve this kind of problem (if there are any).

When it says "not possible" it really means that you don't get the same
results as you would if you did the same thing in C++. It might be more
accurate to say that it isn't supported.

In C++ you would get a single C++ instance with the behaviour of both
classes. In Python you get two completely separate C++ instances each
implementing the behaviour of one of the classes.

Phil
_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic