6 Star 9 Fork 4

依尚/CTP-Future

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
controlwidget.h 3.45 KB
一键复制 编辑 原始数据 按行查看 历史
MeGustas 提交于 2017-04-21 15:25 . 1关于报单的错误问题修改
#ifndef CONTROLWIDGET_H
#define CONTROLWIDGET_H
#include <QWidget>
#include <qstandarditemmodel.h>
#include <qabstractitemmodel.h>
#include <string.h>
#include <qtableview.h>
#include <qheaderview.h>
#include <qgridlayout.h>
#include <qpainter.h>
#include <qlineedit.h>
#include <qlabel.h>
#include <qpushbutton.h>
#include <QCheckBox>
#include <QComboBox>
#include <QRadioButton>
#include <QPushButton>
#include <QSlider>
#include <QSpinBox>
#include <qboxlayout.h>
#include"conditiondialog.h"
#include<QEvent>
#include "CtpInterface/ThostFtdcUserApiStruct.h"
class clsContract{
public:
QString strContract;
///涨停板价格
double dHighestPrice;
///跌停板价格
double dLowestPrice;
QString strfutuExchType;
};
class ControlWidget : public QWidget
{
Q_OBJECT
public:
explicit ControlWidget(QWidget *parent = 0);
void setupViews();
QString GetContractCode();
int GetTotalHands();
QString GetFutuExchType();
void SetOrderInfo(char bs,char c_direction,char c_hedge,double en_entrust_price,int FocusType);
void SetEnableAmount(int iAmount);
signals:
bool SigOrderInsert(const char* exch_type, const char* contract_code, char c_bs, char c_direction, char c_hedge, int l_entrust_amount, double en_entrust_price);
void SigGetOpenRatio(char bs,QString ordertype,QString futucode,double price);
public slots:
void SlotValueChanged(double price);
void SlotUpdateShowInfo(double buy1, double buy1cnt,double sell1,double sell1cnt);
void SlotSetHandsTimes(int times);
void SlotBuyRadioBtnClicked();
void SlotSellRadioBtnClicked();
//委托按钮触发事件响应
void OnEntrust();
//点击预埋按钮事件响应
void OnPreEntrust();
void SelectContract(const QModelIndex & index);
void OrderTypeChanged(QString OrderType);
protected:
bool eventFilter(QObject *obj, QEvent *ev);
public:
QTableView* tableOrder;
QAbstractItemModel *modelOrder;
QPushButton * ProdButton;
QLineEdit* CurrentTime;
QLineEdit * EditContract;
QPushButton * FreezeButton;
QComboBox* m_AccountCombox;
conditionDialog* m_conditionDialog;
private:
QLabel* LabelCnt;
QLabel* LabelBuy1;
QLabel* LabelSell1;
QLabel* LabelBuy1Cnt;
QLabel* LabelSell1Cnt;
QLabel* LabelTop;
QLabel* LabelBottom;
QVector<clsContract> m_vContracts;
bool m_bAutoFlg;
//批量下单的单号
int m_BatchNO;
double m_dHighestPrice;
double m_dLowestPrice;
QString m_futu_exch_type;
QCheckBox *m_AccountCheckbox;
QComboBox *m_OrderTypeCombox;
QCheckBox *m_OrderTypeCheckbox;
QLineEdit* m_ContractLineEdit;
QRadioButton* m_BSRadioButton1;
QRadioButton* m_BSRadioButton2;
QRadioButton* m_OCRadioButton1;
QRadioButton* m_OCRadioButton2;
QRadioButton* m_OCRadioButton3;
QCheckBox* m_CancelCheckBox;
QSpinBox* m_RiskSpinBox;
QDoubleSpinBox *m_SpecifiedPriceSpinBox;
QPushButton *m_SpecifiedPriceButton;
QSpinBox *m_OrderCntSpinBox;
QSpinBox *m_HandsTimesSpinBox;
QPushButton *m_OrderButton;
QPushButton *m_ConditionButton;
QPushButton *m_PreentrustButton;
QItemSelectionModel *selectionModel;
QGridLayout *MainLayout;
QBoxLayout *DropLayout,*QuickLayout;
};
#endif // CONTROLWIDGET_H
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/soso58/CTP-Future.git
[email protected]:soso58/CTP-Future.git
soso58
CTP-Future
CTP-Future
master

搜索帮助