-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathPriceView.h
More file actions
109 lines (104 loc) · 2.72 KB
/
PriceView.h
File metadata and controls
109 lines (104 loc) · 2.72 KB
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
99
100
101
102
103
104
105
106
107
108
109
#ifndef PRICEVIEW_H
#define PRICEVIEW_H
#include <QWidget>
#include <QPainter>
#include <QLineEdit>
#include <QPushButton>
#include <QTableWidget>
#include "InstrManage.h"
typedef struct
{
QString name; // 集合名
QRect privateSet; // 绘图区域
QList<QString> instrList; // 合约号清单
}PrivateInstrs; // 自选合约
#define DEFAULT_W 1200
class TradeWidget;
class PriceView: public QWidget {
Q_OBJECT
public:
PriceView(TradeWidget * tWidget, QWidget* parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags());
~PriceView();// 用于设定手数
TradeWidget * tw; // 下单窗口
protected:
// 构建或repaint或update后触发
void paintEvent(QPaintEvent *event);
// 鼠标移动时的事件处理
void mouseMoveEvent(QMouseEvent * event);
// 记录鼠标按下时的状态
void mousePressEvent(QMouseEvent * event);
// 记录鼠标松开时的状态
void mouseReleaseEvent(QMouseEvent * event);
// 窗口双击事件
void mouseDoubleClickEvent(QMouseEvent * event);
// 处理鼠标滚轮事件
void wheelEvent(QWheelEvent * event);
// 右键菜单
void contextMenuEvent(QContextMenuEvent* e);
// 键盘事件
void keyPressEvent ( QKeyEvent * event);
// 窗口大小调整
void resizeEvent(QResizeEvent * event);
// 滚动行数
int wrows;
// 横向滚动条位置
int v_sc;
// 纵向滚动条位置
int h_sc;
// 横向滚动条区域
QRect vsBarR;
// 纵向滚动条区域
QRect hsBarR;
// 横向滚动条拖动区域
QRect vsBarRt;
// 纵向滚动条拖动区域
QRect hsBarRt;
// 单击行数
int clickLine;
// 记录鼠标拖动的宽度起点
int moveWPixs;
// 记录鼠标拖动的高度起点
int moveHPixs;
// 自选合约区域
QRect setsRect;
// 赛选合约板
QRect filterRect;
//// 自选合约板
//QRect selfRect;
// 选择交易品种
InstrManage * selectInstr;
// 右键菜单
QMenu * setMenu;
// 自选合约清单
// QMap<QString, PrivateInstrs *> priInstrMap;
PrivateInstrs * priRect; // 自选
PrivateInstrs * zlsRect; // 主力
// 当前 合约类
PrivateInstrs * curPi;
// 取消订阅行情
void cancelQuotReq();
// 加载数据
void loadDBinfo();
// 校验当前合约是否在自相关列表中 true 在 false 不在
bool checkInstr(CThostFtdcInstrumentField * is);
// 当前合约map
QMap<QString, CThostFtdcInstrumentField *> * mapTemp;
// 显示的合约map
QMap<QString, CThostFtdcInstrumentField *> viewTemp;
private:
// 绘制自选板
void paintPriBoard(QPainter *p);
// 绘制报价板
void paintPriceBoard(QPainter *p);
public slots:
void getInstr();
// 打开下单界面
/*void showTradeW();*/
// 添加到自选合约map
void addToSelfMap();
// 删除自选
void delFrSelfMap();
// k线展示
void showCurve();
};
#endif