Krita Source Code Documentation
Loading...
Searching...
No Matches
KisColorInput Class Referenceabstract

#include <kis_color_input.h>

+ Inheritance diagram for KisColorInput:

Signals

void updated ()
 

Public Member Functions

 KisColorInput (QWidget *parent, const KoChannelInfo *, KoColor *color, KoColorDisplayRendererInterface *displayRenderer=KoDumbColorDisplayRenderer::instance(), bool usePercentage=false)
 
virtual void setPercentageWise (bool val)
 
bool usePercentage () const
 

Protected Member Functions

virtual QWidget * createInput ()=0
 
void init ()
 

Protected Attributes

const KoChannelInfom_channelInfo {nullptr}
 
KoColorm_color {nullptr}
 
KoColorSliderm_colorSlider {nullptr}
 
KoColorDisplayRendererInterfacem_displayRenderer {nullptr}
 
bool m_usePercentage {false}
 

Detailed Description

Definition at line 28 of file kis_color_input.h.

Constructor & Destructor Documentation

◆ KisColorInput()

KisColorInput::KisColorInput ( QWidget * parent,
const KoChannelInfo * channelInfo,
KoColor * color,
KoColorDisplayRendererInterface * displayRenderer = KoDumbColorDisplayRenderer::instance(),
bool usePercentage = false )

Definition at line 42 of file kis_color_input.cpp.

42 :
43 QWidget(parent), m_channelInfo(channelInfo), m_color(color), m_displayRenderer(displayRenderer),
45{
46}
const KoChannelInfo * m_channelInfo
KoColor * m_color
KoColorDisplayRendererInterface * m_displayRenderer
bool usePercentage() const

Member Function Documentation

◆ createInput()

virtual QWidget * KisColorInput::createInput ( )
protectedpure virtual

◆ init()

void KisColorInput::init ( )
protected

Definition at line 48 of file kis_color_input.cpp.

49{
50 QHBoxLayout* m_layout = new QHBoxLayout(this);
51 m_layout->setContentsMargins(0,0,0,0);
52 m_layout->setSpacing(1);
53
54 QLabel* m_label = new QLabel(i18n("%1:", m_channelInfo->name()), this);
55 m_layout->addWidget(m_label);
56
57 m_colorSlider = new KoColorSlider(Qt::Horizontal, this, m_displayRenderer);
58 m_colorSlider->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
59 m_layout->addWidget(m_colorSlider);
60
61 QWidget* m_input = createInput();
62 m_layout->addWidget(m_input);
63}
KoColorSlider * m_colorSlider
virtual QWidget * createInput()=0
QString name() const

References createInput(), m_channelInfo, m_colorSlider, m_displayRenderer, and KoChannelInfo::name().

◆ setPercentageWise()

virtual void KisColorInput::setPercentageWise ( bool val)
inlinevirtual

Reimplemented in KisIntegerColorInput.

Definition at line 36 of file kis_color_input.h.

36 {
37 m_usePercentage = val;
38 }

◆ updated

void KisColorInput::updated ( )
signal

◆ usePercentage()

bool KisColorInput::usePercentage ( ) const
inline

Definition at line 33 of file kis_color_input.h.

33 {
34 return m_usePercentage;
35 }

Member Data Documentation

◆ m_channelInfo

const KoChannelInfo* KisColorInput::m_channelInfo {nullptr}
protected

Definition at line 46 of file kis_color_input.h.

46{nullptr};

◆ m_color

KoColor* KisColorInput::m_color {nullptr}
protected

Definition at line 47 of file kis_color_input.h.

47{nullptr};

◆ m_colorSlider

KoColorSlider* KisColorInput::m_colorSlider {nullptr}
protected

Definition at line 48 of file kis_color_input.h.

48{nullptr};

◆ m_displayRenderer

KoColorDisplayRendererInterface* KisColorInput::m_displayRenderer {nullptr}
protected

Definition at line 49 of file kis_color_input.h.

49{nullptr};

◆ m_usePercentage

bool KisColorInput::m_usePercentage {false}
protected

Definition at line 50 of file kis_color_input.h.

50{false};

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