Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkColorPropertyEditor Class Reference

Editable color swatch for a mitk::ColorProperty. More...

#include <QmitkColorPropertyEditor.h>

Inheritance diagram for QmitkColorPropertyEditor:
Collaboration diagram for QmitkColorPropertyEditor:

Public Member Functions

 QmitkColorPropertyEditor (const mitk::ColorProperty *property, QWidget *parent)
 Construct an editor for the given color property. More...
 
 ~QmitkColorPropertyEditor () override
 Destructor. Decrements the shared color chooser reference count. More...
 
- Public Member Functions inherited from QmitkColorPropertyView
 QmitkColorPropertyView (const mitk::ColorProperty *property, QWidget *parent)
 Construct a color view for the given property. More...
 
 ~QmitkColorPropertyView () override
 Destructor. More...
 
- Public Member Functions inherited from mitk::PropertyView
 PropertyView (const mitk::BaseProperty *property)
 Constructor. Begins observing the given property. More...
 
 ~PropertyView () override
 Destructor. Removes the ITK observer from the property. More...
 
void OnModified (const itk::EventObject &e)
 Callback for itk::ModifiedEvent on the observed property. More...
 
void OnDelete (const itk::EventObject &e)
 Callback for itk::DeleteEvent on the observed property. More...
 
- Public Member Functions inherited from mitk::PropertyObserver
 PropertyObserver ()
 Constructor. More...
 
virtual ~PropertyObserver ()
 Virtual destructor. More...
 

Protected Slots

void onColorSelected (QColor)
 

Protected Member Functions

void mousePressEvent (QMouseEvent *) override
 
void mouseReleaseEvent (QMouseEvent *) override
 
- Protected Member Functions inherited from QmitkColorPropertyView
void PropertyChanged () override
 Called when the observed property value has changed. More...
 
void PropertyRemoved () override
 Called when the observed property is about to be deleted. More...
 
void DisplayColor ()
 
- Protected Member Functions inherited from mitk::PropertyObserver
void BeginModifyProperty ()
 Marks the beginning of a self-initiated property modification. More...
 
void EndModifyProperty ()
 Marks the end of a self-initiated property modification. More...
 

Static Protected Attributes

static QmitkPopupColorChooser * colorChooser
 
static int colorChooserRefCount
 

Additional Inherited Members

- Protected Attributes inherited from QmitkColorPropertyView
const mitk::ColorProperty * m_ColorProperty
 
QPalette m_WidgetPalette
 
- Protected Attributes inherited from mitk::PropertyView
const mitk::BaseProperty * m_Property
 The observed property (read-only). More...
 
- Protected Attributes inherited from mitk::PropertyObserver
unsigned long m_ModifiedTag
 ITK observer tag for the ModifiedEvent. More...
 
unsigned long m_DeleteTag
 ITK observer tag for the DeleteEvent. More...
 
bool m_SelfCall
 Guard flag to prevent re-entrant notification. More...
 

Detailed Description

Editable color swatch for a mitk::ColorProperty.

Extends QmitkColorPropertyView with editing capability. On mouse press, a QmitkPopupColorChooser appears allowing the user to pick a new color. The selected color is written back to the associated mitk::ColorProperty and a rendering update is requested.

A shared static QmitkPopupColorChooser instance is used across all editors.

See also
QmitkColorPropertyView, QmitkPopupColorChooser

Definition at line 113 of file QmitkColorPropertyEditor.h.

Constructor & Destructor Documentation

◆ QmitkColorPropertyEditor()

QmitkColorPropertyEditor::QmitkColorPropertyEditor ( const mitk::ColorProperty *  property,
QWidget *  parent 
)

Construct an editor for the given color property.

Parameters
[in]propertyThe mitk::ColorProperty to edit.
[in]parentThe parent widget.

◆ ~QmitkColorPropertyEditor()

QmitkColorPropertyEditor::~QmitkColorPropertyEditor ( )
override

Destructor. Decrements the shared color chooser reference count.

Member Function Documentation

◆ mousePressEvent()

void QmitkColorPropertyEditor::mousePressEvent ( QMouseEvent *  )
overrideprotected

◆ mouseReleaseEvent()

void QmitkColorPropertyEditor::mouseReleaseEvent ( QMouseEvent *  )
overrideprotected

◆ onColorSelected

void QmitkColorPropertyEditor::onColorSelected ( QColor  )
protectedslot

Member Data Documentation

◆ colorChooser

QmitkPopupColorChooser* QmitkColorPropertyEditor::colorChooser
staticprotected

Definition at line 132 of file QmitkColorPropertyEditor.h.

◆ colorChooserRefCount

int QmitkColorPropertyEditor::colorChooserRefCount
staticprotected

Definition at line 133 of file QmitkColorPropertyEditor.h.


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