[EXTERNAL] Re: Hit bug in sip wrapper generation of template expansion involving enums
phil at riverbankcomputing.com
Thu Mar 4 16:46:34 GMT 2021
On 04/03/2021 15:36, Gehlhaar, Daniel Kurt wrote:
> Apologies. Please see attached. The easiest way to replicate this is
> to put the enum declaration in the same file (as here). In the actual
> production process, it is in a different directory and is built into a
> dependent sip module. I think if this case is fixed, it will fix the
> other case.
> In any case, this is a "showstopper" for me, I cannot proceed with my
> migration from sip 4 to sip 6 unless this is resolved. Any advice or
> mitigation you could provide would be helpful.
SIP does not support enums as an argument to template-based mapped
types. It is a bug that SIP does not complain about this and generates
code on the assumption that the type is a class. The generated code may
or not compile.
You need to provide an explicit mapped type convertor. In its
%TypeHeaderCode you can specify the .h file that contains the C++
definition of the enum. You can look at PyQt5's qpycore_qlist.sip to see
how enum arguments are handled explicitly.
More information about the PyQt