-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqdragablelabel.h
57 lines (41 loc) · 1.29 KB
/
qdragablelabel.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
#ifndef QDRAGABLELABEL_H
#define QDRAGABLELABEL_H
#include <QLabel>
#include <QTextStream>
class QWidget;
class QDragableLabel : public QLabel
{
Q_OBJECT
public:
enum Shape {
Cercle = 0,
Diamond = 1,
Rectangle = 2,
Square = 3,
Triangle = 4,
Triangle2 = 5
};
explicit QDragableLabel(const int _number, const Shape _shape, QWidget *_parent);
explicit QDragableLabel(const int _number, const Shape _shape, const QColor &_front = Qt::red, const QColor &_background = QColor(), const QFont &_font = QFont(), QWidget *_parent = NULL);
Shape getShape() const;
void setShape(const Shape);
quint32 getNumber() const;
void setNumber(const quint32);
const QColor &getFrontColor() const;
void setFrontColor(const QColor &);
const QColor &getBackgroundColor() const;
void setBackgroundColor(const QColor &);
const QFont &getFont() const;
void setFont(const QFont &);
void drawPixmap();
public slots:
void editTag();
private:
quint32 m_number;
Shape m_shape;
QColor m_front, m_background;
QFont m_font;
};
QTextStream &operator<<(QTextStream &, const QDragableLabel &);
QTextStream &operator>>(QTextStream &, QDragableLabel &);
#endif // QDRAGABLELABEL_H