[PyKDE] PyQt Metaclass programming

Gary Coulbourne GCoulbourne at Immunicon.com
Wed Oct 27 18:09:59 BST 2004


I'm presently using QCustomEvent quite often, and decided to whip up a
solution using metaclasses.  The idea being that the custom event number
could be automatically incremented for each custom event -- so it would
be unnecessary to number them manually.  

However, trying to create a subclass of class 'type' and assign it to a
class with __metaclass__ generates an error.  Turns out, sip.wrappertype
is the metaclass of QCustomEvent.  However, sip.wrappertype does not
appear to be visible in the sip module.

Does anyone know an easy way to attach a metaclass to a subclass of a
PyQt class?  It is simple enough to make a class factory, but it seems
more elegant to delegate that task to a metaclass.  Thanks!


This e-mail message is intended only for the personal use of the recipient(s) named above. This message should be considered a confidential communication, and as such is not subject to disclosure to anyone who is not an intended recipient.  If you are not an intended recipient, you may not legally review, copy or distribute this message. If you have received this communication in error, please notify the sender(s) immediately by e-mail and delete the original message from your computer system.

More information about the PyQt mailing list