SeExpr

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:

## Public Member Functions
| NumberControl (int id, NumberEditable *number)
Public Member Functions inherited from ExprControl
| ExprControl (int id, Editable *editable, bool showColorLink)
virtual | ~ExprControl ()
virtual QColor | getColor ()
| Interface for getting the color (used for linked color picking) More...
virtual void | setColor (QColor color)
| Interface for setting the color (used for linked color picking) More...
void | linkDisconnect (int newId)

## Private Slots
void | sliderChanged (int val)
void | editChanged (int id, const QString &text)

## Private Member Functions
void | setValue (float value)
| Update the model with the value and notify the collection. More...
void | updateControl ()
| Update values in slider and textbox given what the model contains. More...

## Private Attributes
NumberEditable * | _numberEditable
| Pointer to the number control model. More...
ExprSlider * | _slider
| Slider for the number. More...
ExprLineEdit * | _edit
| Text box for the number. More...

## 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 Attributes inherited from ExprControl
int | _id
bool | _updating
QHBoxLayout * | hbox
QCheckBox * | _colorLinkCB
QLabel * | _label
Editable * | _editable

## Detailed Description

Number slider for either float or int data.

Definition at line 171 of file ExprControl.h.

## Constructor & Destructor Documentation

## ◆ NumberControl()

NumberControl::NumberControl | ( | int | id,
|  | NumberEditable * | number
| ) |  |

Definition at line 213 of file ExprControl.cpp.

References _edit, _numberEditable, _slider, editChanged(), ExprControl::hbox, NumberEditable::isInt, SeExpr2::max(), NumberEditable::max, NumberEditable::min, sliderChanged(), and updateControl().

## Member Function Documentation

## ◆ editChanged

void NumberControl::editChanged | ( | int | id,
|  | const QString & | text
| ) |  |
| private slot

Definition at line 248 of file ExprControl.cpp.

References ExprControl::_updating, and setValue().

Referenced by NumberControl().

## ◆ setValue()

void NumberControl::setValue | ( | float | value | ) |
| private

Update the model with the value and notify the collection.

Definition at line 265 of file ExprControl.cpp.

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

Referenced by editChanged(), and sliderChanged().

## ◆ sliderChanged

void NumberControl::sliderChanged | ( | int | val | ) |
| private slot

Definition at line 243 of file ExprControl.cpp.

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

Referenced by NumberControl().

## ◆ updateControl()

void NumberControl::updateControl | ( |  | ) |
| private

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

Definition at line 257 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
| private

Text box for the number.

Definition at line 179 of file ExprControl.h.

Referenced by NumberControl(), and updateControl().

## ◆ _numberEditable

NumberEditable* NumberControl::_numberEditable
| 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
| 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:

- /build/seexpr/src/SeExpr/src/SeExpr2/UI/ExprControl.h
- /build/seexpr/src/SeExpr/src/SeExpr2/UI/ExprControl.cpp