[PyQt] Multiple Inheritance
arnold at arnoldarts.de
Wed Apr 20 14:28:20 BST 2011
On Wednesday 20 April 2011 13:01:57 Zoltan Szalai 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."
> tiple-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).
(I haven't looked at your code.)
The limitation doesn't come from python or PyQt. Its purely because of Qt and
means that you can not inherit from multiple classes that are or inherit from
QObject. And its the same for all class-trees I believe. Unless you use
virtual inheritance in C++, but last time I tried (some years back) that led
to strange errors and was neither encouraged nor supported in any point in Qt.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 198 bytes
Desc: This is a digitally signed message part.
More information about the PyQt