PythonQt
PythonQtSignalReceiver Class Reference

connects a signal to a callable More...

#include <PythonQtSignalReceiver.h>

Inheritance diagram for PythonQtSignalReceiver:
PythonQtSignalReceiverBase

Public Member Functions

 PythonQtSignalReceiver (QObject *sender, int signalId, PyObject *callable)
 ~PythonQtSignalReceiver () override
QObject * sender () const
 Returns the signal sender for which this receiver was created.
int signalId () const
 Returns the signal ID for which this receiver was created.
bool isSameCallable (PyObject *callable) const
 Check if this object targets the callable given as argument.
void markAsRemoved ()
 Mark this object as already removed from the global list of signal receivers.
int qt_metacall (QMetaObject::Call c, int id, void **arguments) override
 We implement this method to either call the callable, or react to the fact that the sender was destroyed.
Public Member Functions inherited from PythonQtSignalReceiverBase
 PythonQtSignalReceiverBase ()=default

Static Public Member Functions

static int getSignalIndex (QObject *sender, const char *signal)
 Get the index of a sender's signal.

Detailed Description

connects a signal to a callable

we derive from our base but do not declare the QObject macro because we want to reimplement qt_metacall only.

Definition at line 99 of file PythonQtSignalReceiver.h.

Constructor & Destructor Documentation

◆ PythonQtSignalReceiver()

PythonQtSignalReceiver::PythonQtSignalReceiver ( QObject * sender,
int signalId,
PyObject * callable )

References sender(), and signalId().

◆ ~PythonQtSignalReceiver()

PythonQtSignalReceiver::~PythonQtSignalReceiver ( )
override

Member Function Documentation

◆ getSignalIndex()

int PythonQtSignalReceiver::getSignalIndex ( QObject * sender,
const char * signal )
static

Get the index of a sender's signal.

References sender().

◆ isSameCallable()

bool PythonQtSignalReceiver::isSameCallable ( PyObject * callable) const

Check if this object targets the callable given as argument.

◆ markAsRemoved()

void PythonQtSignalReceiver::markAsRemoved ( )

Mark this object as already removed from the global list of signal receivers.

◆ qt_metacall()

int PythonQtSignalReceiver::qt_metacall ( QMetaObject::Call c,
int id,
void ** arguments )
override

We implement this method to either call the callable, or react to the fact that the sender was destroyed.

◆ sender()

QObject * PythonQtSignalReceiver::sender ( ) const
inline

Returns the signal sender for which this receiver was created.

Definition at line 107 of file PythonQtSignalReceiver.h.

107{ return _sender; }

Referenced by getSignalIndex(), and PythonQtSignalReceiver().

◆ signalId()

int PythonQtSignalReceiver::signalId ( ) const
inline

Returns the signal ID for which this receiver was created.

Definition at line 110 of file PythonQtSignalReceiver.h.

110{ return _signalId; }

Referenced by PythonQtSignalReceiver().


The documentation for this class was generated from the following file: