-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlabelcategory.h
55 lines (45 loc) · 1.47 KB
/
labelcategory.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
#ifndef LABELCATEGORY_H
#define LABELCATEGORY_H
#include <QObject>
#include <QSharedPointer>
#include "types.h"
class Label;
class LabelCategory : public QObject {
Q_OBJECT
public:
explicit LabelCategory(QObject *parent = nullptr);
Q_PROPERTY(int id READ id WRITE setId NOTIFY idChanged FINAL)
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged FINAL)
Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged FINAL)
Q_PROPERTY(int lineWidth READ lineWidth WRITE setLineWidth NOTIFY lineWidthChanged FINAL)
Q_PROPERTY(
QString description READ description WRITE setDescription NOTIFY descriptionChanged FINAL)
Q_PROPERTY(bool visible READ visible WRITE setVisible NOTIFY visiableChanged FINAL)
int id() const;
QString name() const;
QColor color() const;
int lineWidth() const;
QString description() const;
bool visible() const;
void setId(int id);
void setName(QString name);
void setColor(QColor color);
void setLineWidth(int width);
void setDescription(QString desc);
void setVisible(bool visible);
signals:
void idChanged();
void nameChanged();
void colorChanged();
void lineWidthChanged();
void descriptionChanged();
void visiableChanged();
private:
int mId = 0;
QString mName;
QColor mColor = Qt::green;
int mLineWidth = 2;
QString mDescription;
bool mVisible = true;
};
#endif // LABELCATEGORY_H