1#ifndef QEANGLELINEEDIT_H
2#define QEANGLELINEEDIT_H
4#include <QDoubleSpinBox>
76 [[deprecated(
"Please use getUnits() instead")]]
152 [[deprecated(
"Please use setUnits(Units unit) instead")]]
187 if (qFuzzyCompare(
minimum(), newValue))
190 QDoubleSpinBox::setMinimum(newValue);
199 if (qFuzzyCompare(
maximum(), newValue))
202 QDoubleSpinBox::setMaximum(newValue);
227 QValidator::State
validate(QString& input,
int& pos)
const override;
243 QString formatHMS(
double value)
const;
251 double parseHMS(
const QString& text,
bool& ok)
const;
258 QString formatDMS(
double value)
const;
266 double parseDMS(
const QString& text,
bool& ok)
const;
273 QString formatDegrees(
double value)
const;
281 double parseDegrees(
const QString& text,
bool& ok)
const;
289 double parseRadians(
const QString& text,
bool& ok)
const;
void minimumChanged(double minimum)
Emitted when the minimum value changes.
double valueFromText(const QString &text) const override
Parse display text back to an internal radian value.
Definition QeAngleLineEdit.cpp:72
void handleState(QValidator::State state)
Handle a change in validation state.
Definition QeAngleLineEdit.cpp:27
void setMaximum(double newValue)
Set the maximum allowable value.
Definition QeAngleLineEdit.hpp:198
Units
Angular unit formats.
Definition QeAngleLineEdit.hpp:57
@ SEXAGESIMAL
Standard degrees format.
Definition QeAngleLineEdit.hpp:58
@ DMS
Degrees:Minutes:Seconds format.
Definition QeAngleLineEdit.hpp:61
@ HMS
Hours:Minutes:Seconds format.
Definition QeAngleLineEdit.hpp:60
@ RADIANS
Radians format.
Definition QeAngleLineEdit.hpp:59
void precisionChanged(int precision)
Emitted when the precision changes.
void setUnits(Units unit)
Set the display unit format.
Definition QeAngleLineEdit.cpp:41
QString textFromValue(double value) const override
Convert an internal radian value to display text.
Definition QeAngleLineEdit.cpp:58
void setUnitsInt(int unit)
Convenience method to set Units using its integer representation.
Definition QeAngleLineEdit.hpp:177
void setMinimum(double newValue)
Set the minimum allowable value.
Definition QeAngleLineEdit.hpp:186
double radians
Value to represent in radians.
Definition QeAngleLineEdit.hpp:34
int getPrecision()
Get the precision (number of decimals) for subsecond display.
Definition QeAngleLineEdit.hpp:89
Units getUnits() const
Get the current unit format.
Definition QeAngleLineEdit.hpp:83
int precision
Precision used in the subsecond section of the label.
Definition QeAngleLineEdit.hpp:40
double getMaximum()
Get the maximum allowable value.
Definition QeAngleLineEdit.hpp:107
void maximumChanged(double maximum)
Emitted when the maximum value changes.
double getRadians()
Get the current angle value in radians.
Definition QeAngleLineEdit.hpp:95
Units unit
Enum value to determine which units should be used to represent displayed value.
Definition QeAngleLineEdit.hpp:29
void setPrecision(int newValue)
Set the precision for subsecond display.
Definition QeAngleLineEdit.hpp:165
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 setUnit(Units unit)
Set the display unit format.
Definition QeAngleLineEdit.cpp:37
QeAngleLineEdit(QWidget *parent=nullptr)
Construct a QeAngleLineEdit widget.
Definition QeAngleLineEdit.cpp:12
double minimum
Bottom range value that can be set.
Definition QeAngleLineEdit.hpp:45
Units getUnit() const
Get the current unit format.
Definition QeAngleLineEdit.hpp:77
double getMinimum()
Get the minimum allowable value.
Definition QeAngleLineEdit.hpp:101
void setRadians(double newValue)
Set the angle value in radians.
Definition QeAngleLineEdit.hpp:171
double maximum
Top range value that can be set.
Definition QeAngleLineEdit.hpp:50
QValidator::State validate(QString &input, int &pos) const override
Validate user input.
Definition QeAngleLineEdit.cpp:97