|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
|
|
#include "iGridRowItemUnt.h"
|
|
|
|
|
|
|
|
|
|
|
|
// 按钮类,比如点击后,弹出对话框或其他表格等等
|
|
|
|
|
|
|
|
|
|
|
|
class X_GUI_GRIDPTY_EXPORT iGridRowItemBtn :
|
|
|
|
|
|
public iGridRowItemUnt
|
|
|
|
|
|
{
|
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
|
|
explicit iGridRowItemBtn(iGridRowItem* pParent = nullptr);
|
|
|
|
|
|
~iGridRowItemBtn();
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
|
|
// 序列化
|
|
|
|
|
|
virtual void onSerialize(ZxSerializer* ser);
|
|
|
|
|
|
virtual void onDeserialize(ZxSerializer* ser);
|
|
|
|
|
|
|
|
|
|
|
|
// 控件
|
|
|
|
|
|
virtual void initEditor();
|
|
|
|
|
|
virtual void configEditor();
|
|
|
|
|
|
virtual void initOtherEditors();
|
|
|
|
|
|
|
|
|
|
|
|
virtual void setDlgBase(QWidget* p);
|
|
|
|
|
|
virtual void setParameter(iParameter* p);
|
|
|
|
|
|
|
|
|
|
|
|
virtual bool isInputOk();
|
|
|
|
|
|
virtual void setActive(bool b);
|
|
|
|
|
|
|
|
|
|
|
|
// 该基类默认按double进行实现
|
|
|
|
|
|
virtual bool setCurValue(QVariant o);//现值
|
|
|
|
|
|
virtual QVariant getCurValue();
|
|
|
|
|
|
virtual QString getShowValue(); //非激活时显示在右侧的文本
|
|
|
|
|
|
|
|
|
|
|
|
// 原值,请在setParameter之前调用
|
|
|
|
|
|
virtual void setRawValue(QVariant o);
|
|
|
|
|
|
QVariant getRawValue();
|
|
|
|
|
|
|
|
|
|
|
|
// 位置相关
|
|
|
|
|
|
virtual void setBounds(QRectF& rt);
|
|
|
|
|
|
virtual QRectF getRightBounds_Main();
|
|
|
|
|
|
virtual QVariant getInfoRight();
|
|
|
|
|
|
virtual QString getInfoUnit();
|
|
|
|
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
|
|
|
|
|
|
|
/// @brief 触发按钮,允许外部进行按钮操作,比如弹出对话框之类
|
|
|
|
|
|
/// @param sName: (in) 参数标识,为英文标识
|
|
|
|
|
|
/// @param vCustom: (in & out) 外部弹出后,可以把数据传递回来,并且缓存,以支持序列化
|
|
|
|
|
|
/// @param bModified: (out) 是否正确触发且vCustom发生改变
|
|
|
|
|
|
void sigBtnClicked(const QString sSegName, \
|
|
|
|
|
|
QVariant& vCustom, \
|
|
|
|
|
|
bool& bModified);
|
|
|
|
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
|
|
|
|
|
|
|
|
virtual void slotBtnClicked();
|
|
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
|
|
|
|
virtual void onCustomDataChanged();
|
|
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
|
|
|
|
QPushButton* m_pBtn;
|
|
|
|
|
|
|
|
|
|
|
|
//QVariant m_vCustom; //外部弹出后,可以把数据传递回来,并且缓存,以支持序列化
|
|
|
|
|
|
};
|