update code
This commit is contained in:
62
Sqbase/qorderlistviewer.h
Normal file
62
Sqbase/qorderlistviewer.h
Normal file
@@ -0,0 +1,62 @@
|
||||
#ifndef QORDERLISTVIEWER_H
|
||||
#define QORDERLISTVIEWER_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QTableView>
|
||||
#include <QStandardItemModel>
|
||||
#include <QHeaderView>
|
||||
#include <QHBoxLayout>
|
||||
#include "QOrderListManager.h"
|
||||
|
||||
class QOrderBookView : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit QOrderBookView(QWidget *parent = nullptr);
|
||||
~QOrderBookView();
|
||||
|
||||
void updateView();
|
||||
void setPricePrecision(int precision);
|
||||
void setVolumePrecision(int precision);
|
||||
|
||||
private slots:
|
||||
void onOrderBookChanged();
|
||||
|
||||
private:
|
||||
void initUI();
|
||||
void initConnections();
|
||||
void updateBidView();
|
||||
void updateAskView();
|
||||
|
||||
QTableView* m_bidView;
|
||||
QTableView* m_askView;
|
||||
QStandardItemModel* m_bidModel;
|
||||
QStandardItemModel* m_askModel;
|
||||
|
||||
int m_pricePrecision = 2;
|
||||
int m_volumePrecision = 4;
|
||||
};
|
||||
|
||||
class QOrderDetailView : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit QOrderDetailView(QWidget *parent = nullptr);
|
||||
~QOrderDetailView();
|
||||
|
||||
void setOrderType(QOrderListManager::OrderType type);
|
||||
void updateView();
|
||||
|
||||
private slots:
|
||||
void onOrderBookChanged();
|
||||
|
||||
private:
|
||||
void initUI();
|
||||
void initConnections();
|
||||
|
||||
QTableView* m_detailView;
|
||||
QStandardItemModel* m_detailModel;
|
||||
QOrderListManager::OrderType m_orderType;
|
||||
};
|
||||
|
||||
#endif // QORDERLISTVIEWER_H
|
||||
Reference in New Issue
Block a user