|
|
|
|
#ifndef MAINWINDOW_H
|
|
|
|
|
#define MAINWINDOW_H
|
|
|
|
|
|
|
|
|
|
#include <QMainWindow>
|
|
|
|
|
#include "structs.h"
|
|
|
|
|
#include "userdata.h"
|
|
|
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
namespace Ui { class MainWindow; }
|
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
|
|
|
|
class TradeTableModel;
|
|
|
|
|
class QStandardItemModel;
|
|
|
|
|
class MainWindow : public QMainWindow
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
MainWindow(QWidget *parent = nullptr);
|
|
|
|
|
~MainWindow();
|
|
|
|
|
void SetUserInfo(UserInfo user);
|
|
|
|
|
//临时使用,后续需要重新创建
|
|
|
|
|
void SetUserData();
|
|
|
|
|
void LoadTrendsData();
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
bool eventFilter(QObject *watched, QEvent *event);
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
void InitTradeTable();
|
|
|
|
|
void Init();
|
|
|
|
|
void InitStyle();
|
|
|
|
|
|
|
|
|
|
void getQssColor(const QString &qss, const QString &flag, QString &color);
|
|
|
|
|
void getQssColor(const QString &qss, QString &textColor,
|
|
|
|
|
QString &panelColor, QString &borderColor,
|
|
|
|
|
QString &normalColorStart, QString &normalColorEnd,
|
|
|
|
|
QString &darkColorStart, QString &darkColorEnd,
|
|
|
|
|
QString &highColor);
|
|
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
void on_addTrade_pushButton_clicked();
|
|
|
|
|
void on_btnMenu_Min_clicked();
|
|
|
|
|
void on_btnMenu_Max_clicked();
|
|
|
|
|
void on_btnMenu_Close_clicked();
|
|
|
|
|
void buttonClick();
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
Ui::MainWindow *ui;
|
|
|
|
|
UserInfo m_UserInfo;
|
|
|
|
|
UserData* m_UserData;
|
|
|
|
|
QList<StockBasicInfo> m_StockBasicList;
|
|
|
|
|
// TradeTableModel* m_pTradesModel;
|
|
|
|
|
QStandardItemModel* m_pTradeStandardModel;
|
|
|
|
|
|
|
|
|
|
//根据QSS样式获取对应颜色值
|
|
|
|
|
QString borderColor;
|
|
|
|
|
QString normalBgColor;
|
|
|
|
|
QString darkBgColor;
|
|
|
|
|
QString normalTextColor;
|
|
|
|
|
QString darkTextColor;
|
|
|
|
|
};
|
|
|
|
|
#endif // MAINWINDOW_H
|