1 #ifndef _PYTHONQTSIGNALRECEIVER_H
2 #define _PYTHONQTSIGNALRECEIVER_H
60 _methodInfo =
nullptr;
68 _methodInfo = methodInfo;
79 int slotId()
const {
return _slotId; }
85 void call(
void **arguments)
const;
125 int qt_metacall(QMetaObject::Call c,
int id,
void **arguments)
override;
129 int getSignalIndex(
const char* signal);
134 int _destroyedSignalCount;
136 QList<PythonQtSignalTarget> _targets;
138 static int _destroyedSignal1Id;
139 static int _destroyedSignal2Id;
a class that stores all required information about a Qt object (and an optional associated C++ class ...
stores information about a specific signal/slot/method
a smart pointer that stores a PyObject pointer and that handles reference counting automatically
base class for signal receivers
PythonQtSignalReceiverBase(QObject *obj)
receives all signals for one QObject
bool addSignalHandler(const char *signal, PyObject *callable)
add a signal handler
~PythonQtSignalReceiver() override
int qt_metacall(QMetaObject::Call c, int id, void **arguments) override
we implement this method to simulate a number of slots that match the ids in _targets
bool removeSignalHandler(const char *signal, PyObject *callable=nullptr)
remove a signal handler for given callable (or all callables on that signal if callable is NULL)
PythonQtSignalReceiver(QObject *obj)
stores information about a signal target
bool isSame(int signalId, PyObject *callable) const
check if it is the same signal target
int slotId() const
get the id that was assigned to this simulated slot
static PyObject * call(PyObject *callable, const PythonQtMethodInfo *methodInfo, void **arguments, bool skipFirstArgumentOfMethodInfo=false)
call the given callable with arguments described by PythonQtMethodInfo, returns a new reference as re...
void call(void **arguments) const
call the python callable with the given arguments (as defined in methodInfo)
int signalId() const
get the id of the original signal
const PythonQtMethodInfo * methodInfo() const
get the signals parameter info
PythonQtSignalTarget(int signalId, const PythonQtMethodInfo *methodInfo, int slotId, PyObject *callable)