[PyQt] How to derive from a %MappedType?

Phil Thompson phil at riverbankcomputing.com
Sun Jan 22 18:03:31 GMT 2017


On 22 Jan 2017, at 4:26 pm, Shaheed Haque <srhaque at theiet.org> wrote:
> 
> So, since SIP only supports templates via %MappedTypes

No it supports class templates as well.

> I guess there
> is there any way to express the relationship
> 
>    class Foo: TemplatedType<whatever>
> 
> Omitting the base would presumably "hide" any methods etc. that the
> templated type might have contributed to the API of Foo...am I right
> in thinking that the only option is to omit the base and add to Foo
> anything which is needed?

No, using a class template rather than a mapped type template might be appropriate. See the attached.

Phil

-------------- next part --------------
A non-text attachment was scrubbed...
Name: foo.h
Type: application/octet-stream
Size: 178 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20170122/c046bd84/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: foo.sip
Type: application/octet-stream
Size: 262 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20170122/c046bd84/attachment-0001.obj>


More information about the PyQt mailing list