Re: [C++-sig] PyQt (SIP) and Boost.Python interop?

2009-04-14 Thread Marcus Lindblom

Ralf W. Grosse-Kunstleve wrote:

Since I didn't see any other responses, I'll offer what I know, even though it 
doesn't directly answer
your question.

A few years ago I experimented with SWIG - Boost.Python integration, where you 
can get easy access
from C++ to SWIG-wrapped objects, inside a function wrapped with Boost.Python. 
The code is here:

http://cctbx.svn.sourceforge.net/viewvc/cctbx/trunk/boost_adaptbx/

Look for the files swig_arg.hpp, swig_args_ext.cpp, and search for "libswig" in 
the
SConscript.

I haven't tried this out for a long time.
Anyway, I hope it gives you a start.


Thanks. Hm.

I've currently done this in python:

***
f = MyWidget() # MyWidget is a boost::python wrapped object that
   # inherits QTimer, that has start()

#
def _q_getattr(self, attr):
if type(self) == type(type(MyWidget)):
raise AttributeError
else:
return getattr(sip.wrapinstance(self.myself(), QObject), attr)

MyWidget.__getattr__ = _q_getattr

f.start() # works! :)
***

But I want to implement __dir__ in the same way to get full coverage, 
and that's trickier.


Cheers,
/Marcus

___
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig


[C++-sig] pygccxml and multidimensional arrays

2009-04-14 Thread Davidson, Josh
Machine: x86_64 running RH EL 5.0

Pygccxml version 1.0.0

Gcc-xml version 0.9.0

 

If I create a struct similar to:

 

typedef struct {

uint16_t a[4][2][3];

} blah;

 

And use pygccxml to parse it, the type attribute for the field "a" is
set to: uint16_t[3][2][4].  Does anyone know why the dimensions are
reversed?

 

 

___
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig