-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathLabelWidget.h
More file actions
51 lines (36 loc) · 868 Bytes
/
LabelWidget.h
File metadata and controls
51 lines (36 loc) · 868 Bytes
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
#ifndef LABELWIDGET_H
#define LABELWIDGET_H
#include <QWidget>
#include <QList>
namespace Ui {
class LabelWidget;
}
class LabelWidget : public QWidget
{
Q_OBJECT
#define WIDGET_MIN_HEIGHT 5
public:
explicit LabelWidget(QWidget *parent = 0);
~LabelWidget();
void appendWidget(QWidget *w);
void removeWidget(QWidget *w);
void removeWidget(int index);
void wideWidget(int step);
void narrowWidget(int step);
private:
void upShiftPixel(int pix);
void downShiftPixel(int pix);
void reflushWidgets();
private:
Ui::LabelWidget *ui;
protected:
void mousePressEvent(QMouseEvent *);
void mouseReleaseEvent(QMouseEvent *);
void mouseMoveEvent(QMouseEvent *);
private:
QList<QWidget *> m_widgetList;
int m_childWidgetHeight;
int m_moveFlag;
int m_prevPixY;
};
#endif // LABELWIDGET_H