24 #include <QCoreApplication> 41 : m_observerLock(QMutex::Recursive),
49 QMutexLocker locker(&m_observerLock);
50 if (!Observer || m_observers.contains(Observer))
52 m_observers.append(Observer);
58 QMutexLocker locker(&m_observerLock);
59 m_observers.removeAll(Observer);
65 QMutexLocker locker(&m_observerLock);
66 foreach (QObject* observer, m_observers)
67 QCoreApplication::postEvent(observer, Event.
Copy());
TorcEvent * Copy(void) const
Copy this event.
A general purpose event object.
void AddObserver(QObject *Observer)
brief Register the given object to receive events.
void Notify(const TorcEvent &Event)
Brief Send the given event to each registered listener/observer.
void RemoveObserver(QObject *Observer)
brief Deregister the given object.