![]() |
NDEVR
API Documentation
|
Provides a rounded range control (like a speedometer or potentiometer). More...
Public Member Functions | |
| QCustomDial (QWidget *parent=nullptr) | |
| Constructs a QCustomDial with the given parent widget. | |
| ~QCustomDial () | |
| Destroys the dial and its resources. | |
| void | addIcon (const DialIcon &icon) |
| Adds a fully configured DialIcon to the dial. | |
| void | addIcon (const String &icon, bool show_full_icon, bool rotate_icon) |
| Adds an icon to the dial by resource name. | |
| QCustomLineEdit * | centerLineEdit () |
| Returns the center line edit widget, creating one if it does not exist. | |
| void | clearIcons () |
| Removes all icons from the dial. | |
| void | edited () |
| Emitted when the user interactively edits the dial value. | |
| bool | event (QEvent *event) override |
| Handles generic events such as tooltip and theme updates. | |
| fltp08 | getValue () |
| Returns the current dial value as a floating-point number. | |
| int | heightForWidth (int w) const override |
| Returns the height for a given width, maintaining a square aspect ratio. | |
| const Buffer< DialIcon > & | icons () const |
| Returns the list of icons currently displayed on the dial. | |
| void | keyPressEvent (QKeyEvent *event) override |
| Handles key press events for keyboard-based dial control. | |
| QSize | minimumSizeHint () const override |
| Returns the minimum size hint for layout purposes. | |
| void | mouseMoveEvent (QMouseEvent *event) override |
| Handles mouse movement for interactive dial rotation. | |
| void | mousePressEvent (QMouseEvent *event) override |
| Handles mouse press to begin interactive dial rotation. | |
| void | mouseReleaseEvent (QMouseEvent *event) override |
| Handles mouse release to finalize dial value changes. | |
| void | paintEvent (QPaintEvent *event) override |
| Paints the dial including any overlay icons. | |
| void | resizeEvent (QResizeEvent *event) override |
| Handles resize events and updates icon caches accordingly. | |
| void | setColor (const RGBColor &color) |
| Sets the color of the dial track and grip indicator. | |
| void | setGrip (fltp04 grip_size) |
| Sets the size of the grip indicator on the dial. | |
| void | setIcon (const QPixmap &map, bool show_full_icon, bool rotate_icon) |
| Sets the dial icon from a pixmap with display options. | |
| void | setIcons (const Buffer< DialIcon > &icons) |
| Replaces all icons with the given buffer. | |
| void | setMaxValue (fltp08 max) |
| Sets the maximum value of the dial range. | |
| void | setMinValue (fltp08 min) |
| Sets the minimum value of the dial range. | |
| void | setValue (fltp08 value) |
| Sets the dial to the given floating-point value. | |
| void | showLineEdit (bool show) |
| Shows or hides the center line edit overlay. | |
| QSize | sizeHint () const override |
| Returns the recommended size for the dial. | |
| void | tieToLineEdit (QCustomLineEdit *edit, bool is_offset=false) |
| Ties a QCustomLineEdit to this dial so they stay synchronized. | |
| void | wheelEvent (QWheelEvent *e) override |
| Handles mouse wheel events for scrolling the dial value. | |
Protected Member Functions | |
| void | onValueChanged () |
| Slot invoked when the underlying QDial value changes. | |
Provides a rounded range control (like a speedometer or potentiometer).
QCustomDial is used when the user needs to control a value within a program-definable range, and the range either wraps around (for example, with angles measured from 0 to 359 degrees) or the dialog layout needs a square widget.
Contains logic for adding one or more images to the dial that may or may not rotate with the dial.
Definition at line 75 of file QCustomDial.h.
| QCustomDial::QCustomDial | ( | QWidget * | parent = nullptr | ) |
Constructs a QCustomDial with the given parent widget.
| [in] | parent | The parent widget. |
| void QCustomDial::addIcon | ( | const DialIcon & | icon | ) |
| void QCustomDial::addIcon | ( | const String & | icon, |
| bool | show_full_icon, | ||
| bool | rotate_icon ) |
Adds an icon to the dial by resource name.
| [in] | icon | The resource name of the icon. |
| [in] | show_full_icon | Whether the icon should fill the entire dial. |
| [in] | rotate_icon | Whether the icon should rotate with the dial. |
| QCustomLineEdit * QCustomDial::centerLineEdit | ( | ) |
Returns the center line edit widget, creating one if it does not exist.
|
override |
Handles generic events such as tooltip and theme updates.
| [in] | event | The event to process. |
References event().
Referenced by event(), keyPressEvent(), mouseMoveEvent(), mousePressEvent(), mouseReleaseEvent(), paintEvent(), and resizeEvent().
| fltp08 QCustomDial::getValue | ( | ) |
Returns the current dial value as a floating-point number.
|
inlineoverride |
Returns the height for a given width, maintaining a square aspect ratio.
| [in] | w | The width. |
Definition at line 100 of file QCustomDial.h.
Returns the list of icons currently displayed on the dial.
Definition at line 154 of file QCustomDial.h.
Referenced by setIcons().
|
override |
|
override |
Returns the minimum size hint for layout purposes.
|
override |
|
override |
|
override |
|
override |
|
override |
| void QCustomDial::setColor | ( | const RGBColor & | color | ) |
Sets the color of the dial track and grip indicator.
| [in] | color | The color to apply. |
|
inline |
Sets the size of the grip indicator on the dial.
| [in] | grip_size | The grip size as a fraction of the dial radius. |
Definition at line 189 of file QCustomDial.h.
| void QCustomDial::setIcon | ( | const QPixmap & | map, |
| bool | show_full_icon, | ||
| bool | rotate_icon ) |
Sets the dial icon from a pixmap with display options.
| [in] | map | The pixmap to use as the icon. |
| [in] | show_full_icon | Whether the icon should fill the entire dial. |
| [in] | rotate_icon | Whether the icon should rotate with the dial. |
| void QCustomDial::setMaxValue | ( | fltp08 | max | ) |
Sets the maximum value of the dial range.
| [in] | max | The maximum value. |
| void QCustomDial::setMinValue | ( | fltp08 | min | ) |
Sets the minimum value of the dial range.
| [in] | min | The minimum value. |
| void QCustomDial::setValue | ( | fltp08 | value | ) |
Sets the dial to the given floating-point value.
| [in] | value | The value to set. |
| void QCustomDial::showLineEdit | ( | bool | show | ) |
Shows or hides the center line edit overlay.
| [in] | show | Whether to show the line edit. |
|
override |
Returns the recommended size for the dial.
| void QCustomDial::tieToLineEdit | ( | QCustomLineEdit * | edit, |
| bool | is_offset = false ) |
Ties a QCustomLineEdit to this dial so they stay synchronized.
| [in] | edit | The line edit to synchronize with. |
| [in] | is_offset | Whether the line edit value represents an offset from the dial value. |
|
override |
Handles mouse wheel events for scrolling the dial value.
| [in] | e | The wheel event. |