Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkCallbackFromGUIThread Class Reference

Qt-specific implementation of mitk::CallbackFromGUIThreadImplementation. More...

#include <QmitkCallbackFromGUIThread.h>

Inheritance diagram for QmitkCallbackFromGUIThread:
Collaboration diagram for QmitkCallbackFromGUIThread:

Public Member Functions

void CallThisFromGUIThread (itk::Command *cmd, itk::EventObject *e) override
 Post the given command for execution on the GUI thread. More...
 
 QmitkCallbackFromGUIThread ()
 Construct and register as the global GUI thread callback implementation. More...
 
 ~QmitkCallbackFromGUIThread () override
 Destructor. More...
 
bool event (QEvent *e) override
 Process posted callback events. More...
 
- Public Member Functions inherited from mitk::CallbackFromGUIThreadImplementation
virtual ~CallbackFromGUIThreadImplementation ()
 

Detailed Description

Qt-specific implementation of mitk::CallbackFromGUIThreadImplementation.

Allows executing itk::Command objects from the Qt GUI thread by posting custom QEvents into the Qt event queue. This is necessary for thread-safe GUI updates from background threads in MITK.

On construction, this object registers itself as the global callback implementation via mitk::CallbackFromGUIThread::RegisterImplementation().

See also
mitk::CallbackFromGUIThread, mitk::CallbackFromGUIThreadImplementation

Definition at line 33 of file QmitkCallbackFromGUIThread.h.

Constructor & Destructor Documentation

◆ QmitkCallbackFromGUIThread()

QmitkCallbackFromGUIThread::QmitkCallbackFromGUIThread ( )

Construct and register as the global GUI thread callback implementation.

◆ ~QmitkCallbackFromGUIThread()

QmitkCallbackFromGUIThread::~QmitkCallbackFromGUIThread ( )
override

Destructor.

Member Function Documentation

◆ CallThisFromGUIThread()

void QmitkCallbackFromGUIThread::CallThisFromGUIThread ( itk::Command *  cmd,
itk::EventObject *  e 
)
overridevirtual

Post the given command for execution on the GUI thread.

The command will be executed asynchronously when the Qt event loop processes the posted event.

Parameters
[in]cmdThe itk::Command to execute.
[in]eThe itk::EventObject to pass to the command. Ownership is transferred.

Implements mitk::CallbackFromGUIThreadImplementation.

◆ event()

bool QmitkCallbackFromGUIThread::event ( QEvent *  e)
override

Process posted callback events.

Parameters
[in]eThe QEvent to handle.
Returns
True if the event was a callback event and was handled.

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