- Notifications
You must be signed in to change notification settings - Fork 110
Open
Labels
questionFurther information is requestedFurther information is requested
Description
Hi,
I have simple class:
#ifndef __qColadaTreeTEST_h #define__qColadaTreeTEST_h// Qt includes #include<QTreeView>// Colada includes #include"qColadaAppExport.h"// h5gt includes #include<h5gt/H5File.hpp>// has python bindings using pybind11 classQ_COLADA_APP_EXPORT qColadaTreeTEST : public QTreeView{Q_OBJECT public:explicitqColadaTreeTEST(QWidget *parent = nullptr); ~qColadaTreeTEST() = default; public slots: booladdH5File(h5gt::File file); // file - is of type `h5gt::File` -> it has python bindings }; #endifas you can see it accepts h5gt::File file wich is not Qt based C++ class. But h5gt library has python bindings done with pybind11 so it is accessible from python.
When qColadaTreeTEST is binded via PythonQt I cannot call addH5File with h5gt.File argument as it gives me an error:
importqColadaAppPythonQtq=qColadaAppPythonQt.qColadaTreeTEST() fromh5gtpyimporth5gtfile_name='D:/test.h5'file=h5gt.File(file_name, h5gt.OpenFlag(h5gt.ReadWrite|h5gt.Create|h5gt.Truncate)) q.addH5File(file) # here I get the following error:Traceback (mostrecentcalllast): File"<console>", line1, in<module>ValueError: CalledaddH5File(h5gt::Filefile) ->boolwithwrongarguments: (<h5gtpy._h5gt.Fileobjectat0x00000285128901F0>,)How to tell PythonQt that h5gt::File C++ class is the same as h5gtpy._h5gt.File in Python?
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested