1#ifndef QEANGLELABEL_HPP
2#define QEANGLELABEL_HPP
21class QeAngleLabel :
public QLabel {
57 explicit QeAngleLabel(QWidget *parent = Q_NULLPTR);
59 enum Units {SEXAGESIMAL=0, SEXAGECIMAL=0, RADIANS=1, HMS, DMS};
61 double getRadians(){
return m_radians; }
62 int getPrecision(){
return m_precision; }
63 bool getShowUnits(){
return m_showUnits; }
64 Units getUnits(){
return m_units; }
65 Units getHmsDmsHandling(){
return m_hmsDmsHandling; }
87 [[deprecated(
"Please use unitChanged(QeAngleLabel::Units newUnit) signal instead")]]
101 void setRadians(
double newValue){this->m_radians = newValue; emit
radiansChanged(newValue); this->update();};
102 void setPrecision(
int newValue){this->m_precision = newValue; emit
precisionChanged(newValue); this->update();};
103 void setShowUnits(
bool newValue){this->m_showUnits = newValue; emit
showUnitsChanged(newValue); this->update();};
104 void setUnits(Units
units)
106 if (m_units ==
units)
119 if (m_units ==
static_cast<Units
>(
units))
122 m_units =
static_cast<Units
>(
units);
129 void setHmsDmsHandling(Units
units)
131 if (m_hmsDmsHandling ==
units)
134 m_hmsDmsHandling =
units;
140 double m_radians = 0.0;
142 bool m_showUnits =
true;
143 Units m_units = Units::DMS;
144 Units m_hmsDmsHandling = Units::SEXAGECIMAL;
void radiansChanged(double newValue)
Indicates that the radians value has been changed.
double radians
Value to represent in radians.
Definition QeAngleLabel.hpp:28
void setUnitsInt(int units)
Convinience method to allow setting Units using its integer representation.
Definition QeAngleLabel.hpp:118
void precisionChanged(int newValue)
Indicates the precision configuration has been changed.
Units hmsDmsHandling
Enum value to determine if the widget supports HMS/DMS units.
Definition QeAngleLabel.hpp:54
void showUnitsChanged(bool showUnits)
Indicates that showUnits member has been changed.
bool showUnits
Bool value to determine if units should be visible.
Definition QeAngleLabel.hpp:43
Units units
Enum value to determine which units should be used to represent displayed value.
Definition QeAngleLabel.hpp:49
int precision
Precision used in the subsecond section of the label.
Definition QeAngleLabel.hpp:37
void unitChanged(QeAngleLabel::Units units)
Indicates that units of displayed value has been changed.
void unitsChanged(QeAngleLabel::Units units)
Indicates that units of displayed value has been changed.
void hmsDmsHandlingChanged(QeAngleLabel::Units hmsDmsHandling)
Indicates that HMS/DMS handling changed.