#pragma once #include "ZxRenderView.h" #include "tCurvePlotScene.h" #include "iPlotCurveT_global.h" // 图视图 class I_PLOTCURVE_T_EXPORT tCurvePlotView : public ZxRenderView { Q_OBJECT ZX_DECLARE_DYNAMIC public: tCurvePlotView(); public: // 获取Scene,仅仅类型转换 tCurvePlotScene* getScene() const; virtual QRectF adjustRectFitViewAspect(const QRectF& rect); // 准备右键菜单 virtual void onPrepareContextMenu(QMenu* pMenu, const QPointF& pos); // 图示简易模式(不显示缩放、不有滚动条) virtual void setSimpleMode(bool bSimpleMode); public slots: virtual void slotSaveAsImg(); virtual void slotCopyAsImg(); virtual void slotUndo(); virtual void slotRedo(); public: signals: // 由于本来不依赖数据对象,所有通过信号槽关联出去 void sigCheckDragAccepted(QDragEnterEvent*, bool&); void sigDealwithDrop(QDropEvent*); void sigMousePosChanged(const QPointF &pos); // 获取额外的tips,比如 探测半径 void sigGetTipsExOfPos(QString& sTip, float fX, float fY); // 状态栏 void sigFresh2Status(QString& s); protected: /// @brief 拖拽支持 void dragEnterEvent(QDragEnterEvent *event); void dropEvent(QDropEvent* event); void mouseMoveEvent(QMouseEvent* e); void focusOutEvent(QFocusEvent *); void leaveEvent(QEvent *); protected: bool m_bSimpleMode; //是否简易模式 // 拖拽模式 bool m_bDraging; };