34#include <NDEVR/String.h>
35#include <NDEVR/RGBColor.h>
64 class QCustomLineEdit;
137 void setIcon(
const QPixmap& map,
bool show_full_icon,
bool rotate_icon);
191 m_grip_size = grip_size;
246 void _setValue(
fltp08 value,
bool emit_edit =
false);
250 void updateCenterLineEditLocation();
261 void cacheScaledPixmap(
DialIcon& icon);
269 qint64 cacheKey{ 0 };
272 bool m_has_user_focus;
277 void modifyValue(QMouseEvent* event);
Stores an angle in an optimized internal format with support for efficient trigonometric operations.
The equivelent of std::vector but with a bit more control.
void keyPressEvent(QKeyEvent *event) override
Handles key press events for keyboard-based dial control.
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.
QCustomLineEdit * centerLineEdit()
Returns the center line edit widget, creating one if it does not exist.
const Buffer< DialIcon > & icons() const
Returns the list of icons currently displayed on the dial.
bool event(QEvent *event) override
Handles generic events such as tooltip and theme updates.
void setGrip(fltp04 grip_size)
Sets the size of the grip indicator on the dial.
void showLineEdit(bool show)
Shows or hides the center line edit overlay.
~QCustomDial()
Destroys the dial and its resources.
void addIcon(const DialIcon &icon)
Adds a fully configured DialIcon to the dial.
void tieToLineEdit(QCustomLineEdit *edit, bool is_offset=false)
Ties a QCustomLineEdit to this dial so they stay synchronized.
void setMaxValue(fltp08 max)
Sets the maximum value of the dial range.
void mouseMoveEvent(QMouseEvent *event) override
Handles mouse movement for interactive dial rotation.
QSize minimumSizeHint() const override
Returns the minimum size hint for layout purposes.
void onValueChanged()
Slot invoked when the underlying QDial value changes.
void resizeEvent(QResizeEvent *event) override
Handles resize events and updates icon caches accordingly.
void setIcon(const QPixmap &map, bool show_full_icon, bool rotate_icon)
Sets the dial icon from a pixmap with display options.
void setColor(const RGBColor &color)
Sets the color of the dial track and grip indicator.
void clearIcons()
Removes all icons from the dial.
void paintEvent(QPaintEvent *event) override
Paints the dial including any overlay icons.
QSize sizeHint() const override
Returns the recommended size for the dial.
void edited()
Emitted when the user interactively edits the dial value.
void addIcon(const String &icon, bool show_full_icon, bool rotate_icon)
Adds an icon to the dial by resource name.
fltp08 getValue()
Returns the current dial value as a floating-point number.
void mouseReleaseEvent(QMouseEvent *event) override
Handles mouse release to finalize dial value changes.
void wheelEvent(QWheelEvent *e) override
Handles mouse wheel events for scrolling the dial value.
void setIcons(const Buffer< DialIcon > &icons)
Replaces all icons with the given buffer.
QCustomDial(QWidget *parent=nullptr)
Constructs a QCustomDial with the given parent widget.
int heightForWidth(int w) const override
Returns the height for a given width, maintaining a square aspect ratio.
void mousePressEvent(QMouseEvent *event) override
Handles mouse press to begin interactive dial rotation.
A line edit allows users to enter and edit a single line of plain text with useful editing functions,...
Represents a color in the RGB space with optional alpha transparency.
The core String View class for the NDEVR API.
The core String class for the NDEVR API.
The primary namespace for the NDEVR SDK.
float fltp04
Defines an alias representing a 4 byte floating-point number Bit layout is as follows: -Sign: 1 bit a...
double fltp08
Defines an alias representing an 8 byte floating-point number.
An icon along with defined behavior describing how that icon should interact with a parent QCustomDia...
Angle< fltp08 > rotation_offset
An angular offset applied to the icon rotation.
void setImageID(const StringView &id)
Sets the icon image by resource ID and clears cached pixmaps.
QPixmap pixmap
The loaded pixmap for the icon.
bool make_shadow
Whether to render a drop shadow behind the icon.
String image_id
The resource identifier for the icon image.
QPixmap scaled_pixmap
Cached scaled pixmap to avoid redundant scaling when size has not changed.
bool rotate
Whether the icon should rotate with the dial value.
fltp08 size
A size multiplier for the icon relative to the dial.
bool fullsize
Whether the icon should fill the entire dial area.