Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkCustomWidgetOverlay Class Reference

Overlay that wraps an externally provided custom QWidget. More...

#include <QmitkCustomWidgetOverlay.h>

Inheritance diagram for QmitkCustomWidgetOverlay:
Collaboration diagram for QmitkCustomWidgetOverlay:

Public Member Functions

 QmitkCustomWidgetOverlay (const char *id)
 Constructor. More...
 
 ~QmitkCustomWidgetOverlay () override
 Destructor. More...
 
void SetWidget (QWidget *widget)
 Sets the custom widget to be managed as an overlay. More...
 
QSize GetNeededSize () override
 Returns the current size of the custom widget. More...
 
- Public Member Functions inherited from QmitkOverlay
 QmitkOverlay (const char *id)
 Constructor. More...
 
 ~QmitkOverlay () override
 Destructor. Deletes the internal widget unless it was set externally. More...
 
virtual void SetPosition (DisplayPosition pos)
 Sets the display position of this overlay. More...
 
virtual DisplayPosition GetPosition ()
 Returns the current display position. More...
 
virtual void SetLayer (unsigned int layer)
 Sets the stacking layer of this overlay. More...
 
virtual unsigned int GetLayer ()
 Returns the current stacking layer. More...
 
virtual void GenerateData (mitk::PropertyList::Pointer pl)
 Configures the overlay using properties from the given PropertyList. More...
 
virtual QWidget * GetWidget ()
 Returns the internal QWidget representing this overlay. More...
 

Additional Inherited Members

- Public Types inherited from QmitkOverlay
enum  DisplayPosition {
  top_Left , top_Center , top_Right , middle_Left ,
  middle_Right , bottom_Left , bottom_Center , bottom_Right
}
 Enumeration of all possible display positions in a render window. More...
 
- Protected Member Functions inherited from QmitkOverlay
void AddDropShadow (QWidget *widget)
 Adds a drop shadow graphics effect to the given widget. More...
 
- Protected Attributes inherited from QmitkOverlay
const char * m_Id
 ID of the overlay, used as property key for lookups. More...
 
DisplayPosition m_Position
 Current display position of the overlay. More...
 
unsigned int m_Layer
 Stacking layer of the overlay. More...
 
QWidget * m_Widget
 Internal QWidget representing the overlay content. More...
 
bool m_WidgetIsCustom
 Flag indicating whether the widget was set externally (custom overlay). More...
 

Detailed Description

Overlay that wraps an externally provided custom QWidget.

A QmitkCustomWidgetOverlay is a generic sub-class of QmitkOverlay. It offers the possibility to set the internal widget from the outside.

This allows positioning custom widgets 'on top of' other widgets using the positioning mechanism of the overlay framework.

Warning
The custom widgets need to be configured and connected manually. Properties set via GenerateData() have no effect on custom widgets.
See also
QmitkOverlay
QmitkOverlayController

Definition at line 38 of file QmitkCustomWidgetOverlay.h.

Constructor & Destructor Documentation

◆ QmitkCustomWidgetOverlay()

QmitkCustomWidgetOverlay::QmitkCustomWidgetOverlay ( const char *  id)

Constructor.

Parameters
[in]idString identifier used to look up overlay properties.

◆ ~QmitkCustomWidgetOverlay()

QmitkCustomWidgetOverlay::~QmitkCustomWidgetOverlay ( )
override

Destructor.

Member Function Documentation

◆ GetNeededSize()

QSize QmitkCustomWidgetOverlay::GetNeededSize ( )
overridevirtual

Returns the current size of the custom widget.

Returns
The QSize of the internal widget.

Implements QmitkOverlay.

◆ SetWidget()

void QmitkCustomWidgetOverlay::SetWidget ( QWidget *  widget)

Sets the custom widget to be managed as an overlay.

The widget replaces the internal widget pointer. Ownership is not transferred; the widget will not be deleted when this overlay is destroyed.

Parameters
[in]widgetThe custom QWidget to display as an overlay. Ignored if nullptr.

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