Skip to content

Get slot information from PythonQt object #7

Closed

Description

@tonka3000

Hey @florianlink , @sboehmann ,

I've try to build a .pyi stub file (PEP 484) generator for the PythonQt module. I have to introspect the objects via dir function, but that's the same approach as PySide2 has. My main problem is that I can not get the slots information to get all overloads (and also not from __init__). When I call and PythonQt function wrong, I always get an ValueError with the possible slots, which would be exactly the content I need, but throw an exception for every PythonQt module, class, method, etc. is extremely slow.

Is there any possiblity (maybe via patch) to get to this information without raising an error per PythonQt object?

The information seems to be stored in PythonQtSlot.cpp.

Any idea, help?

Thanks in advance

Tonka

Activity

  1. changed the title [-]Get slot information from python object[/-] [+]Get slot information from PythonQt object[/+] on Jan 23, 2020
  2. florianlink commented on Aug 9, 2020

    @florianlink
    Collaborator

    Sorry, I overlooked this...

    Slots have the following methods, which return tuples for all overloads:

    parameterTypes", (PyCFunction)PythonQtSlotFunction_parameterTypes, METH_NOARGS,
    "Returns a tuple of tuples of the C++ parameter types for all overloads of the slot"
    },
    {"parameterNames", (PyCFunction)PythonQtSlotFunction_parameterNames, METH_NOARGS,
    "Returns a tuple of tuples of the C++ parameter type names (if available), for all overloads of the slot"
    },
    {"typeName", (PyCFunction)PythonQtSlotFunction_typeName, METH_NOARGS,
    "Returns a tuple of the C++ return value types of each slot overload"
    },

  3. locked and limited conversation to collaborators on Oct 11, 2022
  4. converted this issue into a discussion #73 on Oct 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions