cut 3.4.1-rc1
Loading...
Searching...
No Matches
QeAngleLineEdit Class Reference

Spin box widget for editing angular values in various units. More...

#include <CutWidgets.h>

Public Types

enum class  Units { SEXAGESIMAL , RADIANS , HMS , DMS }
 Angular unit formats. More...
 

Public Slots

void setUnit (Units unit)
 Set the display unit format.
 
void setUnits (Units unit)
 Set the display unit format.
 
void setPrecision (int newValue)
 Set the precision for subsecond display.
 
void setRadians (double newValue)
 Set the angle value in radians.
 
void setUnitsInt (int unit)
 Convenience method to set Units using its integer representation.
 
void setMinimum (double newValue)
 Set the minimum allowable value.
 
void setMaximum (double newValue)
 Set the maximum allowable value.
 

Signals

void unitChanged (Units newUnit)
 Emitted when the display unit changes.
 
void validationStateChanged (QValidator::State state)
 Emitted when the input validation state changes.
 
void radiansChanged (double radians)
 Emitted when the radian value changes.
 
void precisionChanged (int precision)
 Emitted when the precision changes.
 
void minimumChanged (double minimum)
 Emitted when the minimum value changes.
 
void maximumChanged (double maximum)
 Emitted when the maximum value changes.
 

Public Member Functions

 QeAngleLineEdit (QWidget *parent=nullptr)
 Construct a QeAngleLineEdit widget.
 
Units getUnit () const
 Get the current unit format.
 
Units getUnits () const
 Get the current unit format.
 
int getPrecision ()
 Get the precision (number of decimals) for subsecond display.
 
double getRadians ()
 Get the current angle value in radians.
 
double getMinimum ()
 Get the minimum allowable value.
 
double getMaximum ()
 Get the maximum allowable value.
 

Protected Member Functions

QString textFromValue (double value) const override
 Convert an internal radian value to display text.
 
double valueFromText (const QString &text) const override
 Parse display text back to an internal radian value.
 
QValidator::State validate (QString &input, int &pos) const override
 Validate user input.
 
void handleState (QValidator::State state)
 Handle a change in validation state.
 

Properties

Units unit
 Enum value to determine which units should be used to represent displayed value.
 
double radians
 Value to represent in radians.
 
int precision
 Precision used in the subsecond section of the label.
 
double minimum
 Bottom range value that can be set.
 
double maximum
 Top range value that can be set.
 

Detailed Description

Spin box widget for editing angular values in various units.

Extends QDoubleSpinBox to support multiple angular unit formats: radians, sexagesimal (degrees), HMS (hours/minutes/seconds), and DMS (degrees/minutes/seconds). The internal value is always stored in radians.

Member Enumeration Documentation

◆ Units

enum class QeAngleLineEdit::Units
strong

Angular unit formats.

Enumerator
SEXAGESIMAL 

Standard degrees format.

RADIANS 

Radians format.

HMS 

Hours:Minutes:Seconds format.

DMS 

Degrees:Minutes:Seconds format.

Constructor & Destructor Documentation

◆ QeAngleLineEdit()

QeAngleLineEdit::QeAngleLineEdit ( QWidget * parent = nullptr)
explicit

Construct a QeAngleLineEdit widget.

Parameters
parentParent widget.

Member Function Documentation

◆ getMaximum()

double QeAngleLineEdit::getMaximum ( )

Get the maximum allowable value.

Returns
The maximum value.

◆ getMinimum()

double QeAngleLineEdit::getMinimum ( )

Get the minimum allowable value.

Returns
The minimum value.

◆ getPrecision()

int QeAngleLineEdit::getPrecision ( )

Get the precision (number of decimals) for subsecond display.

Returns
The precision value.

◆ getRadians()

double QeAngleLineEdit::getRadians ( )

Get the current angle value in radians.

Returns
The value in radians.

◆ getUnit()

Units QeAngleLineEdit::getUnit ( ) const

Get the current unit format.

Returns
The current Units enum value.
Deprecated
Please use getUnits() instead.

◆ getUnits()

Units QeAngleLineEdit::getUnits ( ) const

Get the current unit format.

Returns
The current Units enum value.

◆ handleState()

void QeAngleLineEdit::handleState ( QValidator::State state)
protected

Handle a change in validation state.

Parameters
stateThe new validator state.

◆ maximumChanged

void QeAngleLineEdit::maximumChanged ( double maximum)
signal

Emitted when the maximum value changes.

Parameters
maximumThe new maximum value.

◆ minimumChanged

void QeAngleLineEdit::minimumChanged ( double minimum)
signal

Emitted when the minimum value changes.

Parameters
minimumThe new minimum value.

◆ precisionChanged

void QeAngleLineEdit::precisionChanged ( int precision)
signal

Emitted when the precision changes.

Parameters
precisionThe new precision value.

◆ radiansChanged

void QeAngleLineEdit::radiansChanged ( double radians)
signal

Emitted when the radian value changes.

Parameters
radiansThe new value in radians.

◆ setMaximum

void QeAngleLineEdit::setMaximum ( double newValue)
slot

Set the maximum allowable value.

Parameters
newValueThe new maximum value.

◆ setMinimum

void QeAngleLineEdit::setMinimum ( double newValue)
slot

Set the minimum allowable value.

Parameters
newValueThe new minimum value.

◆ setPrecision

void QeAngleLineEdit::setPrecision ( int newValue)
slot

Set the precision for subsecond display.

Parameters
newValueNumber of decimal places.

◆ setRadians

void QeAngleLineEdit::setRadians ( double newValue)
slot

Set the angle value in radians.

Parameters
newValueThe new value in radians.

◆ setUnit

void QeAngleLineEdit::setUnit ( Units unit)
slot

Set the display unit format.

Parameters
unitThe new Units enum value.
Deprecated
Please use setUnits(Units unit) instead.

◆ setUnits

void QeAngleLineEdit::setUnits ( Units unit)
slot

Set the display unit format.

Parameters
unitThe new Units enum value.

◆ setUnitsInt

void QeAngleLineEdit::setUnitsInt ( int unit)
slot

Convenience method to set Units using its integer representation.

Parameters
unitUnits as integer. See Units enum for details on integer values.

◆ textFromValue()

QString QeAngleLineEdit::textFromValue ( double value) const
overrideprotected

Convert an internal radian value to display text.

Parameters
valueThe value in radians.
Returns
Formatted QString for display.

◆ unitChanged

void QeAngleLineEdit::unitChanged ( Units newUnit)
signal

Emitted when the display unit changes.

Parameters
newUnitThe new Units value.

◆ validate()

QValidator::State QeAngleLineEdit::validate ( QString & input,
int & pos ) const
overrideprotected

Validate user input.

Parameters
inputThe input string to validate.
posReference to the cursor position.
Returns
The validation state.

◆ validationStateChanged

void QeAngleLineEdit::validationStateChanged ( QValidator::State state)
signal

Emitted when the input validation state changes.

Parameters
stateThe new validator state.

◆ valueFromText()

double QeAngleLineEdit::valueFromText ( const QString & text) const
overrideprotected

Parse display text back to an internal radian value.

Parameters
textThe formatted text string.
Returns
The parsed value in radians.

Property Documentation

◆ maximum

double QeAngleLineEdit::maximum
readwrite

Top range value that can be set.

Accessors:
getMaximum(), setMaximum(double)

◆ minimum

double QeAngleLineEdit::minimum
readwrite

Bottom range value that can be set.

Accessors:
getMinimum(), setMinimum(double)

◆ precision

int QeAngleLineEdit::precision
readwrite

Precision used in the subsecond section of the label.

By default, millisecond precision is used.

Accessors:
getPrecision(), setPrecision(int)

◆ radians

double QeAngleLineEdit::radians
readwrite

Value to represent in radians.

Accessors:
getRadians(), setRadians(double)

◆ unit

Units QeAngleLineEdit::unit
readwrite

Enum value to determine which units should be used to represent displayed value.

Accessors:
getUnits(), setUnits(Units)

The documentation for this class was generated from the following files: