-
Notifications
You must be signed in to change notification settings - Fork 18
/
mainwindow.h
134 lines (119 loc) · 3.18 KB
/
mainwindow.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QDesktopWidget>
#include <QApplication>
#include <QMenuBar> //菜单栏
#include <QToolBar> //工具栏
#include <QStatusBar> //状态栏
#include <QLabel>
#include <QGroupBox>
#include <QTableWidget>
#include <QStringList>
#include <QTabWidget>
#include <QDockWidget>
#include <QString>
#include <QPixmap>
#include <QPalette>
#include <QRect>
#include <QByteArray>
#include <QMutex>
#include <QMessageBox>
#include <QThread>
#include <QPoint>
#include <QMenu>
#include "login.h"
#include "myemail.h"
#include "datafromlocal.h"
#include "login_otheraccount.h"
#include "searchinstrument.h"
#include "ui/accountinfo.h"
#include "ui/hangqinginfo.h"
#include "ui/weituoinfo.h"
#include "ui/historytradeinfo.h"
#include "ui/chicanginfo.h"
#include "ui/tradelog.h"
#include "ui/tradeboardinfo.h"
#include "ui/instrumentinfo.h"
#include "ui/strategymonitor.h"
#include "mainengine.h"
extern MainEngine* me;
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
//事件过滤
bool eventFilter(QObject *target, QEvent *e) override;
public slots:
//显示登录界面框
void showlogin();
// 添加多账户界面
void showlogin_n();
// 登录函数
void MDTDLogin(QString);
// 添加多账户登录
void MDTDLogin_n(QString);
// 保存邮箱信息
void SaveEamil(QString);
void OnInstrmentLineTextSubscribe();
void OnSendOrderClicked();
void OnCancelAll();
void OnCancelOne(); //当前合约表选中右键撤单
//持仓表选中右键平仓
void OffsetOne();
void OnStartCTA();
void OnStopCTA();
//委托表 右键撤单
void OnWtMenu(const QPoint& pt);
void OnWtMenu1(const QPoint& pt);
//打印日志
void PrintLog(QString s);
private:
//界面布局初始化
void viewInit();
//设置窗口
void setWindow(int x, int y,int w,int h);
//设置菜单栏
void setMenu();
//设置工具栏
void setTool();
//设置状态栏
void setStatus();
//恢复界面初始化状态
void restoreView();
//不用new和delete,一种更安全的方式
void restoreView1();
// 获得订单数据
bool getSendOrderRequest(orderCommonRequest& order_field);
public:
TradeLog *tradelog;
TradeboardInfo *tradeboard; //"hangqinginfo.cpp"调用
private:
Login * mylogin {nullptr}; //登陆框指针
Login_otheraccount *mylogin_n; //添加多账户
MyEmail * myemail {nullptr}; //邮件
SearchInstrument *mysearch {nullptr}; //查询合约
DataFromLocal * datalocal; //添加本地数据
Ui::MainWindow *ui;
MyAccountInfo *account;
HangqingInfo *hangqing;
WeituoInfo *weituo;
HistoryTrade * historytrade;
ChicangInfo *chicang;
//TradeLog *tradelog;
//TradeboardInfo *tradeboard;
InstrumentShow *instrument;
StrategyMonitor *strategymonitor;
//右键撤单
QAction *actioncd;
//右键平仓
QAction *actionOffset;
// 索引编辑框
//CompleteLineEdit* order_contract_edit;
};
#endif // MAINWINDOW_H