Public Member Functions | Protected Member Functions | Protected Attributes

QmitkColorPropertyView Class Reference
[Widgets]

#include <QmitkColorPropertyView.h>

Inheritance diagram for QmitkColorPropertyView:
Inheritance graph
[legend]
Collaboration diagram for QmitkColorPropertyView:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 QmitkColorPropertyView (const mitk::ColorProperty *, QWidget *parent)
virtual ~QmitkColorPropertyView ()

Protected Member Functions

virtual void PropertyChanged ()
virtual void PropertyRemoved ()
void DisplayColor ()

Protected Attributes

const mitk::ColorPropertym_ColorProperty
QPalette m_WidgetPalette

Detailed Description

Definition at line 26 of file QmitkColorPropertyView.h.


Constructor & Destructor Documentation

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

Definition at line 21 of file QmitkColorPropertyView.cpp.

References m_WidgetPalette, and PropertyChanged().

: QLabel( parent ),
  PropertyView( property ),
  m_ColorProperty(property)
  //m_SelfCall(false)
{
  setText("  "); // two spaces for some minimun height
  setMinimumSize(15,15);
  PropertyChanged();
  
  m_WidgetPalette = QWidget::palette();
  QWidget::setPalette(m_WidgetPalette);
  QWidget::setAutoFillBackground(true);
}
QmitkColorPropertyView::~QmitkColorPropertyView (  ) [virtual]

Definition at line 36 of file QmitkColorPropertyView.cpp.

{
}

Member Function Documentation

void QmitkColorPropertyView::DisplayColor (  ) [protected]

Definition at line 74 of file QmitkColorPropertyView.cpp.

References mitk::ColorProperty::GetColor(), m_ColorProperty, m_WidgetPalette, and ROUND_P.

Referenced by PropertyChanged().

{
  const mitk::Color& tmp_col(m_ColorProperty->GetColor());

  QColor color( ROUND_P(tmp_col[0] * 255.0), ROUND_P(tmp_col[1] * 255.0) , ROUND_P(tmp_col[2] * 255.0) );
  //m_SelfCall = true;
  //QWidget::setPaletteBackgroundColor( color );
  //m_SelfCall = false;
  
  m_WidgetPalette.setColor(QPalette::Background, color);
}
void QmitkColorPropertyView::PropertyChanged (  ) [protected, virtual]

Implements mitk::PropertyObserver.

Definition at line 61 of file QmitkColorPropertyView.cpp.

References DisplayColor(), and mitk::PropertyView::m_Property.

Referenced by QmitkColorPropertyView().

{
  if ( m_Property )
    DisplayColor();
}
void QmitkColorPropertyView::PropertyRemoved (  ) [protected, virtual]

Implements mitk::PropertyObserver.

Definition at line 67 of file QmitkColorPropertyView.cpp.

References m_ColorProperty, and mitk::PropertyView::m_Property.

{
  m_Property = NULL;
  m_ColorProperty = NULL;
  //QLabel::setPaletteBackgroundPixmap( QPixmap(no_color_icon_xpm) );
}

Member Data Documentation

Definition at line 48 of file QmitkColorPropertyView.h.

Referenced by DisplayColor(), and QmitkColorPropertyView().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines