Omnidome
Fulldome Mapping Software Toolkit
|
A slider with float value within a minimum and maximum. More...
#include <RangedFloat.h>
Public Types | |
enum | Scale { Scale::LINEAR, Scale::RECIPROCAL } |
typedef mixin::RangedValue < RangedFloat, double > | mixin_range_type |
typedef QDoubleSpinBox | editor_type |
![]() | |
typedef mixin::Editor < AbstractInputWidget, QWidget > | mixin_editor_type |
Public Slots | |
void | setValue (double) |
Set value, valueChanged() signal will be emitted. More... | |
void | setMinimum (double) |
Set minimal value, rangeChanged() signal will be emitted. More... | |
void | setMaximum (double) |
Set maximum value, rangeChanged() signal will be emitted. More... | |
void | setRange (double, double) |
Set range (minimum/maximum), rangeChanged() signel will be emitted. More... | |
void | setEditorVisible (bool) |
Show/hide editor. More... | |
void | setSnap (bool) |
Toggle value snap on/off. More... | |
void | setGripSize (int) |
void | setUseDefaultValue (bool) |
Use Default Value and show it. More... | |
void | setDrawTicks (bool) |
void | setPrecision (int) |
Set precision. More... | |
void | setSuffix (QString const &) |
Set Suffix. More... | |
void | setPivot (double) |
Set pivot. More... | |
void | setDefaultValue (double) |
void | setSingleStep (double) |
void | setPageStep (double) |
void | setScale (Scale) |
![]() | |
virtual void | setEditorVisible (bool) |
Set editor visible. More... | |
void | showEditor () |
Show editor. More... | |
void | hideEditor () |
Hide editor. More... | |
Signals | |
void | valueChanged () |
void | rangeChanged () |
![]() | |
void | valueChanged () |
Value changed event. More... | |
Public Member Functions | |
RangedFloat (QWidget *=nullptr) | |
Construct from parent widget. More... | |
RangedFloat (QString const &_label, double _value, double _min, double _max, QWidget *=nullptr) | |
Construct with input parameters. More... | |
virtual | ~RangedFloat () |
QString | suffix () const |
Return suffix. More... | |
int | precision () const |
Return precision. More... | |
int | gripSize () const |
Return grip size. More... | |
bool | useDefaultValue () const |
Return flag if default value is used. More... | |
bool | drawTicks () const |
Scale | scale () const |
![]() | |
AbstractInputWidget (QWidget *=nullptr) | |
virtual | ~AbstractInputWidget () |
![]() | |
Widget (QWidget *=nullptr) | |
Widget (QString const &_label, QWidget *=nullptr) | |
virtual | ~Widget () |
QString | label () const |
Return label text of widget. More... | |
void | setLabel (QString const &) |
Set label text of widget. More... | |
ColorSet const & | colorSet () const |
double | zoomFactor () const |
Zoom factor of widget. More... | |
Protected Member Functions | |
void | paintEvent (QPaintEvent *) |
void | keyPressEvent (QKeyEvent *) |
Show editor when enter key is pressed. More... | |
void | mouseMoveEvent (QMouseEvent *) |
void | mousePressEvent (QMouseEvent *) |
Hide editor and set focus on click. More... | |
void | mouseReleaseEvent (QMouseEvent *) |
void | mouseDoubleClickEvent (QMouseEvent *) |
Show editor on double click. More... | |
void | wheelEvent (QWheelEvent *) |
void | valueChangedEvent () |
Value changed event which is emitted on changed value. More... | |
void | rangeChangedEvent () |
Handler to emit rangeChanged signal in derived widgets. More... | |
![]() | |
void | drawHandle (QPainter &_p, double _pos, double _heightFactor=1.0) const |
Draw slider handle. More... | |
void | drawTrack (QPainter &_p, double _pos) const |
void | drawTrack (QPainter &_p, double _left, double _right) const |
void | init () |
![]() | |
void | drawBorder (QPainter &) |
void | drawBorder (QPainter &, bool _focus) |
![]() | |
Editor (widget_type *_widget) | |
T * | createEditor () |
Create editor with type. More... | |
editor_type const * | editor () const |
Return pointer editor (const version) More... | |
editor_type * | editor () |
Return pointer editor. More... | |
T * | editorAs () |
Return editor as type T. More... | |
T const * | editorAs () const |
Return editor as type T (const version) More... | |
virtual void | setEditorVisible (bool _visible) |
Set editor visibility and set focus. More... | |
void | showEditor () |
Show editor and set focus. More... | |
void | hideEditor () |
Hide editor. More... | |
Private Member Functions | |
void | init () |
void | editorSetup () |
double | valueFromPos (double) const |
Get value from x mouse position. More... | |
double | valueToPos () const |
Calculate position from value. More... | |
double | valueToPos (double) const |
Calculate position from value. More... | |
![]() | |
RangedValue () | |
Default constructor. More... | |
RangedValue (value_type _value, value_type _minimum, value_type _maximum, value_type _singleStep=1.0, value_type _pageStep=10.0) | |
Constructor from user defined value and range. More... | |
qreal | ratio () const |
Returns ratio of current value. More... | |
value_type | value () const |
Return value. More... | |
value_type | defaultValue () const |
Return default value. More... | |
value_type | pivot () const |
Return pivot value. More... | |
void | increase () |
Increate value by single step value. More... | |
void | decrease () |
Decrease value by single step value. More... | |
void | setValue (value_type _value) |
Set new value and emit value changed event. More... | |
void | reset () |
Reset value to default value. More... | |
void | setDefaultValue (value_type _value) |
Set new default value. More... | |
void | setPivot (value_type _pivot) |
Set pivot value (0.0 by default) More... | |
void | apply (WIDGET *_widget) const |
Apply ranged value to widget. More... | |
void | for_each_step (F f) |
Functor to apply for each step. More... | |
void | validate () |
Validate minimum, maximum and value. More... | |
![]() | |
Range (value_type _minimum=0.0, value_type _maximum=100.0) | |
qreal | ratio (value_type _v) const |
Return ratio of value v. More... | |
value_type | range () const |
Return range (difference between maximum and minimum) More... | |
value_type | minimum () const |
Return minimum value. More... | |
value_type | maximum () const |
Return maximum value. More... | |
void | setMinimum (value_type _minimum) |
Set new minimum value and value and emit rangeChanged event. More... | |
void | disableMinimum () |
Disable minimum by setting the value to infinite. More... | |
void | setMaximum (value_type _maximum) |
Set new maximum value and value and emit rangeChanged event. More... | |
void | disableMaximum () |
Disable maximum by setting maximum to infinite value. More... | |
void | setRange (value_type _minimum, value_type _maximum) |
Set range and validate. More... | |
void | disableRange () |
Disable range by setting minimum and maximum to infinite value. More... | |
bool | minimumUsed () const |
bool | maximumUsed () const |
void | apply (WIDGET *_widget) const |
Apply range to widget. More... | |
void | apply (WIDGET *_widget, V _value) const |
Applay range to widget and set value. More... | |
![]() | |
Step (value_type _singleStep=1.0, value_type _pageStep=10.0, bool _snap=false) | |
Construct with a single step, page step value. More... | |
qreal | snapped (value_type _v) const |
Return snapped value. More... | |
bool | snap () const |
Snap value (align to single step value) More... | |
void | setSnap (bool _snap) |
Set boolean if value is to be snapped. More... | |
value_type | singleStep () const |
Return value for single step. More... | |
value_type | pageStep () const |
Return value for page step. More... | |
void | setSingleStep (value_type _singleStep) |
Set new single step value. More... | |
void | setPageStep (value_type _pageStep) |
Set new value for page step. More... | |
void | for_each_step (MIN _min, MAX _max, F f) |
Functor to be applied for each step between min and maximum. More... | |
Private Attributes | |
Scale | scale_ = Scale::LINEAR |
bool | moving_ = false |
bool | drawTicks_ = false |
bool | useDefaultValue_ = false |
QString | suffix_ |
int | gripSize_ = 0 |
int | precision_ = 2 |
Additional Inherited Members | |
![]() | |
typedef AbstractInputWidget | widget_type |
Widget type. More... | |
typedef QWidget | editor_type |
Editor widget type, e.g. QDoubleSpinBox. More... | |
![]() | |
QLabel * | valueLabel_ = nullptr |
![]() | |
QLabel * | label_ |
![]() | |
typedef Range< double > | range_type |
typedef Step< double > | step_type |
typedef double | value_type |
![]() | |
typedef double | value_type |
![]() | |
typedef double | value_type |
A slider with float value within a minimum and maximum.
typedef QDoubleSpinBox omni::ui::RangedFloat::editor_type |
typedef mixin::RangedValue<RangedFloat, double> omni::ui::RangedFloat::mixin_range_type |
|
strong |
omni::ui::RangedFloat::RangedFloat | ( | QWidget * | _parent = nullptr | ) |
Construct from parent widget.
omni::ui::RangedFloat::RangedFloat | ( | QString const & | _label, |
double | _value, | ||
double | _min, | ||
double | _max, | ||
QWidget * | _parent = nullptr |
||
) |
Construct with input parameters.
_label | Label of widget |
_value | Initial value |
_min | Minimal value |
_max | Maximal value |
bool omni::ui::RangedFloat::drawTicks | ( | ) | const |
|
privatevirtual |
Implements omni::ui::mixin::Editor< AbstractInputWidget, QWidget >.
int omni::ui::RangedFloat::gripSize | ( | ) | const |
Return grip size.
|
private |
|
protectedvirtual |
Show editor when enter key is pressed.
Reimplemented from omni::ui::AbstractInputWidget.
|
protectedvirtual |
Show editor on double click.
Reimplemented from omni::ui::AbstractInputWidget.
|
protected |
|
protectedvirtual |
Hide editor and set focus on click.
Reimplemented from omni::ui::AbstractInputWidget.
|
protected |
|
protected |
int omni::ui::RangedFloat::precision | ( | ) | const |
Return precision.
|
signal |
|
protectedvirtual |
Handler to emit rangeChanged signal in derived widgets.
Reimplemented from omni::ui::mixin::Range< double >.
RangedFloat::Scale omni::ui::RangedFloat::scale | ( | ) | const |
|
slot |
|
slot |
|
slot |
Show/hide editor.
|
slot |
|
slot |
Set maximum value, rangeChanged() signal will be emitted.
|
slot |
Set minimal value, rangeChanged() signal will be emitted.
|
slot |
|
slot |
Set pivot.
|
slot |
Set precision.
|
slot |
Set range (minimum/maximum), rangeChanged() signel will be emitted.
|
slot |
|
slot |
|
slot |
Toggle value snap on/off.
|
slot |
Set Suffix.
|
slot |
Use Default Value and show it.
|
slot |
Set value, valueChanged() signal will be emitted.
QString omni::ui::RangedFloat::suffix | ( | ) | const |
Return suffix.
bool omni::ui::RangedFloat::useDefaultValue | ( | ) | const |
Return flag if default value is used.
|
signal |
|
protectedvirtual |
Value changed event which is emitted on changed value.
Reimplemented from omni::ui::mixin::RangedValue< RangedFloat, double >.
|
private |
Get value from x mouse position.
|
private |
Calculate position from value.
|
private |
Calculate position from value.
|
protected |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |