[PyQt] Type map for python to Qt?

Barry Scott barry at barrys-emacs.org
Sun Feb 5 11:15:56 GMT 2017


> On 4 Feb 2017, at 23:53, Shaheed Haque <srhaque at theiet.org> wrote:
> 
> Acknowledged. Any thoughts on the union idea?
> 

I don’t know SIP but thinking about what it should look like from Python.

Some unions are for interpreting the bit pattern in memory different ways. Hopefully you have none of them.

Other unions are really polymorphism. Can you return each of the types that the union represents on output and accept any of the types on input?

Struct OddUNionTHing {

Enum what_type;
Union {
	Struct1 type1;
	Struct2 type2;
} union1;
}

If what_type says we have type1 return conversion of type1, etc.

Does the KDE code really use unions? I’m surprised in OO code.

Barry



More information about the PyQt mailing list