[PyQt] MappedType with library with C and Python bindings

Joshua Christopher joshuadevmail at gmail.com
Fri Oct 23 03:19:46 BST 2015


I want to use the GNU multiprecision library which conveniently has 
python bindings provided by GMPY2. I'm trying to figure out how I can 
convert between a GMP mpq_t type and GMPY2 mpq type.

Are there any examples of something similar to this?

I looked at the QGIS SIP files and found %MappedType QMap<qint64, 
QgsFeature*> (located in QGIS/python/core/conversions.cpp), but I don't 
think this is a good example for me because they are using SIP to map 
QgsFeature and so can use sipType_QgsFeature. All the examples I have 
found for when you are not wrapping the type are for instances like 
std::string where you can convert to a built in python type and use the 
functions like PyString_

Thank you,

More information about the PyQt mailing list