cut  1.2.2-pre1
QeDmsLabel.hpp
Go to the documentation of this file.
1 #ifndef QEDMSLABEL_HPP
2 #define QEDMSLABEL_HPP
3 
4 #include <QObject>
5 #include <QString>
6 #include <QVariant>
7 #include <QWidget>
8 #include <QLabel>
9 
19 class QeDmsLabel : public QLabel {
20  Q_OBJECT
21 
26  Q_PROPERTY(double radians MEMBER m_radians READ getRadians WRITE setRadians NOTIFY radiansChanged )
27 
28 
35  Q_PROPERTY(int precision MEMBER m_precision READ getPrecision WRITE setPrecision NOTIFY precisionChanged )
36  //TODO: Add max/min value, and clipping. TBD how, but for example, 7.0 or -7.0 shows
37  // +401:04:13.644 and -401:04:13.644. Developer should be able to determine if he wants
38  // the value to restart counting from 0 after it reachers 360 degrees.
39 
40 public:
41  explicit QeDmsLabel(QWidget *parent = Q_NULLPTR);
42  ~QeDmsLabel();
43  double getRadians(){ return m_radians; };
44  int getPrecision(){ return m_precision; };
45 
46 signals:
50  void radiansChanged(double newValue);
51 
55  void precisionChanged(int newValue);
56 
57 public slots:
58  void setRadians(double newValue){this->m_radians = newValue; emit radiansChanged(newValue); this->update();};
59  void setPrecision(int newValue){this->m_precision = newValue; emit precisionChanged(newValue); this->update();};
60  void update();
61 
62 private:
63  double m_radians = 0.0;
64  int m_precision = 3;
65 };
66 
67 #endif // QEDMSLABEL_HPP
QeDmsLabel::precision
int precision
Precision used in the subsecond section of the label.
Definition: QeDmsLabel.hpp:35
QeDmsLabel::QeDmsLabel
QeDmsLabel(QWidget *parent=Q_NULLPTR)
Definition: QeDmsLabel.cpp:12
QeDmsLabel
A text label that prints from a radian, it representation in Degree/Minute/Seconds notation.
Definition: QeDmsLabel.hpp:19
QeDmsLabel::radians
double radians
Value to represent in radians @accessors getRadians(), setRadians(double)
Definition: QeDmsLabel.hpp:26
QeDmsLabel::update
void update()
Definition: QeDmsLabel.cpp:22
QeDmsLabel::setPrecision
void setPrecision(int newValue)
Definition: QeDmsLabel.hpp:59
QeDmsLabel::~QeDmsLabel
~QeDmsLabel()
Definition: QeDmsLabel.cpp:18
QeDmsLabel::getPrecision
int getPrecision()
Definition: QeDmsLabel.hpp:44
QeDmsLabel::getRadians
double getRadians()
Definition: QeDmsLabel.hpp:43
QeDmsLabel::radiansChanged
void radiansChanged(double newValue)
Indicates that the radians value has been changed.
QeDmsLabel::precisionChanged
void precisionChanged(int newValue)
Indicates the precision configuration has been changed.
QeDmsLabel::setRadians
void setRadians(double newValue)
Definition: QeDmsLabel.hpp:58