cumbia-qtcontrols 1.x
Qt widgets on top of the cumbia C++ library
QThreadsEventBridge Class Reference

an event bridge to post a CuEventI event to a QApplication More...

#include <qthreadseventbridge.h>

Inheritance diagram for QThreadsEventBridge:

Public Member Functions

 QThreadsEventBridge ()
 the class constructor
 
virtual ~QThreadsEventBridge ()
 the class destructor
 
void postEvent (CuEventI *e)
 posts an event through QApplication::postEvent, normally from the CuThread's thread to the event loop's
 
void setCuThreadsEventBridgeListener (CuThreadsEventBridgeListener *l)
 set the event bridge listener on the bridge
 

Protected Member Functions

bool event (QEvent *event)
 receives a QEvent from QApplication and delivers the contents to a registered CuThreadsEventBridgeListener on the main thread.
 

Detailed Description

an event bridge to post a CuEventI event to a QApplication

Constructor & Destructor Documentation

◆ QThreadsEventBridge()

QThreadsEventBridge::QThreadsEventBridge ( )

the class constructor

Constructs a new instance of the object

◆ ~QThreadsEventBridge()

QThreadsEventBridge::~QThreadsEventBridge ( )
virtual

the class destructor

class destructor

Member Function Documentation

◆ event()

bool QThreadsEventBridge::event ( QEvent * event)
protected

receives a QEvent from QApplication and delivers the contents to a registered CuThreadsEventBridgeListener on the main thread.

Parameters
eventa QEvent that wraps a CuEventI.

If the QEvent::type is QEvent::User + 101, then QEvent is safely casted to a CuEvent_Qt object. CuEvent_Qt contains a CuEventI instance, that is delivered to a registered CuThreadsEventBridgeListener.

Returns
true if the event is a CuEvent_Qt
QObject::event(event) otherwise

References event(), and re().

Referenced by event().

◆ postEvent()

void QThreadsEventBridge::postEvent ( CuEventI * e)

posts an event through QApplication::postEvent, normally from the CuThread's thread to the event loop's

Parameters
ea CuEventI
examples of functions calling this method from the background
thread:
  • CuThread::publishResult
  • CuThread::publishExitEvent
  • CuThread::publishProgress

◆ setCuThreadsEventBridgeListener()

void QThreadsEventBridge::setCuThreadsEventBridgeListener ( CuThreadsEventBridgeListener * l)

set the event bridge listener on the bridge

Parameters
la CuThreadsEventBridgeListener, such as CuThread

When an event is delivered through the QApplication event loop, (QThreadsEventBridge::event) CuThreadsEventBridgeListener::onEventPosted is called on the main thread.


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