#pragma once #include "ZxLayerItem.h" /// 临时图层. 这是一种特殊图层, 主要特点如下 /// 每个场景只有一个临时图层 /// 总是在其他图层前面 class I_PLOTBASE_EXPORT ZxTempLayer : public ZxLayerItem { Q_OBJECT ZX_DECLARE_DYNAMIC public: ZxTempLayer(); /// 是否显示十字线 virtual void setCrossLineVisible(bool bVisible); virtual bool isCrossLineVisible() const; /// 十字线位置(窗口坐标) virtual void setCrossLinePos(const QPointF& _pt); virtual QPointF getCrossLinePos() const; /// 十字线的画笔 virtual QPen getCrossLinePen() const; virtual void setCrossLinePen(QPen pen); /// 十字线显示区域 virtual QRectF getCrossLineRect() const; virtual void setCrossLineRect(const QRectF& rect); // 设置Tips virtual void setTips(QString s); virtual QString getTips() const; virtual void setTipsVisible(bool bVisible); virtual bool isTipsVisible() const; // 鼠标移出视图区 virtual void clearLineAndTips(); protected: virtual void paintFront(QPainter* painter, const ZxPaintParam& param); virtual void paintCrossLine(QPainter* painter, const ZxPaintParam& param, QRectF rt); virtual void paintTips(QPainter* painter, const ZxPaintParam& param, QRectF rt); virtual void updateRenderArea(); protected: bool m_bShowCrossLine; QPointF m_ptCrossLine; QPen m_penCrossLine; QRectF m_rectCrossLine; bool m_bShowTips; QString m_sTips; };