|
| PythonQtSignalTarget () |
| empty constructor
|
|
| PythonQtSignalTarget (IntList &argTypeList, int slotId, int signalId, PyObject *callable, const char *signal, int minRepeatInterval) |
| constructor
|
|
| PythonQtSignalTarget (const PythonQtSignalTarget ©) |
| copy constructor
|
|
| ~PythonQtSignalTarget () |
| destructor
|
|
PythonQtSignalTarget & | operator= (const PythonQtSignalTarget &rhs) |
| assignment operator
|
|
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) |
| 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.
|
|
|
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 |
|
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
|
|
CallableType | m_callableType |
| type of the python callable (see CallableType)
|
|
QString | m_signalName |
| signature of the signal (mainly used for debugging reasons)
|
|
QElapsedTimer | m_elapsedTimer |
| see m_minRepeatInterval
|
|
int | m_minRepeatInterval |
|
◆ CallableType
Enumerator |
---|
Callable_Invalid | the callable is invalid
class method (written in python), the function is stored in m_function, the self object is stored in m_boundedInstance
|
Callable_Method | unbounded python method, the function is stored in m_function, m_boundedInstance is NULL
|
Callable_Function | function, written in C, stored in m_function. m_boundedInstance is NULL, since the potential self object is also contained in the CFunction object
|
◆ PythonQtSignalTarget()
ito::PythonQtSignalTarget::PythonQtSignalTarget |
( |
IntList & | argTypeList, |
|
|
int | slotId, |
|
|
int | signalId, |
|
|
PyObject * | callable, |
|
|
const char * | signal, |
|
|
int | minRepeatInterval ) |
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] | argTypeList | is a list of integer-based type number, describing the type of each argument as given by QMetaType |
[in] | slotId | is the assigned index for this slot (must be unique) |
[in] | signalId | is the index of the emitting signal |
[in] | callabel | is a python method or function (bounded or unbounded) that should be called if the slot is invoked |
[in] | signal | is the signature of the signal (for debugging reasons) |
[in] | minRepeatInterval | is a minimum amount of time (in ms) which has to be passed until the same signal-slot-connection is accepted again (additional signal emissions are blocked), default: 0 (no timeout) |
◆ call()
void ito::PythonQtSignalTarget::call |
( |
void ** | arguments | ) |
|
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 execution is as follows:
- It is checked whether the method should be executed or started in debug-mode
- The given arguments are marshalled to PyObject-values and added to a tuple.
- The python method or function is called.
- Parameters
-
[in] | arguments | are the arguments of the emitted signal. |
◆ isSame()
bool ito::PythonQtSignalTarget::isSame |
( |
int | signalId, |
|
|
PyObject * | callable ) const |
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] | signalId | is the signal index (source of the signal-slot connection) |
[in] | callable | is 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:
- C:/Workspace/itom_development_VS2019_Qt5.15.2_x64/itomProject/itom/Qitom/python/pythonQtSignalMapper.h
- C:/Workspace/itom_development_VS2019_Qt5.15.2_x64/itomProject/itom/Qitom/python/pythonQtSignalMapper.cpp