OpenWalnut  1.5.0dev
Public Slots | Public Member Functions | Protected Member Functions | Protected Attributes | Static Private Member Functions | List of all members
WPropertyColorWidget Class Reference

Implements a property widget for WPropColor. More...

#include <WPropertyColorWidget.h>

+ Inheritance diagram for WPropertyColorWidget:
+ Collaboration diagram for WPropertyColorWidget:

Public Slots

void buttonClicked ()
 Called when the m_button is clicked. More...
 

Public Member Functions

 WPropertyColorWidget (WPropColor property, QGridLayout *propertyGrid, QWidget *parent=0)
 Constructor. More...
 
virtual ~WPropertyColorWidget ()
 Destructor. More...
 
void setColorPickerButtonHidden (bool hide=true)
 Hide the button for a more compact layout. More...
 
- Public Member Functions inherited from WPropertyWidget
 WPropertyWidget (std::shared_ptr< WPropertyBase > property, QGridLayout *propertyGrid, QWidget *parent=0)
 Constructor. More...
 
virtual ~WPropertyWidget ()
 Destructor. More...
 
std::shared_ptr< WPropertyBasegetProperty ()
 Returns the handled property. More...
 
virtual void invalidate (bool invalid=true)
 This method marks this widget as invalid. More...
 
virtual std::string getTooltip () const
 Gets the tooltip that should be used for this widget. More...
 
QWidget * getParameterWidgets ()
 Returns the parameter widget for this property. More...
 
QWidget * getInformationWidgets ()
 Returns the info widget for this property. More...
 
virtual void requestUpdate ()
 Request an update of the property widget. More...
 
void forceInformationMode (bool force=true)
 Force the widget to use the information widgets. More...
 

Protected Member Functions

virtual void setColor (const QColor &color)
 Internal helper, called to set the color. More...
 
virtual void update ()
 Called whenever the widget should update. More...
 
virtual void dragEnterEvent (QDragEnterEvent *event)
 Reimplemented to accept color drops. More...
 
virtual void dropEvent (QDropEvent *event)
 Reimplemented to accept color drops. More...
 
- Protected Member Functions inherited from WPropertyWidget
virtual bool event (QEvent *event)
 Custom event dispatcher. More...
 

Protected Attributes

WPropColor m_colorProperty
 The integer property represented by this widget. More...
 
QWidget m_widget
 The button field showing the value. More...
 
QWidget * m_colPanel
 Color display panel. More...
 
QToolButton * m_colButton
 Color picker button. More...
 
QHBoxLayout m_layout
 Layout used to position the label and the checkbox. More...
 
WScaleLabel m_asText
 Used to show the property as text. More...
 
QHBoxLayout m_infoLayout
 The layout used for the pure output (information properties) More...
 
QActionm_colorPickerAction
 Color picker. More...
 
- Protected Attributes inherited from WPropertyWidget
std::shared_ptr< WPropertyBasem_property
 The property handled by the widget. More...
 
QGridLayout * m_propertyGrid
 The grid used to layout label and widget. More...
 
WScaleLabel m_label
 The label used to name the property. More...
 
QWidget m_separator
 Separator after each property. More...
 
bool m_useLabel
 If set to true, the widgets uses the control layout to combine the widget with a label. More...
 
QWidget m_parameterWidgets
 The widget containing a layout and provides the edit widgets for the property. More...
 
QWidget m_informationWidgets
 The widget containing a layout and provides the widgets for showing information properties. More...
 
bool m_invalid
 Flag denoting whether the widget is set to an invalid value. More...
 
boost::signals2::connection m_connection
 The connection for propertyChangeNotifier(). More...
 
QColor m_sepCol
 The color to use for separators. More...
 
QColor m_labelCol
 The color to use for the property labels. More...
 
QColor m_propertyCol
 The color to use for property widgets. More...
 
QColor m_errorCol
 Color used for indicating errors. More...
 

Static Private Member Functions

static QColor toQColor (WColor color)
 Helper to convert between QColor and WColor. More...
 
static WColor toWColor (QColor color)
 Helper to convert between QColor and WColor. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from WPropertyWidget
static WPropertyWidgetconstruct (WPropertyBase::SPtr property, QGridLayout *propertyGrid=NULL, QWidget *parent=NULL)
 Constructs a proper widget for the specified property. More...
 

Detailed Description

Implements a property widget for WPropColor.

Definition at line 43 of file WPropertyColorWidget.h.

Constructor & Destructor Documentation

◆ WPropertyColorWidget()

WPropertyColorWidget::WPropertyColorWidget ( WPropColor  property,
QGridLayout *  propertyGrid,
QWidget *  parent = 0 
)

Constructor.

Creates a new widget appropriate for the specified property.

Parameters
propertythe property to handle
parentthe parent widget.
propertyGridthe grid used to layout the labels and property widgets

Definition at line 42 of file WPropertyColorWidget.cpp.

References buttonClicked(), WQtGui::getMainWindow(), m_asText, m_colButton, m_colorPickerAction, m_colPanel, m_infoLayout, WPropertyWidget::m_informationWidgets, m_layout, WPropertyWidget::m_parameterWidgets, m_widget, and update().

+ Here is the call graph for this function:

◆ ~WPropertyColorWidget()

WPropertyColorWidget::~WPropertyColorWidget ( )
virtual

Destructor.

Definition at line 93 of file WPropertyColorWidget.cpp.

Member Function Documentation

◆ buttonClicked

void WPropertyColorWidget::buttonClicked ( )
slot

Called when the m_button is clicked.

Definition at line 155 of file WPropertyColorWidget.cpp.

References WPropertyWidget::invalidate(), m_colorProperty, setColor(), toQColor(), and toWColor().

Referenced by WPropertyColorWidget().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dragEnterEvent()

void WPropertyColorWidget::dragEnterEvent ( QDragEnterEvent *  event)
protectedvirtual

Reimplemented to accept color drops.

Parameters
eventthe handled event

Definition at line 174 of file WPropertyColorWidget.cpp.

References WPropertyWidget::event().

+ Here is the call graph for this function:

◆ dropEvent()

void WPropertyColorWidget::dropEvent ( QDropEvent *  event)
protectedvirtual

Reimplemented to accept color drops.

Parameters
eventthe handled event

Definition at line 182 of file WPropertyColorWidget.cpp.

References WPropertyWidget::event(), WPropertyWidget::invalidate(), m_colorProperty, setColor(), and toWColor().

+ Here is the call graph for this function:

◆ setColor()

void WPropertyColorWidget::setColor ( const QColor &  color)
protectedvirtual

Internal helper, called to set the color.

Parameters
colorthe new color

Definition at line 110 of file WPropertyColorWidget.cpp.

References m_asText, m_colorPickerAction, m_colorProperty, m_colPanel, WScaleLabel::setText(), and toQColor().

Referenced by buttonClicked(), dropEvent(), and update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setColorPickerButtonHidden()

void WPropertyColorWidget::setColorPickerButtonHidden ( bool  hide = true)

Hide the button for a more compact layout.

Parameters
hidetrue to hide

Definition at line 98 of file WPropertyColorWidget.cpp.

References m_colButton.

Referenced by WQtBranchTreeItem::WQtBranchTreeItem().

+ Here is the caller graph for this function:

◆ toQColor()

QColor WPropertyColorWidget::toQColor ( WColor  color)
staticprivate

Helper to convert between QColor and WColor.

Parameters
colora color
Returns
the corresponding QColor.

Definition at line 139 of file WPropertyColorWidget.cpp.

Referenced by buttonClicked(), setColor(), and update().

+ Here is the caller graph for this function:

◆ toWColor()

WColor WPropertyColorWidget::toWColor ( QColor  color)
staticprivate

Helper to convert between QColor and WColor.

Parameters
colora color
Returns
the corresponding WColor.

Definition at line 150 of file WPropertyColorWidget.cpp.

Referenced by buttonClicked(), and dropEvent().

+ Here is the caller graph for this function:

◆ update()

void WPropertyColorWidget::update ( )
protectedvirtual

Called whenever the widget should update.

Implements WPropertyWidget.

Definition at line 103 of file WPropertyColorWidget.cpp.

References m_colorProperty, setColor(), and toQColor().

Referenced by WPropertyColorWidget().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_asText

WScaleLabel WPropertyColorWidget::m_asText
protected

Used to show the property as text.

Definition at line 120 of file WPropertyColorWidget.h.

Referenced by setColor(), and WPropertyColorWidget().

◆ m_colButton

QToolButton* WPropertyColorWidget::m_colButton
protected

Color picker button.

Definition at line 110 of file WPropertyColorWidget.h.

Referenced by setColorPickerButtonHidden(), and WPropertyColorWidget().

◆ m_colorPickerAction

QAction* WPropertyColorWidget::m_colorPickerAction
protected

Color picker.

Definition at line 130 of file WPropertyColorWidget.h.

Referenced by setColor(), and WPropertyColorWidget().

◆ m_colorProperty

WPropColor WPropertyColorWidget::m_colorProperty
protected

The integer property represented by this widget.

Definition at line 95 of file WPropertyColorWidget.h.

Referenced by buttonClicked(), dropEvent(), setColor(), and update().

◆ m_colPanel

QWidget* WPropertyColorWidget::m_colPanel
protected

Color display panel.

Definition at line 105 of file WPropertyColorWidget.h.

Referenced by setColor(), and WPropertyColorWidget().

◆ m_infoLayout

QHBoxLayout WPropertyColorWidget::m_infoLayout
protected

The layout used for the pure output (information properties)

Definition at line 125 of file WPropertyColorWidget.h.

Referenced by WPropertyColorWidget().

◆ m_layout

QHBoxLayout WPropertyColorWidget::m_layout
protected

Layout used to position the label and the checkbox.

Definition at line 115 of file WPropertyColorWidget.h.

Referenced by WPropertyColorWidget().

◆ m_widget

QWidget WPropertyColorWidget::m_widget
protected

The button field showing the value.

Definition at line 100 of file WPropertyColorWidget.h.

Referenced by WPropertyColorWidget().


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