itom 2.0.0
ito::PythonQtSignalTarget Class Reference

List of all members.

Public Member Functions

 PythonQtSignalTarget ()
 empty constructor
 PythonQtSignalTarget (IntList &argTypeList, int slotId, int signalId, PyObject *callable, const char *signal)
 constructor
 PythonQtSignalTarget (const PythonQtSignalTarget &copy)
 copy constructor
 ~PythonQtSignalTarget ()
 destructor
int signalId () const
 gets the id of the original signal
int slotId () const
 gets the id that was assigned to this simulated slot
void call (void **arguments) const
 invokes the python method or function
IntList argTypeList () const
 returns list of type-numbers of arguments
bool isSame (int signalId, PyObject *callable) const
 Compares this signal target with given values.

Private Attributes

int m_slotId
 index of this slot
int m_signalId
 index of the connected signal
IntList m_argTypeList
 type id's from QMetaType::type("..."), describing the arguments of the function-call
PyObject * m_function
 weak reference to the python-function, that acts as slot
PyObject * m_boundedInstance
 weak reference to the python-class instance of the function (if the function is bounded) or NULL if the function is unbounded
bool m_boundedMethod
 true if the python function is bounded (non-static member of a class), else false
QString m_signalName
 signature of the signal (mainly used for debugging reasons)

Constructor & Destructor Documentation

ito::PythonQtSignalTarget::PythonQtSignalTarget ( IntList &  argTypeList,
int  slotId,
int  signalId,
PyObject *  callable,
const char *  signal 
) [inline]

constructor

Constructs the virtual slot as target for any signal. If this slot is invoked, the given python method is executed.

If the python method is a method (hence bounded), both a weak reference of the method and its containing instance is stored. If it is an unbounded function, only the weak reference to the function is saved.

Parameters:
[in]argTypeListis a list of integer-based type number, describing the type of each argument as given by QMetaType
[in]slotIdis the assigned index for this slot (must be unique)
[in]signalIdis the index of the emitting signal
[in]callabelis a python method or function (bounded or unbounded) that should be called if the slot is invoked
[in]signalis the signature of the signal (for debugging reasons)

Member Function Documentation

void ito::PythonQtSignalTarget::call ( void **  arguments) const

invokes the python method or function

If the slot is invoked, the python method or function is executed by this function. Usually the method is directly executed. If the user toggled the debug-button in the main window, the method is started in debug-mode. However, this is only done if python is in idle-mode at the point of the start of the execution.

The exeuction is as follows: 1. It is checked whether the method should be executed or started in debug-mode 2. The given arguments are marshalled to PyObject-values and added to a tuple. 3. The python method or function is called.

Parameters:
[in]argumentsare the arguments of the emitted signal.
bool ito::PythonQtSignalTarget::isSame ( int  signalId,
PyObject *  callable 
) const [inline]

Compares this signal target with given values.

checks whether the given signal index and the reference to the python method is the same than the values of this instance of PythonQtSignalTarget

Parameters:
[in]signalIdis the signal index (source of the signal-slot connection)
[in]callableis the python slot method (slot, destination of the signal-slot connection)
Returns:
true if they are equal, else false.

The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends