-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathposiManage.h
More file actions
79 lines (77 loc) · 1.83 KB
/
posiManage.h
File metadata and controls
79 lines (77 loc) · 1.83 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
#ifndef POSIMANAGE_H
#define POSIMANAGE_H
#include <QWidget>
#include <QPainter>
#include <QLineEdit>
#include <QPushButton>
#include <QTableWidget>
#include "loginWin.h"
class TradeWidget;
class PosiManage: public QWidget
{
Q_OBJECT
public:
PosiManage(TradeWidget * tWidget, QWidget* parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags());
~PosiManage();// 用于设定手数
TradeWidget * tw; // 下单窗口
protected:
// 构建或repaint或update后触发
void paintEvent(QPaintEvent * event);
// 鼠标移动时的事件处理
void mouseMoveEvent(QMouseEvent * event);
// 记录鼠标松开时的状态
void mouseReleaseEvent(QMouseEvent * event);
// 窗口双击事件
void mouseDoubleClickEvent(QMouseEvent * event);
// 处理鼠标滚轮事件
void wheelEvent(QWheelEvent * event);
// 滚动行数
int wrows;
// 单击行数
int clickLine;
// 使用叫买叫卖价
bool BSPriceIsUsed;
//// 数量区域
//QRect qtyRect;
//// 数量编辑区域
//QRect qtyEditRect;
//// 价格区域
//QRect priceRect;
// CheckBox区域
QRect checkRect;
// 平仓区域
QRect closeRect;
// 行权区域
QRect depositRect;
// 当前持仓
CThostFtdcInvestorPositionField * c_posi;
// 当前价格
CThostFtdcDepthMarketDataField *s_Quot;
// 数量键入
QLineEdit *qtyLineEdit;
// 实时价格
double posiCurrentPrice;
// 价格
double BSPrice;
// 数量
int BSQty;
// 选中数量
int selectedBSQty;
// 选中价格
double selectedPrice;
private:
// 绘制持仓表格
void paintPosiTable(QPainter * p);
// 绘制按钮区域
void paintBox(QPainter * p);
public slots:
// 平仓
// void closePosition(CThostFtdcInvestorPositionField *currentPosi);
// 行权
// void depositAction(CThostFtdcInvestorPositionField *currentPosi);
void closePosition();
void depositAction();
// k线展示
void showCurve();
};
#endif