Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-3073

Q_ARG fails for PyObjects

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • Not Evaluated
    • None
    • 6.8.0, 6.9.0
    • PySide
    • None
    • Windows 10
      PySide6 6.8.0 or 6.9.0 from PyPI
    • Windows

    Description

      Signals and slots may use PyObject (object in Python) or it's subclasses as argument/return types. However, QtCore.Q_ARG cannot accept these types, and so these slots cannot be called using QtCore.QMetaObject.invokeMethod.

      I tried a few different options, but none work:

      # RuntimeError: qArgDataFromPyType: Unable to find a QMetaType for "object".
      QtCore.QMetaObject.invokeMethod(obj, "slotObject", QtCore.Q_ARG(object, arg))
      
      # QMetaObject::invokeMethod: No such method Obj::slotObject(PySide::PyObjectWrapper)
      # Candidates are:
      #     slotObject(PyObject)
      QtCore.QMetaObject.invokeMethod(obj, "slotObject", QtCore.Q_ARG("PyObject", arg))
      
      # RuntimeError: qArgDataFromPyType: Unable to find a QMetaType for "PyObject*".
      QtCore.QMetaObject.invokeMethod(obj, "slotObject", QtCore.Q_ARG("PyObject*", arg))
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            crmaurei Cristian Maureira-Fredes
            matsjoyce-refeyn Matthew Joyce
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes