-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproperty.hpp
60 lines (40 loc) · 1014 Bytes
/
property.hpp
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
#pragma once
#include <QObject>
class Property: public QObject
{
Q_OBJECT
public:
enum TYPE { INT, BOOL, DISCRETE};
Property(char * theName, int theValue, TYPE theType);
~Property();
// getters
char * getName();
int getValue();
TYPE getType();
void changeValue();
int getDefaultValue();
//setters
void setTableValues(int * values);
int minValue;
int maxValue;
int step;
////// for discrete - table with possible values
int * tableValues;
public slots:
// setters
void setValueToChange(int newVal);
// not for BOOOL
void setValueToChangeUp();
void setValueToChangeDown();
void setValueToDefault();
protected:
char * name;
TYPE type;
////// for all TYPE
////// if one of these is -1 then is not specified
// if type == DISCRETE then value is the index in a table with values
int value;
// if type == DISCRETE then it's the min and max value of the index
int valueToChange;
int defaultValue;
};