NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
Public Types | Public Member Functions | Protected Member Functions | List of all members
niftk::QtSignalCollector Class Reference

Class for collecting Qt signals and sending notifications of them to registered listeners. More...

Inheritance diagram for niftk::QtSignalCollector:
Inheritance graph
[legend]
Collaboration diagram for niftk::QtSignalCollector:
Collaboration graph
[legend]

Public Types

typedef std::pair< const
QObject *, QByteArray > 
Signal
 
typedef std::vector< SignalSignals
 

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 SignalsGetSignals () 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...
 

Detailed Description

Class for collecting Qt signals and sending notifications of them to registered listeners.

Member Typedef Documentation

typedef std::pair<const QObject*, QByteArray> niftk::QtSignalCollector::Signal

Constructor & Destructor Documentation

niftk::QtSignalCollector::QtSignalCollector ( )
protected

Constructs an QtSignalCollector object.

niftk::QtSignalCollector::~QtSignalCollector ( )
protectedvirtual

Destructs an QtSignalCollector object.

Member Function Documentation

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::Clear ( void  )
virtual

Clears all the signals collected by now.

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   
)
void niftk::QtSignalCollector::OnQtSignalReceived ( const QObject *  object,
const char *  signal 
)
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.

void niftk::QtSignalCollector::PrintSelf ( std::ostream &  os,
itk::Indent  indent 
) const
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.


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