QPy
Python-Qt dynamic bindings
 All Classes Namespaces Files Functions
Public Member Functions
qpy::PyCBackMethod Class Reference

C++ method abstraction: Qt signals are connected to instances of this class which invokes associated Python functions through the Invoke method. More...

#include <PyCallbackDispatcher.h>

List of all members.

Public Member Functions

 PyCBackMethod (PyContext *pc, PyObject *pm, const CBackParameterTypes &p, PyObject *pyCBack)
 Constructor.
void Invoke (void **arguments)
 Called by QObject::qt_metacall as part of a signal-method invocation.
PyObject * CBack () const
 Return associated reference to Python function.
void DeleteCBack ()

Detailed Description

C++ method abstraction: Qt signals are connected to instances of this class which invokes associated Python functions through the Invoke method.

At signal connection time a signal is connected to a dynamically created instance of this class which stores internally a reference to the Python function to invoke.


Constructor & Destructor Documentation

qpy::PyCBackMethod::PyCBackMethod ( PyContext pc,
PyObject *  pm,
const CBackParameterTypes &  p,
PyObject *  pyCBack 
) [inline]

Constructor.

Parameters:
pcPyContext
psignal signature: This information is used to translate the parameter values received from the signal (as an array of void*) into Python values
pyCBackreference to Python function to invoke

Member Function Documentation

This is required to release the bound function when disconnect is invoked since methods are never removed from the list to maintain consistency between the method id and the position in the list itself

void qpy::PyCBackMethod::Invoke ( void **  arguments)

Called by QObject::qt_metacall as part of a signal-method invocation.

Iterates over the list of arguments and parameter types in parallel and for each argument uses the corresponding parameter wrapper to create PyObjects from Qt types. Values which are of QObject* type are automatically translated to PyQObject QObjects added to the Python contexts are not owned by Python.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions