The SignalSpy class enables introspection of signal emission. More...
#include <SignalSpy.h>
Public Member Functions | |
SignalSpy (const QObject *inObject, const QString &inSignal, SignalLogger *inLogger) | |
Creates a SignalSpy that outputs emissions of the given signal (normalized signature). | |
int | qt_metacall (QMetaObject::Call inCall, int inMethodId, void **inArgs) |
Called whenever a signal emission occurs. | |
const MethodData & | SignalData () const |
Returns information about the signal being spied. | |
int | EmitCount () const |
Returns the number of monitored emissions for the signal. | |
Private Member Functions | |
void | InitArgs (const QMetaMethod &inMember) |
Stores the argument types for the signal being monitored. | |
void | ProcessArgs (void **inArgs) |
Processes the arguments of a signal emission and outputs information about that signal emission. | |
Private Attributes | |
SignalLogger * | mLogger |
Performs the actual logging of each signal emission. | |
QList< int > | mArgTypes |
The QMetaType types for the argument list of the signal. | |
MethodData | mSignalData |
Information about the signal being spied. | |
unsigned | mEmitCount |
The number of times the signal has been emitted. |
The SignalSpy class enables introspection of signal emission.
SignalSpy can connect to any signal of any object and output each emission using qDebug. Note that this class is an adaptation of the existing QSignalSpy class.
conan::SignalSpy::SignalSpy | ( | const QObject * | inObject, | |
const QString & | inSignal, | |||
SignalLogger * | inLogger | |||
) |
Creates a SignalSpy that outputs emissions of the given signal (normalized signature).
All actual logging is delegated to the given logger.
int conan::SignalSpy::EmitCount | ( | ) | const |
Returns the number of monitored emissions for the signal.
void conan::SignalSpy::InitArgs | ( | const QMetaMethod & | inMember | ) | [private] |
Stores the argument types for the signal being monitored.
void conan::SignalSpy::ProcessArgs | ( | void ** | inArgs | ) | [private] |
Processes the arguments of a signal emission and outputs information about that signal emission.
int conan::SignalSpy::qt_metacall | ( | QMetaObject::Call | inCall, | |
int | inMethodId, | |||
void ** | inArgs | |||
) |
Called whenever a signal emission occurs.
const MethodData & conan::SignalSpy::SignalData | ( | ) | const |
Returns information about the signal being spied.
QList<int> conan::SignalSpy::mArgTypes [private] |
The QMetaType types for the argument list of the signal.
unsigned conan::SignalSpy::mEmitCount [private] |
The number of times the signal has been emitted.
SignalLogger* conan::SignalSpy::mLogger [private] |
Performs the actual logging of each signal emission.
MethodData conan::SignalSpy::mSignalData [private] |
Information about the signal being spied.