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

Number slider for either float or int data. More...

#include <ExprControl.h>

Inheritance diagram for NumberControl:
ExprControl

Public Member Functions

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

Private Slots

void sliderChanged (int val)
 
void editChanged (int id, const QString &text)
 

Private Member Functions

void setValue (double value)
 Update the model with the value and notify the collection.
 
void updateControl ()
 Update values in slider and textbox given what the model contains.
 

Private Attributes

NumberEditable_numberEditable {nullptr}
 Pointer to the number control model.
 
ExprSlider_slider {nullptr}
 Slider for the number.
 
ExprLineEdit_edit {nullptr}
 Text box for the number.
 

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

Number slider for either float or int data.

Definition at line 170 of file ExprControl.h.

Constructor & Destructor Documentation

◆ NumberControl()

NumberControl::NumberControl ( int  id,
NumberEditable editable 
)

Member Function Documentation

◆ editChanged

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

Definition at line 262 of file ExprControl.cpp.

References ExprControl::_updating, and setValue().

Referenced by NumberControl().

◆ setValue()

void NumberControl::setValue ( double  value)
private

Update the model with the value and notify the collection.

Definition at line 283 of file ExprControl.cpp.

References ExprControl::_id, _numberEditable, ExprControl::controlChanged(), updateControl(), and NumberEditable::v.

Referenced by editChanged(), and sliderChanged().

◆ sliderChanged

void NumberControl::sliderChanged ( int  val)
privateslot

Definition at line 255 of file ExprControl.cpp.

References _numberEditable, ExprControl::_updating, NumberEditable::isInt, and setValue().

Referenced by NumberControl().

◆ updateControl()

void NumberControl::updateControl ( )
private

Update values in slider and textbox given what the model contains.

Definition at line 273 of file ExprControl.cpp.

References _edit, _numberEditable, _slider, ExprControl::_updating, NumberEditable::isInt, ExprLineEdit::setText(), and NumberEditable::v.

Referenced by NumberControl(), and setValue().

Member Data Documentation

◆ _edit

ExprLineEdit* NumberControl::_edit {nullptr}
private

Text box for the number.

Definition at line 179 of file ExprControl.h.

Referenced by NumberControl(), and updateControl().

◆ _numberEditable

NumberEditable* NumberControl::_numberEditable {nullptr}
private

Pointer to the number control model.

Definition at line 175 of file ExprControl.h.

Referenced by NumberControl(), setValue(), sliderChanged(), and updateControl().

◆ _slider

ExprSlider* NumberControl::_slider {nullptr}
private

Slider for the number.

Definition at line 177 of file ExprControl.h.

Referenced by NumberControl(), and updateControl().


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