Seamly2D
Code documentation
ColorComboBox Class Reference

#include <color_combobox.h>

Inheritance diagram for ColorComboBox:
Collaboration diagram for ColorComboBox:

Signals

void colorChangedSignal (const QString &color)
 

Public Member Functions

 ColorComboBox (QWidget *parent=nullptr, const char *name=nullptr)
 
 ColorComboBox (int width, int height, QWidget *parent=nullptr, const char *name=nullptr)
 
virtual ~ColorComboBox ()
 
QString getColor () const
 
void setColor (const QString &color)
 
void setItems (QMap< QString, QString > map)
 
int getIconWidth ()
 
int getIconHeight ()
 

Private Slots

void colorChanged (int index)
 

Private Member Functions

void init ()
 

Private Attributes

QString m_currentColor
 
int m_iconWidth
 
int m_iconHeight
 

Detailed Description

A comboBox for choosing a color.

Definition at line 16 of file color_combobox.h.

Constructor & Destructor Documentation

◆ ColorComboBox() [1/2]

ColorComboBox::ColorComboBox ( QWidget *  parent = nullptr,
const char *  name = nullptr 
)

Definition at line 21 of file color_combobox.cpp.

◆ ColorComboBox() [2/2]

ColorComboBox::ColorComboBox ( int  width,
int  height,
QWidget *  parent = nullptr,
const char *  name = nullptr 
)

Definition at line 35 of file color_combobox.cpp.

References init().

◆ ~ColorComboBox()

ColorComboBox::~ColorComboBox ( )
virtual

Destructor

Definition at line 50 of file color_combobox.cpp.

Member Function Documentation

◆ colorChanged

void ColorComboBox::colorChanged ( int  index)
privateslot

Definition at line 115 of file color_combobox.cpp.

References colorChangedSignal(), and m_currentColor.

Referenced by init(), setColor(), and setItems().

◆ colorChangedSignal

void ColorComboBox::colorChangedSignal ( const QString &  color)
signal

Referenced by colorChanged().

◆ getColor()

QString ColorComboBox::getColor ( ) const

Definition at line 128 of file color_combobox.cpp.

References m_currentColor.

◆ getIconHeight()

int ColorComboBox::getIconHeight ( )

Definition at line 138 of file color_combobox.cpp.

References m_iconHeight.

◆ getIconWidth()

int ColorComboBox::getIconWidth ( )

Definition at line 133 of file color_combobox.cpp.

References m_iconWidth.

◆ init()

void ColorComboBox::init ( )
private

Definition at line 55 of file color_combobox.cpp.

References colorChanged(), VAbstractTool::ColorsList(), and setItems().

Referenced by ColorComboBox().

◆ setColor()

void ColorComboBox::setColor ( const QString &  color)

Definition at line 98 of file color_combobox.cpp.

References colorChanged(), and m_currentColor.

◆ setItems()

void ColorComboBox::setItems ( QMap< QString, QString >  map)

Definition at line 64 of file color_combobox.cpp.

References ColorByGroup, colorChanged(), VAbstractTool::createColorIcon(), m_iconHeight, and m_iconWidth.

Referenced by init().

Member Data Documentation

◆ m_currentColor

QString ColorComboBox::m_currentColor
private

Definition at line 39 of file color_combobox.h.

Referenced by colorChanged(), getColor(), and setColor().

◆ m_iconHeight

int ColorComboBox::m_iconHeight
private

Definition at line 41 of file color_combobox.h.

Referenced by getIconHeight(), and setItems().

◆ m_iconWidth

int ColorComboBox::m_iconWidth
private

Definition at line 40 of file color_combobox.h.

Referenced by getIconWidth(), and setItems().


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