NifTK
16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
|
Class for collecting Qt signals and sending notifications of them to registered listeners. More...
Public Types | |
typedef std::pair< const QObject *, QByteArray > | Signal |
typedef std::vector< Signal > | Signals |
Public Member Functions | |
mitkClassMacroItkParent (QtSignalCollector, QObject) static Pointer New() | |
void | Connect (const QObject *object, const char *signal=0) |
Connects this object to the signals of the given object. The current object will collect the given signals of that object. More... | |
void | AddListener (QtSignalListener *listener) |
Adds a listener that will get notified of the Qt signals that this object is connected to. More... | |
void | RemoveListener (QtSignalListener *listener) |
Removes a listener. The listener will not get notified about the Qt signals observed by the current object, any more. More... | |
const Signals & | GetSignals () const |
Gets the signals collected by this object. More... | |
Signals | GetSignals (const char *signal) const |
Returns a set of the collected Qt signals that are of the given type. More... | |
Signals | GetSignals (const QObject *object, const char *signal=0) const |
Returns a set of the collected Qt signals that are sent from the given object, and are of the given type. More... | |
virtual void | Clear () |
Clears all the signals collected by now. More... | |
Protected Member Functions | |
QtSignalCollector () | |
Constructs an QtSignalCollector object. More... | |
virtual | ~QtSignalCollector () |
Destructs an QtSignalCollector object. More... | |
virtual void | PrintSelf (std::ostream &os, itk::Indent indent) const override |
Prints the collected signals to the given stream or to the standard output if no stream is given. More... | |
virtual void | OnQtSignalReceived (const QObject *object, const char *signal) override |
Adds the object-signal pair to the list of collected signals. More... | |
Class for collecting Qt signals and sending notifications of them to registered listeners.
typedef std::pair<const QObject*, QByteArray> niftk::QtSignalCollector::Signal |
typedef std::vector<Signal> niftk::QtSignalCollector::Signals |
|
protected |
Constructs an QtSignalCollector object.
|
protectedvirtual |
Destructs an QtSignalCollector object.
void niftk::QtSignalCollector::AddListener | ( | QtSignalListener * | listener | ) |
Adds a listener that will get notified of the Qt signals that this object is connected to.
void niftk::QtSignalCollector::Connect | ( | const QObject * | object, |
const char * | signal = 0 |
||
) |
Connects this object to the signals of the given object. The current object will collect the given signals of that object.
const QtSignalCollector::Signals & niftk::QtSignalCollector::GetSignals | ( | ) | const |
Gets the signals collected by this object.
QtSignalCollector::Signals niftk::QtSignalCollector::GetSignals | ( | const char * | signal | ) | const |
Returns a set of the collected Qt signals that are of the given type.
QtSignalCollector::Signals niftk::QtSignalCollector::GetSignals | ( | const QObject * | object, |
const char * | signal = 0 |
||
) | const |
Returns a set of the collected Qt signals that are sent from the given object, and are of the given type.
niftk::QtSignalCollector::mitkClassMacroItkParent | ( | QtSignalCollector | , |
QObject | |||
) |
|
overrideprotectedvirtual |
Adds the object-signal pair to the list of collected signals.
Create a copy of the event as a newly allocated object.
Implements niftk::QtSignalListener.
|
overrideprotectedvirtual |
Prints the collected signals to the given stream or to the standard output if no stream is given.
Note that the SIGNAL macro inserted a '2' character before the signature of the signal. We do not want to print that, that is why we step the pointer by 1 (constData() + 1).
void niftk::QtSignalCollector::RemoveListener | ( | QtSignalListener * | listener | ) |
Removes a listener. The listener will not get notified about the Qt signals observed by the current object, any more.