Title: Bind class that accepts object from external package · Issue #55 · MeVisLab/pythonqt · GitHub
Open Graph Title: Bind class that accepts object from external package · Issue #55 · MeVisLab/pythonqt
X Title: Bind class that accepts object from external package · Issue #55 · MeVisLab/pythonqt
Description: Hi, I have simple class: #ifndef __qColadaTreeTEST_h #define __qColadaTreeTEST_h // Qt includes #include
Open Graph Description: Hi, I have simple class: #ifndef __qColadaTreeTEST_h #define __qColadaTreeTEST_h // Qt includes #include X Description: Hi, I have simple class: #ifndef __qColadaTreeTEST_h #define __qColadaTreeTEST_h // Qt includes #include <QTreeView> // Colada includes #include "qColadaAppExport.h" // h5gt include...
Opengraph URL: https://github.com/MeVisLab/pythonqt/issues/55
X: @github
Domain: patch-diff.githubusercontent.com
Links:
Viewport: width=device-width
Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Bind class that accepts object from external package","articleBody":"Hi,\r\n\r\nI have simple class:\r\n```cpp\r\n#ifndef __qColadaTreeTEST_h\r\n#define __qColadaTreeTEST_h\r\n\r\n// Qt includes\r\n#include \u003cQTreeView\u003e\r\n\r\n// Colada includes\r\n#include \"qColadaAppExport.h\"\r\n\r\n// h5gt includes\r\n#include \u003ch5gt/H5File.hpp\u003e // has python bindings using pybind11 \r\n\r\nclass Q_COLADA_APP_EXPORT qColadaTreeTEST : public QTreeView {\r\n Q_OBJECT\r\n\r\npublic:\r\n explicit qColadaTreeTEST(QWidget *parent = nullptr);\r\n ~qColadaTreeTEST() = default;\r\n\r\npublic slots:\r\n bool addH5File(h5gt::File file); // file - is of type `h5gt::File` -\u003e it has python bindings\r\n};\r\n\r\n#endif\r\n```\r\nas 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.\r\n\r\nWhen `qColadaTreeTEST` is binded via PythonQt I cannot call `addH5File` with `h5gt.File` argument as it gives me an error:\r\n```python\r\nimport qColadaAppPythonQt\r\nq = qColadaAppPythonQt.qColadaTreeTEST()\r\n\r\nfrom h5gtpy import h5gt\r\nfile_name = 'D:/test.h5'\r\nfile = h5gt.File(file_name, h5gt.OpenFlag(h5gt.ReadWrite | h5gt.Create | h5gt.Truncate))\r\n\r\nq.addH5File(file) # here I get the following error:\r\n\r\nTraceback (most recent call last):\r\n File \"\u003cconsole\u003e\", line 1, in \u003cmodule\u003e\r\nValueError: Called addH5File(h5gt::File file) -\u003e bool with wrong arguments: (\u003ch5gtpy._h5gt.File object at 0x00000285128901F0\u003e,)\r\n```\r\nHow to tell PythonQt that `h5gt::File` C++ class is the same as `h5gtpy._h5gt.File` in Python?\r\n","author":{"url":"https://github.com/kerim371","@type":"Person","name":"kerim371"},"datePublished":"2021-07-20T10:54:34.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/55/pythonqt/issues/55"}
route-pattern /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) route-controller voltron_issues_fragments route-action issue_layout fetch-nonce v2:1a487587-bf1a-049d-2a34-59efd9b3381d current-catalog-service-hash 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 request-id B7D0:AD4AF:2335B81:31728FC:6970F382 html-safe-nonce 3f0443d125c36efc64c86a4d5f00083b7e27e00d7e68a229165474f11bba935a visitor-payload eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCN0QwOkFENEFGOjIzMzVCODE6MzE3MjhGQzo2OTcwRjM4MiIsInZpc2l0b3JfaWQiOiI1MDQyOTg3NjUzOTY3OTY3MTA2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= visitor-hmac b08ad1240337ce37984897d017e77c36046259f861b41c3986cbc6bbc27391d1 hovercard-subject-tag issue:948536730 github-keyboard-shortcuts repository,issues,copilot google-site-verification Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I octolytics-url https://collector.github.com/github/collect analytics-location / fb:app_id 1401488693436528 apple-itunes-app app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/MeVisLab/pythonqt/55/issue_layout twitter:image https://opengraph.githubassets.com/be29c1473666f29a1123fa64810d9e46a7206a3767271f9c7bcf0c7b15dcc2b8/MeVisLab/pythonqt/issues/55 twitter:card summary_large_image og:image https://opengraph.githubassets.com/be29c1473666f29a1123fa64810d9e46a7206a3767271f9c7bcf0c7b15dcc2b8/MeVisLab/pythonqt/issues/55 og:image:alt Hi, I have simple class: #ifndef __qColadaTreeTEST_h #define __qColadaTreeTEST_h // Qt includes #include og:image:width 1200 og:image:height 600 og:site_name GitHub og:type object og:author:username kerim371 hostname github.com expected-hostname github.com None b6ca3cb96fa07d8a62b95d681f9dc8fffb49a43f4fea2a5bcac6d8f5107cbf4e turbo-cache-control no-preview go-import github.com/MeVisLab/pythonqt git https://github.com/MeVisLab/pythonqt.git octolytics-dimension-user_id 15028021 octolytics-dimension-user_login MeVisLab octolytics-dimension-repository_id 193056137 octolytics-dimension-repository_nwo MeVisLab/pythonqt octolytics-dimension-repository_public true octolytics-dimension-repository_is_fork false octolytics-dimension-repository_network_root_id 193056137 octolytics-dimension-repository_network_root_nwo MeVisLab/pythonqt turbo-body-classes logged-out env-production page-responsive disable-turbo false browser-stats-url https://api.github.com/_private/browser/stats browser-errors-url https://api.github.com/_private/browser/errors release d2448578278810c7bf94faa67651ef5adb1abfde ui-target full theme-color #1e2327 color-scheme light dark
URLs of crawlers that visited me.