[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: [PyKDE] PyQt Metaclass programming
From: "Phil Thompson" <phil () riverbankcomputing ! co ! uk>
Date: 2004-10-28 7:59:02
Message-ID: 17324.82.68.80.137.1098950342.squirrel () 82 ! 68 ! 80 ! 137
[Download RAW message or body]
> Howdy!
>
> 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!
Would it help if sip.wrappertype was placed in the sip module dictionary
so that you could sub-class it?
Phil
_______________________________________________
PyKDE mailing list PyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic