Seamly2D
Code documentation
VPE::VColorPropertyEditor Class Reference

#include <vcolorpropertyeditor.h>

Inheritance diagram for VPE::VColorPropertyEditor:
Collaboration diagram for VPE::VColorPropertyEditor:

Public Slots

void setLineColor (const QColor &color_)
 Sets the color of the widget. More...
 

Signals

void dataChangedByUser (const QColor &GetColor, VColorPropertyEditor *editor)
 This is emitted, when the user changes the color. More...
 
void dataChanged ()
 

Public Member Functions

 VColorPropertyEditor (QWidget *parent)
 Constructor taking a widget as parent. More...
 
virtual ~VColorPropertyEditor () Q_DECL_OVERRIDE
 Destructor. More...
 
QColor getLineColor () const
 Returns the color currently set. More...
 
virtual bool eventFilter (QObject *obj, QEvent *ev) Q_DECL_OVERRIDE
 Needed for proper event handling. More...
 

Static Public Member Functions

static QPixmap GetColorPixmap (const QColor &color, quint32 size=16)
 A little helper function generating an image to represent a color. More...
 
static QString GetColorString (const QColor &color)
 A helper function to convert a color into a string. More...
 

Private Slots

void onToolButtonClicked ()
 

Private Attributes

QColor Color
 
QToolButton * ToolButton
 
QLabel * TextLabel
 
QLabel * ColorLabel
 
QSpacerItem * Spacer
 

Detailed Description

Definition at line 40 of file vcolorpropertyeditor.h.

Constructor & Destructor Documentation

◆ VColorPropertyEditor()

VPE::VColorPropertyEditor::VColorPropertyEditor ( QWidget *  parent)
explicit

Constructor taking a widget as parent.

Definition at line 36 of file vcolorpropertyeditor.cpp.

References Color, ColorLabel, GetColorPixmap(), GetColorString(), onToolButtonClicked(), Spacer, TextLabel, and ToolButton.

◆ ~VColorPropertyEditor()

VPE::VColorPropertyEditor::~VColorPropertyEditor ( )
virtual

Destructor.

Definition at line 122 of file vcolorpropertyeditor.cpp.

Member Function Documentation

◆ dataChanged

void VPE::VColorPropertyEditor::dataChanged ( )
signal

◆ dataChangedByUser

void VPE::VColorPropertyEditor::dataChangedByUser ( const QColor &  GetColor,
VColorPropertyEditor editor 
)
signal

This is emitted, when the user changes the color.

◆ eventFilter()

bool VPE::VColorPropertyEditor::eventFilter ( QObject *  obj,
QEvent *  ev 
)
virtual

Needed for proper event handling.

Definition at line 109 of file vcolorpropertyeditor.cpp.

◆ GetColorPixmap()

QPixmap VPE::VColorPropertyEditor::GetColorPixmap ( const QColor &  color,
quint32  size = 16 
)
static

A little helper function generating an image to represent a color.

Parameters
colorThe color to fill the image with \size The size of the generated pixmap
Returns
Returns a QPixmap

Definition at line 84 of file vcolorpropertyeditor.cpp.

Referenced by VPE::VColorProperty::data(), and VColorPropertyEditor().

◆ GetColorString()

QString VPE::VColorPropertyEditor::GetColorString ( const QColor &  color)
static

A helper function to convert a color into a string.

Parameters
colorThe color to fill the image with
Returns
The color as string, usually in the format [RRR, GGG, BBB] (AAA)

Definition at line 92 of file vcolorpropertyeditor.cpp.

Referenced by VPE::VColorProperty::data(), and VColorPropertyEditor().

◆ getLineColor()

QColor VPE::VColorPropertyEditor::getLineColor ( ) const

Returns the color currently set.

Definition at line 127 of file vcolorpropertyeditor.cpp.

Referenced by VPE::VColorProperty::getEditorData().

◆ onToolButtonClicked

void VPE::VColorPropertyEditor::onToolButtonClicked ( )
privateslot

Definition at line 97 of file vcolorpropertyeditor.cpp.

Referenced by VColorPropertyEditor().

◆ setLineColor

void VPE::VColorPropertyEditor::setLineColor ( const QColor &  color_)
slot

Sets the color of the widget.

Definition at line 74 of file vcolorpropertyeditor.cpp.

Referenced by VPE::VColorProperty::createEditor(), and VPE::VColorProperty::setEditorData().

Member Data Documentation

◆ Color

QColor VPE::VColorPropertyEditor::Color
private

Definition at line 84 of file vcolorpropertyeditor.h.

Referenced by VColorPropertyEditor().

◆ ColorLabel

QLabel* VPE::VColorPropertyEditor::ColorLabel
private

Definition at line 87 of file vcolorpropertyeditor.h.

Referenced by VColorPropertyEditor().

◆ Spacer

QSpacerItem* VPE::VColorPropertyEditor::Spacer
private

Definition at line 88 of file vcolorpropertyeditor.h.

Referenced by VColorPropertyEditor().

◆ TextLabel

QLabel* VPE::VColorPropertyEditor::TextLabel
private

Definition at line 86 of file vcolorpropertyeditor.h.

Referenced by VColorPropertyEditor().

◆ ToolButton

QToolButton* VPE::VColorPropertyEditor::ToolButton
private

Definition at line 85 of file vcolorpropertyeditor.h.

Referenced by VColorPropertyEditor().


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