forked from cetcjinjian/StockKLine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
autogrid.h
98 lines (64 loc) · 1.88 KB
/
autogrid.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#ifndef AUTOGRID_H
#define AUTOGRID_H
#include <QWidget>
class AutoGrid : public QWidget
{
Q_OBJECT
public:
explicit AutoGrid(QWidget *parent = 0);
void virtual initial();
void virtual drawBK();
void virtual resizeEvent(QResizeEvent* event);
void virtual calAtomGridHeight();
void virtual calAtomGridWidth();
void virtual paintEvent(QPaintEvent* event);
void drawGrid();
void drawHorLine();
void drawVerLine();
int getMarginLeft() const;
void setMarginLeft(int value);
int getMarginRight() const;
void setMarginRight(int value);
int getMarginTop() const;
void setMarginTop(int value);
int getMarginBottom() const;
void setMarginBottom(int value);
int getWidgetHeight() const;
int getWidgetWidth() const;
double getGridHeight() const;
double getGridWidth() const;
int getHGridNum() const;
void setHGridNum(int value);
int getWGridNum() const;
void setWGridNum(int value);
double getAtomGridHeightMin() const;
void setAtomGridHeightMin(double value);
double getAtomGridWidthMin() const;
void setAtomGridWidthMin(double value);
double getAtomGridHeight() const;
double getAtomGridWidth() const;
private:
//表格距边框距离
int marginLeft = 80;
int marginRight = 80;
int marginTop = 20;
int marginBottom = 20;
//当前widget的宽度和高度
int widgetHeight;
int widgetWidth;
//当前表格的宽度和高度
double gridHeight;
double gridWidth;
//当前表格中最小表格的宽度和高度
double atomGridHeight;
double atomGridWidth;
//表格中小格子的数量
int hGridNum;
int wGridNum;
//当前表格中最小表格的宽度和高度的最小值
double atomGridHeightMin;
double atomGridWidthMin;
signals:
public slots:
};
#endif // AUTOGRID_H