A decorated dial class that allows the user to set the lighting direction.
More...
|
| | SunDial (QWidget *parent=nullptr) |
| | Constructs a SunDial widget with the given parent.
|
| Vector< 2, fltp04 > | centerPoint () const |
| | Returns the center point of the dial in widget coordinates.
|
| Vector< 2, fltp04 > | knobLocation () const |
| | Returns the current position of the dial knob in widget coordinates.
|
| fltp04 | knobRadius () const |
| | Returns the radius of the dial knob in pixels, scaled to the widget size.
|
| virtual void | mouseMoveEvent (QMouseEvent *ev) override |
| | Handles mouse move events to update the knob position while dragging.
|
| virtual void | mousePressEvent (QMouseEvent *ev) override |
| | Handles mouse press events to begin dragging the dial knob.
|
|
virtual void | mouseReleaseEvent (QMouseEvent *) override |
| | Handles mouse release events to stop dragging the dial knob.
|
| fltp04 | outerRadius () const |
| | Returns the outer radius of the dial in pixels.
|
| void | setBackgroundColor (QColor inner, QColor outer) |
| | Sets the gradient colors for the dial background.
|
| void | setKnobColor (QColor inner, QColor outer) |
| | Sets the gradient colors for the dial knob.
|
| QSize | sizeHint () const override |
| | Returns the recommended size for this dial widget.
|
|
|
Resource< Vector< 2, fltp04 > > | location |
| | The 2D direction resource representing the current lighting direction.
|
|
| void | paintEvent (QPaintEvent *paint_event) override |
| | Paints the dial including the background gradient, knob, and decorations.
|
|
|
bool | m_dragging |
| | Whether the user is currently dragging the knob.
|
|
QColor | m_inner_color |
| | The inner color of the background gradient.
|
|
fltp04 | m_inner_radius |
| | The inner radius ratio of the dial background.
|
|
QColor | m_knob_inner_color |
| | The inner color of the knob gradient.
|
|
QColor | m_knob_outer_color |
| | The outer color of the knob gradient.
|
|
fltp04 | m_knob_radius |
| | The radius ratio of the knob relative to the widget size.
|
|
QColor | m_outer_color |
| | The outer color of the background gradient.
|
A decorated dial class that allows the user to set the lighting direction.
Definition at line 43 of file SunDial.h.
◆ SunDial()
| SunDial::SunDial |
( |
QWidget * | parent = nullptr | ) |
|
Constructs a SunDial widget with the given parent.
- Parameters
-
| [in] | parent | The parent widget. |
◆ centerPoint()
Returns the center point of the dial in widget coordinates.
- Returns
- The center point as a 2D vector.
◆ knobLocation()
Returns the current position of the dial knob in widget coordinates.
- Returns
- The knob location as a 2D vector.
◆ knobRadius()
| fltp04 SunDial::knobRadius |
( |
| ) |
const |
|
inline |
Returns the radius of the dial knob in pixels, scaled to the widget size.
- Returns
- The knob radius.
Definition at line 71 of file SunDial.h.
References getMin(), and m_knob_radius.
◆ mouseMoveEvent()
| virtual void SunDial::mouseMoveEvent |
( |
QMouseEvent * | ev | ) |
|
|
overridevirtual |
Handles mouse move events to update the knob position while dragging.
- Parameters
-
| [in] | ev | The mouse move event. |
◆ mousePressEvent()
| virtual void SunDial::mousePressEvent |
( |
QMouseEvent * | ev | ) |
|
|
overridevirtual |
Handles mouse press events to begin dragging the dial knob.
- Parameters
-
| [in] | ev | The mouse press event. |
◆ outerRadius()
| fltp04 SunDial::outerRadius |
( |
| ) |
const |
Returns the outer radius of the dial in pixels.
- Returns
- The outer radius.
◆ paintEvent()
| void SunDial::paintEvent |
( |
QPaintEvent * | paint_event | ) |
|
|
overrideprotected |
Paints the dial including the background gradient, knob, and decorations.
- Parameters
-
| [in] | paint_event | The paint event. |
◆ setBackgroundColor()
| void SunDial::setBackgroundColor |
( |
QColor | inner, |
|
|
QColor | outer ) |
Sets the gradient colors for the dial background.
- Parameters
-
| [in] | inner | The inner color of the background gradient. |
| [in] | outer | The outer color of the background gradient. |
◆ setKnobColor()
| void SunDial::setKnobColor |
( |
QColor | inner, |
|
|
QColor | outer ) |
Sets the gradient colors for the dial knob.
- Parameters
-
| [in] | inner | The inner color of the knob gradient. |
| [in] | outer | The outer color of the knob gradient. |
◆ sizeHint()
| QSize SunDial::sizeHint |
( |
| ) |
const |
|
inlineoverride |
Returns the recommended size for this dial widget.
- Returns
- The size hint.
Definition at line 84 of file SunDial.h.
The documentation for this class was generated from the following file: