cut 3.3.0
Loading...
Searching...
No Matches
QeDmsLabel.hpp
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
21class QeDmsLabel : public QLabel {
22 Q_OBJECT
23
28 Q_PROPERTY(double radians READ getRadians WRITE setRadians NOTIFY radiansChanged )
29
30
37 Q_PROPERTY(int precision READ getPrecision WRITE setPrecision NOTIFY precisionChanged )
38 //TODO: Add max/min value, and clipping. TBD how, but for example, 7.0 or -7.0 shows
39 // +401:04:13.644 and -401:04:13.644. Developer should be able to determine if he wants
40 // the value to restart counting from 0 after it reachers 360 degrees.
41
42public:
43 explicit QeDmsLabel(QWidget *parent = Q_NULLPTR);
44 ~QeDmsLabel();
45 double getRadians(){ return m_radians; };
46 int getPrecision(){ return m_precision; };
47
48signals:
52 void radiansChanged(double newValue);
53
57 void precisionChanged(int newValue);
58
59public slots:
60 void setRadians(double newValue){this->m_radians = newValue; emit radiansChanged(newValue); this->update();};
61 void setPrecision(int newValue){this->m_precision = newValue; emit precisionChanged(newValue); this->update();};
62 void update();
63
64private:
65 double m_radians = 0.0;
66 int m_precision = 3;
67};
68
69#endif // QEDMSLABEL_HPP
double radians
Value to represent in radians.
Definition QeDmsLabel.hpp:28
void radiansChanged(double newValue)
Indicates that the radians value has been changed.
int precision
Precision used in the subsecond section of the label.
Definition QeDmsLabel.hpp:37
void precisionChanged(int newValue)
Indicates the precision configuration has been changed.