[PyKDE] Using libsip for extending & embedding

ian reinhart geiser geiseri at yahoo.com
Wed Oct 24 15:51:01 BST 2001


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Greetings
	I am trying to use SIP here to create bindings for a C++ project of mine.  
The issue I have now is the need for an "object twin"  or an object that is 
created in C++ and then can be accessed from python.  This is clearly shown 
for simple types (int, string, etc) but there is no real discussion on more 
complex types.  In my case I am creating a class foo, and would like foo to 
be manipulated from python.  Python knows how to deal with type foo because I 
used SIP to create a module that python loads.  My question here is can I use 
libsip to convert those C++ objects to PyObjects using the following code:

foo *daFoo = new foo();
PyObject *sipClass_foo;
PyObject  pyFoo = sipMapCppToSelf 
	(
	reinterpret_cast<void *>(daFoo),
	sipClass_foo)
	);
// Pass pyFoo to a embedded python script here.

This looks really easy, but I am not sure if I am abusing SIP to do something 
wrong here.

Thanks
- -ian reinhart geiser
- -- 
========================================
FORTH IF HONK THEN
========================================
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE71sdoPy62TRm8dvgRAjuFAKDLnhnfXBbgQQRdmGPUprHKMuMUxgCggkho
l3cS4N1ojCPGtja12yIlD/o=
=pqHt
-----END PGP SIGNATURE-----




More information about the PyQt mailing list