-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathformsinglelight.h
77 lines (60 loc) · 1.67 KB
/
formsinglelight.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/**
* @author Saef Taher
* @date 14/01/2018
*/
#ifndef FORMSINGLELIGHT_H
#define FORMSINGLELIGHT_H
#include "light.h"
#include <QWidget>
#include <QModelIndex>
#include <memory>
/**
* Handels the form for an Light object which also can be a Group
*/
namespace Ui {
class FormSingleLight;
}
class FormSingleLight : public QWidget
{
Q_OBJECT
public:
explicit FormSingleLight(QWidget *parent = 0);
~FormSingleLight();
/**
* @brief setLight sets the light object of the current form
* @param l the light to set.
* @param index the index where the light object came from.
*/
void setLight(Light l, QModelIndex index);
/**
* @brief refreshUI refrehes the UI according to the light object.
*/
void refreshUI();
signals:
/**
* @brief changed is triggered when the form was changed and the emitTimer triggers an update
* @param l the changed light.
* @param index the changed index.
*/
void changed(Light l, const QModelIndex& index);
/**
* @brief addAsAmbi is triggered when the light should be added t o the ambilights
*/
void addAsAmbi(bool arg, const QModelIndex& index);
private slots:
void on_lineEdit_textChanged(const QString &arg1);
void on_briSlider_valueChanged(int value);
void on_hueDial_valueChanged(int value);
void on_satDial_valueChanged(int value);
void on_onOffButton_toggled(bool checked);
void on_checkBox_toggled(bool checked);
private:
static constexpr const double TIMER = 400;
Ui::FormSingleLight *ui;
QTimer *emitTimer_;
Light l_;
QModelIndex index_;
bool dirty_;
void change();
};
#endif // FORMSINGLELIGHT_H