Files
QTradeProgram/Sqbase/qhistoryorderdialog.h

63 lines
1.4 KiB
C
Raw Normal View History

2025-08-15 15:56:40 +08:00
#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);
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʷ<EFBFBD><CAB7>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD>
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;
2025-08-31 23:07:06 +08:00
// <20><><EFBFBD><EFBFBD>ί<EFBFBD><CEAF>
2025-08-15 15:56:40 +08:00
NumberFormatDelegate *m_numberDelegate;
OrderTypeDelegate *m_typeDelegate;
mutable QMutex m_cacheMutex;
mutable QMap<QDate, QList<QSharedPointer<BigOrderInfo>>> m_historyCache;
};
#endif // HISTORYORDERDIALOG_H