[PyQt] multiple inheritance suggestion

Luke Campagnola lcampagn at email.unc.edu
Mon Apr 9 03:40:04 BST 2012


Howdy list,

I'm trying to achieve some sort of multiple inheritance with custom classes
where each may define its own signals. I understand there are limitations
with SIP in this area, but It is not really necessary that QObject be
inherited more than once. As an example, consider the standard diamond
inheritance problem:

   A
 /    \
B    C
 \    /
   D

If A is a subclass of QObject, then presumably classes B, C, and D could
all define their own signals (creating an instance of class D should only
result in a single C++ QObject instance, so in theory this should work
fine). In practice, this causes a segmentation fault  when emitting signals
that were defined in class C. I'm not sure if this is a solvable problem at
all, but suggestions are welcome. I could potentially sidestep the issue by
breaking the inheritance between A and C, but then I can no longer define
signals from class C (Or rather, I can define signals, but attempting to
emit such a signal also leads to segmentation fault).

Any ideas? Is there perhaps a way (using new-style signals) to send a
signal that is not defined as a class attribute?

Thanks,
Luke
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20120408/73818d7b/attachment.html>


More information about the PyQt mailing list