Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. PyCapsule in Shiboken bindings
Forum Updated to NodeBB v4.3 + New Features

PyCapsule in Shiboken bindings

Scheduled Pinned Locked Moved Unsolved Qt for Python
1 Posts 1 Posters 188 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    Falcarius
    wrote on last edited by
    #1

    I am currently writing a python binding for a Qt C++ library using Shiboken. While most typesystem bindings are quite clear, I struggle with the usage of PyCapsule.

    I would like to use a third party library that comes with a python binding and wraps a function pointer using a PyCapsule which I would like to pass to one of my library's functions in python. In my bindings I thus need to get the pointer back from this PyCapsule and pass it to my C++ Function. When writing the binding layer by hand the extraction is quite straightforward:

    if (PyCapsule_CheckExact(capsule)) {
        ptr = PyCapsule_GetPointer(capsule, "name");
    }
    

    I attempted to write similar code in a user defined type conversion in the Shiboken type system but did not succeed so I am wondering how to appropriately treat PyCapsules in Shiboken bindings?

    1 Reply Last reply
    1

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved