48 lines
1.4 KiB
C
48 lines
1.4 KiB
C
|
|
#ifndef HISTORYORDERDIALOG_H
|
||
|
|
#define HISTORYORDERDIALOG_H
|
||
|
|
#include <QDialog>
|
||
|
|
#include <QStandardItemModel>
|
||
|
|
#include <QSortFilterProxyModel>
|
||
|
|
#include <QStyledItemDelegate>
|
||
|
|
#include <QDateEdit>
|
||
|
|
#include <QTableView>
|
||
|
|
#include <QComboBox>
|
||
|
|
#include <QLineEdit>
|
||
|
|
#include <QPushButton>
|
||
|
|
#include <QLabel>
|
||
|
|
#include <QVBoxLayout>
|
||
|
|
#include <QHBoxLayout>
|
||
|
|
#include <QMutex>
|
||
|
|
#include <QString>
|
||
|
|
#include "ordertypedelegate.h"
|
||
|
|
class QHistoryOrderDialog : public QDialog
|
||
|
|
{
|
||
|
|
Q_OBJECT
|
||
|
|
public:
|
||
|
|
explicit QHistoryOrderDialog(QWidget *parent = nullptr);
|
||
|
|
~QHistoryOrderDialog() = default;
|
||
|
|
private slots:
|
||
|
|
void onDateChanged(const QDate &date);
|
||
|
|
void onFilterChanged();
|
||
|
|
void onExportClicked();
|
||
|
|
private:
|
||
|
|
void initUI();
|
||
|
|
void loadOrdersForDate(const QDate &date);
|
||
|
|
void updateStatistics(const QList<QSharedPointer<class BigOrderInfo>>& orders);
|
||
|
|
QString m_historyPath;
|
||
|
|
QList<QSharedPointer<BigOrderInfo>> getHistoryOrders(const QDate& date) const;
|
||
|
|
QList<QDate> getAvailableDates() const;
|
||
|
|
QDateEdit *m_dateSelector;
|
||
|
|
QComboBox *m_orderTypeFilter;
|
||
|
|
QLineEdit *m_stockCodeFilter;
|
||
|
|
QTableView *m_tableView;
|
||
|
|
QPushButton *m_exportButton;
|
||
|
|
QLabel *m_statsLabel;
|
||
|
|
QStandardItemModel *m_model;
|
||
|
|
QSortFilterProxyModel *m_proxyModel;
|
||
|
|
NumberFormatDelegate *m_numberDelegate;
|
||
|
|
OrderTypeDelegate *m_typeDelegate;
|
||
|
|
mutable QMutex m_cacheMutex;
|
||
|
|
mutable QMap<QDate, QList<QSharedPointer<BigOrderInfo>>> m_historyCache;
|
||
|
|
};
|
||
|
|
#endif
|