[PySide] Trying to make Python bindings of Qt-base library
Filippo Rusconi
listes.rusconi at laposte.net
Tue Jan 12 17:06:29 CET 2021
Greetings, Fellow Developers,
in my quest to develop Python bindings of my Qt-based library, I finally could
manually build PySide2 and make bindings of an example library
(https://blog.basyskom.com/2019/using-shiboken2-to-create-python-bindings-for-a-qt-library/)
This example works fine. However, it builds the sample library inside the source
tree, which is not what I want to do. So I changed it so that the library
becomes fully external and I make reference to it instead of generating it. The
modified example works like a charm.
Seeming well set, I decided to implement that example within the source tree of
my Qt-based library. I set all the required -I<include path> so that the header
files are seen, I edited the bindings.h and bindings.xml files according to the
single structure (it is not a class, but a struct) that I want bindings from.
I have a problem, no matter how I tried to somehow translate the previous
external library example, I keep having
qt.shiboken: (bindings) /home/rusconi/devel/pappsomspp/development/python/bindings.xml:4: type 'DataPoint' is specified in typesystem, but not defined. This could potentially lead to compilation errors.
as an error upon running the shiboken2 command.
DataPoint is a struct declared in datapoint.h, itself in the $DEVDIR/src/pappsomspp/trace
directory.
Now, the bindings.h file contains:
#include "pappsomspp/trace/datapoint.h"
and the -I<include_dir> arguments to the shiboken2 call include among others the
$DEVDIR/src directory. So, the datapoint.h file is definitely reachable.
This is my question: what does that "but not defined" mean? My understanding is
that the bindings generation does not need cpp files, right?
In the hope that some generous soul will help me going forward with this
project...
Yours most sincerely,
Filippo
--
⢀⣴⠾⠻⢶⣦⠀ Filippo Rusconi, PhD
⣾⠁⢠⠒⠀⣿⡁ Research scientist at CNRS
⢿⡄⠘⠷⠚⠋⠀ Debian Developer
⠈⠳⣄⠀⠀⠀⠀ http://msxpertsuite.org
http://www.debian.org
More information about the PySide
mailing list