cut 3.3.0
Loading...
Searching...
No Matches
QeHmsLabel.hpp
1#ifndef QEHMSLABEL_HPP
2#define QEHMSLABEL_HPP
3
4#include <QObject>
5#include <QString>
6#include <QVariant>
7#include <QWidget>
8#include <QLabel>
9
19class QeHmsLabel : public QLabel {
20 Q_OBJECT
21
26 Q_PROPERTY(double radians READ getRadians WRITE setRadians NOTIFY radiansChanged )
27
28
34 Q_PROPERTY(int precision READ getPrecision WRITE setPrecision NOTIFY precisionChanged )
35 //TODO: Add max/min value, and clipping. TBD how, but for example, 7.0 or -7.0 shows
36 // +401:04:13.644 and -401:04:13.644. Developer should be able to determine if he wants
37 // the value to restart counting from 0 after it reachers 360 degrees.
38
39signals:
43 void radiansChanged(double newValue);
47 void precisionChanged(int newValue);
48
49public:
55 explicit QeHmsLabel(QWidget *parent = Q_NULLPTR);
56 ~QeHmsLabel();
57 double getRadians(){ return m_radians; };
58 double getPrecision(){ return m_precision; };
59
60public slots:
61 void setRadians(double newValue){this->m_radians = newValue; emit radiansChanged(newValue); this->update();};
62 void setPrecision(int newValue){this->m_precision = newValue; emit precisionChanged(newValue); this->update();};
63 void update();
64
65private:
66 double m_radians = 0.0;
67 int m_precision = 3;
68};
69
70#endif // QEHMSLABEL_HPP
double radians
Value to represent in radians.
Definition QeHmsLabel.hpp:26
int precision
Precision used in the subsecond section of the label.
Definition QeHmsLabel.hpp:34
void radiansChanged(double newValue)
Signal emitted when the value represented by the widget has changed.
void precisionChanged(int newValue)
Signal emitted when the precision of the widget has changed.
QeHmsLabel(QWidget *parent=Q_NULLPTR)
Constructor for QeHmsLabel.
Definition QeHmsLabel.cpp:13