You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nmWATI/Include/mGui/mGuiPlot/iGuiPlotTableHelper.h

87 lines
2.2 KiB
C++

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#pragma once
#include "iDlgBase.h"
#include "mGuiPlot_global.h"
class ZxTableView;
class ZxTableModel;
class ZxObjCurveBase;
class ZxDataGaugeBase;
class M_GUI_PLOT_EXPORT iGuiPlotTableHelper : public iDlgBase
{
Q_OBJECT
public:
explicit iGuiPlotTableHelper(const QString& sTitle, QWidget *parent = 0);
~iGuiPlotTableHelper();
// 初始化
virtual void initUI();
// 如果pCurve对应的的表已经存在则修改其数据
// 否则新建
ZxTableView* appendTableBy(ZxObjCurveBase* pCurve);
// 图上选中,反推表格
void setSelectedRows(ZxObjCurveBase* pCurve, int nFrom, int nTo);
QStringList getTitles(ZxObjCurveBase* pCurve);
// 删除pCurve对应的表
bool removeTableBy(ZxObjCurveBase* pCurve);
// 设置TabWx的当前Tab
bool setCurrentTableBy(ZxObjCurveBase* pCurve);
int getIndexOf(ZxObjCurveBase* pCurve);
// 反复查找相关的函数
QString getTagByModel(const ZxTableModel* p);
// 是否显示toolbar
void setToolBarVisible(bool );
// 返回所有View
QMap<QString, ZxTableView*>* getMapTableViews();
// 保存入库
void runPossibleSave();
bool isPossibleModified();
// 设置表格只读,主要是右键及双击
void setTableReadonly(QString sTag = "", bool bReadonly = true);
public slots:
// Toolbar按钮消息响应
virtual void slotBtnTriggered();
virtual void slotSaveDatabase();
signals:
// 在保存时通过该信号获取对应的DataObj
void sigGetDataObjOfView(ZxTableView* pView, ZxDataGaugeBase*& p);
// 一旦压力或流量保存之后,则触发其他窗口的刷新
void sigDataSavedPF(QString sCode);
private:
void loadDatabase(ZxTableModel* pModel);
void loadFromExcel(ZxTableModel* pModel);
ZxTableView* getCurView();
protected:
virtual QHBoxLayout* initToolBars();
virtual ZxTableView* createTableView(VVecFloat& vvecData, QStringList& listTitles);
virtual void paintEvent(QPaintEvent *);
private:
// TabWx
QTabWidget* m_pTabWx;
// 是否显示toolbar
bool m_bShowToolBar;
// TableView载体
QMap<QString, ZxTableView*> m_mapTableViews;
};