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/iPlot/iPlotCurveT/ZxSubLegendItem.h

81 lines
1.6 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 <QPen>
#include <QColor>
#include <QFont>
#include "Defines.h"
#include "ZxRenderItem.h"
#include "iPlotCurveT_global.h"
// 图例中的每一项
class ZxObjCurveBase;
class I_PLOTCURVE_T_EXPORT ZxSubLegendItem : public ZxRenderItem
{
Q_OBJECT
ZX_DECLARE_DYNAMIC
public:
public:
ZxSubLegendItem();
ZxSubLegendItem(ZxObjCurveBase* pCurve);
~ZxSubLegendItem();
public:
// 关联曲线
void setCurve(ZxObjCurveBase* p); //用于序列化时,重新设定
ZxObjCurveBase* getCurve(void);
QString getCurveName();
// 根据当前字体和文字以及线获取其最小的宽+高
float getFixedWidth();
float getFixedHeight();
// 刷新
virtual void update();
public:
// 序列化
virtual void onSerialize(ZxSerializer* ser);
virtual void onDeserialize(ZxSerializer* ser);
virtual void onLoadTempl(ZxSerializer* ser);
virtual void onSaveTempl(ZxSerializer* ser);
virtual QString getTemplPath(bool bSelf);
// 属性页
virtual void fillPtyPano(IxPtyPano* sheet);
// 绘图
virtual void paintBack(QPainter* painter, const ZxPaintParam& param);
// 鼠标
virtual void onLeftDoubleClick(const QPointF& pt);
virtual void onLeftClick(const QPointF& pt);
// 获取线范围内的点
VecPointF getDotPtsWithin(QRectF rt);
Q_SIGNALS:
void sigLeftDoubleClicked(const QPointF& pt);
protected:
// 存入曲线最原始的名字,可能与显示的不一致
// 因为分组原因显示的放在objectName中
QString m_sCurveName;
// 外界传入,本类不负责释放
ZxObjCurveBase* m_pCurve;
};