[PyQt] %MappedType with non-class template arg?

Hans-Peter Jansen hpj at urpla.net
Fri Sep 10 17:16:00 BST 2010


On Friday 10 September 2010, 11:56:30 Phil Thompson wrote:
> On Fri, 10 Sep 2010 10:43:24 +0200, Hans Meine
>
> <meine at informatik.uni-hamburg.de> wrote:
> > Hi again!
> >
> > Am Freitag 10 September 2010, 10:21:08 Phil wrote:
> >> So the template arguments are constant, so don't even bother with a
> >> template in sip. Just do...
> >>
> >> %MappedType UInt16Array4D
> >> {
> >> ...
> >> };
> >
> > That's what I do, but it's a lot of copy-pasting, since I have
> > different
> >
> > value_types (8,16,32 bit ints or floating point) and dimensions
> > (2,3,4).
>
> ...you said you were only interested in the one case...
>
> > It would be much nicer to just list the typedefs..
>
> It's impossible to implement. The code needed would be different for each
> value type. sip templates can handle different class types with the same
> code because the code is identical (apart from the name of the class
> itself) for all cases.

Hans, this sounds like it can (and should) be solved with an generator 
approach, doesn't it?

Pete


More information about the PyQt mailing list