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/mGuiJob/iWxDataObjEdit.h

114 lines
2.4 KiB
C

#pragma once
#include "iDlgBase.h"
#include "mGuiJob_global.h"
class iParaItemCtrl;
class ZxDataObject;
class ZxDataWell;
class iXmlTable;
class iXmlField;
class M_GUI_JOB_EXPORT iWxDataObjEdit : public iDlgBase
{
Q_OBJECT
public:
explicit iWxDataObjEdit(QWidget *parent = 0);
~iWxDataObjEdit();
public:
// Title
void setTitle(QString s);
// TableName
void setTableName(QString s);
//返回数据体
ZxDataObject* getObjData();
// Obj
virtual void setObj(ZxDataObject* p);
// 模式
void setEditMode(bool b);
// 初始化
virtual void initUI();
// 返回修改的标题,为了树刷新
virtual QString getNodeName();
signals:
// 当应用或保存成功时触发
void sigObjDataChanged(VecVariant&, ZxDataObject*);
// 在井数据改变之前进行触发以准备db文件之类
void sigWellDataToChange(bool, VecVariant&, VecVariant&, ZxDataWell*);
protected slots:
void slotTbxEditingFinished();
// void slotApply();
void slotSaveObj();
void slotCancel();
private:
// 初始化子项
void initUI_Title();
QLayout* initUI_Headers();
QLayout* initUI_MainGrids();
QLayout* initUI_Btns();
// 获取表格配置信息
iXmlTable* findTableConfig();
// 范围
QString getScaleStrOf(iXmlField* p);
// 根据表名创建一个对应Object的对象体
ZxDataObject* createObjBy(QString sTableName);
// 把Obj内容刷新至UI或者反之
bool refreshVec2UI(VecVariant& vec);
bool refreshUI2Vec(VecVariant& vec);
bool findSubWxInfo(int nRow, QWidget*& pWx, iXmlField*& pF);
// 获取所有的区块或者油田名称
QStringList getFieldBlockNames(bool bBlock);
// 输入检测
bool checkInputs();
bool checkInputs_WellName();
bool isWellNameOk(QString s);
protected:
virtual void paintEvent(QPaintEvent *);
protected:
// 针对数据表
QString m_sTableName;
iXmlTable* m_pXmlTable;
// 两种传入模式
// Obj
ZxDataObject* m_pObj;
// Data
VecVariant m_vecData;
// 如果传入Obj或者ObjData则为编辑模式否则新建模式
bool m_bEditMode;
// Grid 临时变量,为了方便
QGridLayout* m_pGridLayout;
QLineEdit* m_pTbxWellCode; //权宜之计
QLineEdit* m_pTbxWellName;
VecInt m_vecHideCols; //隐藏的
VecVariant m_vecHideValues;
};