23 #ifndef PYTHONQTSIGNALMAPPER_H 24 #define PYTHONQTSIGNALMAPPER_H 27 #define PY_ARRAY_UNIQUE_SYMBOL itom_ARRAY_API 31 #if (defined _DEBUG) && (defined WIN32) 40 #include "../global.h" 85 PyObject *temp = NULL;
87 if(PyMethod_Check(callable))
92 temp = PyMethod_Self(callable);
94 temp = PyMethod_Function(callable);
97 else if(PyFunction_Check(callable))
102 m_function = PyWeakref_NewRef(callable, NULL);
143 void call(
void ** arguments)
const;
160 if(PyMethod_Check(callable))
162 return PyMethod_Self(callable) == PyWeakref_GetObject(
m_boundedInstance) && PyMethod_Function(callable) == PyWeakref_GetObject(
m_function);
164 return callable == PyWeakref_GetObject(
m_function);
210 bool addSignalHandler(QObject *obj,
const char* signal,
int sigId, PyObject* callable, IntList &
argTypeList);
211 bool removeSignalHandler(QObject *obj,
const char* signal,
int sigId, PyObject* callable);
212 void removeSignalHandlers();
213 virtual int qt_metacall(QMetaObject::Call c,
int id,
void **arguments);
IntList m_argTypeList
type id's from QMetaType::type("..."), describing the arguments of the function-call ...
Definition: pythonQtSignalMapper.h:172
int signalId() const
gets the id of the original signal
Definition: pythonQtSignalMapper.h:137
Definition: pythonQtSignalMapper.h:48
PyObject * m_function
weak reference to the python-function, that acts as slot
Definition: pythonQtSignalMapper.h:173
PythonQtSignalTarget(const PythonQtSignalTarget ©)
copy constructor
Definition: pythonQtSignalMapper.h:107
PythonQtSignalTarget(IntList &argTypeList, int slotId, int signalId, PyObject *callable, const char *signal)
constructor
Definition: pythonQtSignalMapper.h:76
void call(void **arguments) const
invokes the python method or function
Definition: pythonQtSignalMapper.cpp:198
bool isSame(int signalId, PyObject *callable) const
Compares this signal target with given values.
Definition: pythonQtSignalMapper.h:156
Definition: apiFunctionsGraph.cpp:39
~PythonQtSignalTarget()
destructor
Definition: pythonQtSignalMapper.h:129
bool m_boundedMethod
true if the python function is bounded (non-static member of a class), else false ...
Definition: pythonQtSignalMapper.h:175
IntList argTypeList() const
returns list of type-numbers of arguments
Definition: pythonQtSignalMapper.h:146
int slotId() const
gets the id that was assigned to this simulated slot
Definition: pythonQtSignalMapper.h:140
int m_slotCount
index of the last virtual slot managed by this instance (auto-incremented)
Definition: pythonQtSignalMapper.h:217
int m_slotId
index of this slot
Definition: pythonQtSignalMapper.h:170
PythonQtSignalTarget()
empty constructor
Definition: pythonQtSignalMapper.h:53
int m_signalId
index of the connected signal
Definition: pythonQtSignalMapper.h:171
PyObject * m_boundedInstance
weak reference to the python-class instance of the function (if the function is bounded) or NULL if t...
Definition: pythonQtSignalMapper.h:174
QString m_signalName
signature of the signal (mainly used for debugging reasons)
Definition: pythonQtSignalMapper.h:176
base class for PythonQtSignalMapper
Definition: pythonQtSignalMapper.h:195
This class provides the possibility to redirect any signal emitted in an user-defined GUI to differen...
Definition: pythonQtSignalMapper.h:203
QList< PythonQtSignalTarget > m_targets
list with all virtual slot targets that are the destination for any registered signal-slot-connection...
Definition: pythonQtSignalMapper.h:216