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/iGui/iGuiGridPty/iGridRowItemImg.h

63 lines
1.4 KiB
C

#pragma once
#include "iGridRowItemUnt.h"
// Img
class X_GUI_GRIDPTY_EXPORT iGridRowItemImg : \
public iGridRowItemUnt
{
Q_OBJECT
public:
explicit iGridRowItemImg(iGridRowItem* pParent = NULL);
~iGridRowItemImg();
// 初始化
virtual void setDlgBase(QWidget* p);
virtual void setParameter(iParameter* p);
virtual void initEditor();
virtual void configEditor();
virtual QString getEditorCss(bool bValid);
// Image处理
bool dealwithImg(QVariant& o);
bool parseFromFile(QString s, QImage& img, QByteArray& ba);
// 数据范围
QString getParaScales();
// 该基类默认按float进行实现
virtual bool setCurValue(QVariant o);//现值
virtual QVariant getCurValue();
// 范围
virtual void setBounds(QRectF& rt);
virtual QRectF getRightBounds_Main();//右
virtual QRectF getRightBounds_Unt();
// 双击
virtual void onItemDoubleCliked(GridTickPos o);
protected:
// 绘图
virtual void paint(QPainter* pPainter);
virtual void _paintItemValue(QPainter* pPainter);
// ByteArray Image
static bool imgToBa(QImage& img, QByteArray& ba);
static bool baToImg(QImage& img, QByteArray& ba);
public slots:
void slotImgBrowse();
protected:
// 借助QLabel显示图片
//m_oRawValue为QByteArray
QImage m_oImg; //其实只是为了方便
QPushButton* m_pBtn;
};