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/ZxSubLegendItems.h

58 lines
1.0 KiB
C

#pragma once
#include "ZxSubLegendItem.h"
// 图例中的每一组
// 不进行序列化由ZxSubLegend序列化之后进行重新绑定
class I_PLOTCURVE_T_EXPORT ZxSubLegendItems
: public ZxRenderItem
{
Q_OBJECT
ZX_DECLARE_DYNAMIC
public:
ZxSubLegendItems();
ZxSubLegendItems(QString sName);
~ZxSubLegendItems();
public:
// 本身Header范围
void setHeaderBound(QRectF rt);
QRectF getHeaderBound();
// 设置载体
void setLegend(ZxRenderItem* p);
// 子项组织
int indexOfItem(ZxSubLegendItem* p);
void addOneItem(ZxSubLegendItem* p);
void removeOneItem(ZxSubLegendItem* p);
// 根据子项字体和文字长度获取最小的长宽(不包括左侧)
QSizeF getAllItemWH();
// 返回子项个数
int getItemCount();
bool isGroupEmpty();
// 返回子项
ZxSubLegendItem* getItemAt(int n);
protected:
// 子项
QVector<ZxSubLegendItem*> m_vecItems;
// 载体
ZxRenderItem* m_pLegend;
// 范围
QRectF m_rtHeader;
};