[PyQt] enums and hand written code

Phil Thompson phil at riverbankcomputing.com
Sat Aug 14 12:09:46 BST 2010


On Fri, 6 Aug 2010 11:31:18 -0600, Clinton Stimpson <cjstimpson at gmail.com>
wrote:
> Hi,
> 
> I've got some hand written code using the SIP API to integrate PyQt with
> other 
> C++ classes wrapped with another tool.
> 
> I've got things generally working, but I'm not quite sure how to handle
> enums, 
> such as Qt::AutoConnection.
> 
> When I call api->api_convert_to_type(...) it asserts.  I can do a 
> sipTypeIsEnum(...) to check beforehand, but I don't see in the docs how
to
> get 
> the value out.

An enum is a sub-class of int, so use the standard PyInt_AsLong().

> Also, the docs should be updated to show how to get the sip api if its a

> PyCapsule.

Added to the TODO list.

Phil


More information about the PyQt mailing list