[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: [PyQt] Passing numpy arrays into SIP bindings for C++/Qt code
From: Jeremy Sanders <jeremy () jeremysanders ! net>
Date: 2015-09-16 7:11:19
Message-ID: mtb4m5$3uo$1 () ger ! gmane ! org
[Download RAW message or body]
John Wainwright GMail wrote:
> Hi all. I'm very happily using PyQt for a large astrophotography project
> and have augmented it with a number of C++/Qt extensions using SIP. I'd
> like to be able to pass numpy arrays into (and out of) the C++ extensions
> via SIP bindings and wondering if anyone as done this before or if there
> are any suggestions for best approaches.
I have some ugly code here which works by manually converting a numpy
PY_OBJECT to a C++ wrapper numpy, but Phil's approach sounds far better.
https://github.com/jeremysanders/veusz/blob/master/veusz/helpers/src/qtloops/qtloops.sip
uses
https://github.com/jeremysanders/veusz/blob/master/veusz/helpers/src/qtloops/qtloops_helpers.h
and
https://github.com/jeremysanders/veusz/blob/master/veusz/helpers/src/qtloops/qtloops_helpers.cpp
Jeremy
_______________________________________________
PyQt mailing list PyQt@riverbankcomputing.com
https://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic