Omnidome
Fulldome Mapping Software Toolkit
|
Circular dial widget with range value and editor. More...
#include <Dial.h>
Public Types | |
typedef mixin::Editor< Dial, QDoubleSpinBox > | mixin_editor_type |
Editor mixin type. More... | |
typedef mixin::RangedValue < Dial, double > | mixin_range_type |
Ranged value mixin type. More... | |
typedef mixin_range_type::value_type | value_type |
![]() | |
typedef Range< double > | range_type |
typedef Step< double > | step_type |
typedef double | value_type |
![]() | |
typedef double | value_type |
![]() | |
typedef double | value_type |
Public Slots | |
void | setShowTicks (bool) |
Set show ticks. More... | |
void | setSuffix (QString const &) |
Set suffix string. More... | |
void | setLetter (QChar) |
Set letter. More... | |
void | setSingleStep (double) |
Set single step value. More... | |
void | setPageStep (double) |
Set page step value. More... | |
void | setMinimum (double) |
Set minimum value. More... | |
void | setMaximum (double) |
Set maximum value. More... | |
void | setRange (double, double) |
Set range. More... | |
void | setValue (int) |
Set value from integer. More... | |
void | setValue (double) |
Set value. More... | |
void | setEditorVisible (bool) |
Set visibility of editor. More... | |
Signals | |
void | valueChanged () |
void | rangeChanged () |
Public Member Functions | |
Dial (QWidget *=nullptr) | |
Construct with optional parent widget. More... | |
Dial (value_type _value, value_type _minimum, value_type _maximum, QWidget *=nullptr) | |
Construct with value and minimum and maximum values. More... | |
~Dial () | |
Destructor. More... | |
QString const & | suffix () const |
Return suffix string. More... | |
QChar | letter () const |
Return letter shown in background. More... | |
ColorSet const & | colorSet () const |
Return color set. More... | |
bool | isMoving () const |
Is moving when mouse button is pressed. More... | |
bool | showTicks () const |
Show ticks. 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... | |
![]() | |
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 |
![]() | |
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... | |
Protected Member Functions | |
void | resizeEvent (QResizeEvent *) |
Re-paint on resize. More... | |
void | paintEvent (QPaintEvent *) |
void | mousePressEvent (QMouseEvent *) |
void | mouseReleaseEvent (QMouseEvent *) |
void | mouseMoveEvent (QMouseEvent *) |
void | mouseDoubleClickEvent (QMouseEvent *) |
Double click in center shows editor, double click on border reset to default value. More... | |
void | keyPressEvent (QKeyEvent *) |
Show editor when enter key is pressed. More... | |
void | valueChangedEvent () |
Value changed event which is emitted on changed value. More... | |
void | rangeChangedEvent () |
Handler to emit rangeChanged signal in derived widgets. 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... | |
![]() | |
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... | |
![]() | |
void | for_each_step (MIN _min, MAX _max, F f) |
Functor to be applied for each step between min and maximum. More... | |
![]() | |
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 | radius () const |
double | getValue (QPoint const &) |
Get value from point on widget. More... | |
void | paintTick (QPainter &, double _value, double _length) |
Draw a tick with value and length. More... | |
Private Attributes | |
bool | isMoving_ = false |
bool | showTicks_ = true |
QChar | letter_ = 'X' |
QString | suffix_ |
QLabel * | valueLabel_ |
ColorSet | colorSet_ |
QPointF | pos_ |
Additional Inherited Members | |
![]() | |
typedef Dial | widget_type |
Widget type. More... | |
typedef QDoubleSpinBox | editor_type |
Editor widget type, e.g. QDoubleSpinBox. More... | |
Circular dial widget with range value and editor.
typedef mixin::Editor<Dial, QDoubleSpinBox> omni::ui::Dial::mixin_editor_type |
Editor mixin type.
typedef mixin::RangedValue<Dial, double> omni::ui::Dial::mixin_range_type |
Ranged value mixin type.
omni::ui::Dial::Dial | ( | QWidget * | _parent = nullptr | ) |
Construct with optional parent widget.
omni::ui::Dial::Dial | ( | value_type | _value, |
value_type | _minimum, | ||
value_type | _maximum, | ||
QWidget * | _parent = nullptr |
||
) |
Construct with value and minimum and maximum values.
ColorSet const & omni::ui::Dial::colorSet | ( | ) | const |
Return color set.
|
privatevirtual |
Implements omni::ui::mixin::Editor< Dial, QDoubleSpinBox >.
|
private |
Get value from point on widget.
|
private |
bool omni::ui::Dial::isMoving | ( | ) | const |
Is moving when mouse button is pressed.
|
protected |
Show editor when enter key is pressed.
QChar omni::ui::Dial::letter | ( | ) | const |
Return letter shown in background.
|
protected |
Double click in center shows editor, double click on border reset to default value.
|
protected |
|
protected |
|
protected |
|
protected |
|
private |
Draw a tick with value and length.
|
private |
|
signal |
|
protectedvirtual |
Handler to emit rangeChanged signal in derived widgets.
Reimplemented from omni::ui::mixin::Range< double >.
|
protected |
Re-paint on resize.
|
slot |
Set visibility of editor.
|
slot |
Set letter.
|
slot |
Set maximum value.
|
slot |
Set minimum value.
|
slot |
Set page step value.
|
slot |
Set range.
|
slot |
Set show ticks.
|
slot |
Set single step value.
|
slot |
Set suffix string.
|
slot |
Set value from integer.
|
slot |
Set value.
bool omni::ui::Dial::showTicks | ( | ) | const |
Show ticks.
QString const & omni::ui::Dial::suffix | ( | ) | const |
Return suffix string.
|
signal |
|
protectedvirtual |
Value changed event which is emitted on changed value.
Reimplemented from omni::ui::mixin::RangedValue< Dial, double >.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |