KSeExpr 6.0.0.0
Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
VectorControl Class Reference

A vector or color control (named vector because it edits a KSeExpr::Vec3d literal) More...

#include <ExprControl.h>

Inheritance diagram for VectorControl:
ExprControl

Public Member Functions

 VectorControl (int id, VectorEditable *editable)
 
QColor getColor () override
 Interface for getting the color (used for linked color picking)
 
void setColor (QColor color) override
 Interface for setting the color (used for linked color picking)
 
- Public Member Functions inherited from ExprControl
 ExprControl (int id, Editable *editable, bool showColorLink)
 
 ~ExprControl () override=default
 
void linkDisconnect (int newId)
 

Private Slots

void sliderChanged (int id, double val)
 
void editChanged (int id, const QString &text)
 
void swatchChanged (QColor color)
 

Private Member Functions

void setValue (int n, double value)
 set the value in the model (in response to editing from controls)
 
void updateControl ()
 update the individual slider and eidt box controls
 

Private Attributes

VectorEditable_numberEditable {nullptr}
 Number model.
 
std::array< ExprLineEdit *, 3 > _edits {}
 All three line edit widgets (for each component)
 
ExprCSwatchFrame_swatch {nullptr}
 
std::array< ExprChannelSlider *, 3 > _sliders {}
 All three channel sliders (for each component)
 

Additional Inherited Members

- Public Slots inherited from ExprControl
void linkStateChange (int state)
 
- Signals inherited from ExprControl
void controlChanged (int id)
 
void linkColorEdited (int id, QColor color)
 
void linkColorLink (int id)
 
- Protected Member Functions inherited from ExprControl
void resizeEvent (QResizeEvent *event) override
 
- Protected Attributes inherited from ExprControl
int _id
 
std::atomic< bool > _updating {}
 
QHBoxLayout * hbox {nullptr}
 
QCheckBox * _colorLinkCB {nullptr}
 
QLabel * _label {nullptr}
 
Editable_editable {nullptr}
 

Detailed Description

A vector or color control (named vector because it edits a KSeExpr::Vec3d literal)

Definition at line 195 of file ExprControl.h.

Constructor & Destructor Documentation

◆ VectorControl()

VectorControl::VectorControl ( int  id,
VectorEditable editable 
)

Member Function Documentation

◆ editChanged

void VectorControl::editChanged ( int  id,
const QString &  text 
)
privateslot

Definition at line 370 of file ExprControl.cpp.

References ExprControl::_updating, and setValue().

Referenced by VectorControl().

◆ getColor()

QColor VectorControl::getColor ( )
overridevirtual

Interface for getting the color (used for linked color picking)

Reimplemented from ExprControl.

Definition at line 349 of file ExprControl.cpp.

References _numberEditable, clamp(), and VectorEditable::v.

Referenced by sliderChanged().

◆ setColor()

void VectorControl::setColor ( QColor  )
overridevirtual

Interface for setting the color (used for linked color picking)

Reimplemented from ExprControl.

Definition at line 354 of file ExprControl.cpp.

References setValue().

◆ setValue()

void VectorControl::setValue ( int  n,
double  value 
)
private

set the value in the model (in response to editing from controls)

Definition at line 409 of file ExprControl.cpp.

References ExprControl::_id, _numberEditable, _swatch, ExprControl::controlChanged(), ExprCSwatchFrame::setValue(), updateControl(), and VectorEditable::v.

Referenced by editChanged(), setColor(), sliderChanged(), and swatchChanged().

◆ sliderChanged

void VectorControl::sliderChanged ( int  id,
double  val 
)
privateslot

◆ swatchChanged

void VectorControl::swatchChanged ( QColor  color)
privateslot

Definition at line 341 of file ExprControl.cpp.

References _swatch, ExprCSwatchFrame::getValue(), and setValue().

Referenced by VectorControl().

◆ updateControl()

void VectorControl::updateControl ( )
private

update the individual slider and eidt box controls

Definition at line 381 of file ExprControl.cpp.

References _edits, ExprControl::_label, _numberEditable, _sliders, ExprControl::_updating, clamp(), VectorEditable::isColor, VectorEditable::max, VectorEditable::min, and VectorEditable::v.

Referenced by setValue(), and VectorControl().

Member Data Documentation

◆ _edits

std::array<ExprLineEdit *, 3> VectorControl::_edits {}
private

All three line edit widgets (for each component)

Definition at line 202 of file ExprControl.h.

Referenced by updateControl(), and VectorControl().

◆ _numberEditable

VectorEditable* VectorControl::_numberEditable {nullptr}
private

Number model.

Definition at line 200 of file ExprControl.h.

Referenced by getColor(), setValue(), sliderChanged(), updateControl(), and VectorControl().

◆ _sliders

std::array<ExprChannelSlider *, 3> VectorControl::_sliders {}
private

All three channel sliders (for each component)

Definition at line 206 of file ExprControl.h.

Referenced by updateControl(), and VectorControl().

◆ _swatch

ExprCSwatchFrame* VectorControl::_swatch {nullptr}
private

Definition at line 203 of file ExprControl.h.

Referenced by setValue(), swatchChanged(), and VectorControl().


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