2.组可以调整组的上下边界,同时调整靠近上下边界的油气高度,中间油气高度可调整 3.添加选中层效果,根据logplus效果调整拖动效果,以及鼠标光标状态。
101 lines
2.8 KiB
C++
101 lines
2.8 KiB
C++
#ifndef TRANSPARENTDRAGGABLERESUL_H
|
|
#define TRANSPARENTDRAGGABLERESUL_H
|
|
|
|
#include <QObject>
|
|
#include "qmycustomplot.h"
|
|
#include <QString>
|
|
#include <QMenu>
|
|
#include "geometryutils.h"
|
|
#include <QSvgRenderer>
|
|
|
|
#pragma execution_character_set("utf-8") // 强制指定执行字符集为 UTF-8
|
|
|
|
class TransparentDraggableResult : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit TransparentDraggableResult(QMyCustomPlot *parentPlot, TransparentDraggableResult *upDraggableResult=nullptr, QString strUuid="", double minWidth = 1.0, QString strTitle = "");
|
|
|
|
~TransparentDraggableResult();
|
|
|
|
|
|
void DrawSVGNormal(QPainter* painter,QString svgFileName,QRectF borderRect,bool IsWellSectonHorizonLayout);
|
|
//拉伸
|
|
void DrawSVGSteched(QPainter* painter,QString svgFileName,QRectF borderRect,bool IsWellSectonHorizonLayout);
|
|
//平铺
|
|
void DrawSVGTiled(QPainter* painter,QString svgFileName,QRectF borderRect,bool IsWellSectonHorizonLayout);
|
|
//设置最小宽度
|
|
void setMinWidth(double minWidth);
|
|
//设置标题
|
|
void setTitle(QString strTitle);
|
|
|
|
//设置解释结论
|
|
void setResult(QString filePath);
|
|
|
|
void drawResult(double left_Low, double right_Hight, double lY1, double lY2);
|
|
// 设置矩形范围
|
|
void setRange(double left_Low, double right_Hight);
|
|
void setDragRange(double left_Low, double right_Hight);
|
|
// 获取当前范围
|
|
QCPRange getRange();
|
|
|
|
// 设置矩形颜色
|
|
void setColor(const QColor &color);
|
|
|
|
// 删除框图
|
|
void deleteRect();
|
|
|
|
void setSelectRect(bool bselect);
|
|
|
|
QCPItemRect * getLeftHandle();
|
|
TransparentDraggableResult* getUpResult();
|
|
signals:
|
|
void rangeChanged(QCPRange newRange);
|
|
|
|
private:
|
|
void initRect();
|
|
void updateHandles() ;
|
|
|
|
private slots:
|
|
void onDelRect();
|
|
void onMousePress(QMouseEvent *event);
|
|
void onMouseMove(QMouseEvent *event);
|
|
void onMouseRelease(QMouseEvent *event);
|
|
//
|
|
void onMouseMove_in(QMouseEvent *event);
|
|
void onMouseMove_in_DragLeft(QMouseEvent *event);
|
|
void onMouseMove_in_DragRight(QMouseEvent *event);
|
|
void onMouseRelease_in(QMouseEvent *event);
|
|
|
|
double getMyLower();
|
|
double getMyUpper();
|
|
|
|
private:
|
|
QMyCustomPlot *mPlot;
|
|
QCPItemRect *mRect;
|
|
QCPItemRect *mLeftHandle = NULL;
|
|
QCPItemRect *mRightHandle;
|
|
|
|
QCPItemRect *mDragRect;
|
|
|
|
QCPItemPixmap *mPixmap;
|
|
QCPItemText *mItemTitle;
|
|
QString mstrTitle="";
|
|
QString m_strUuid = "";
|
|
|
|
TransparentDraggableResult *m_upDraggableResult=nullptr;
|
|
TransparentDraggableResult *m_downDraggableResult=nullptr;
|
|
QString m_Result;
|
|
|
|
enum DragMode { DragNone, DragLeft, DragRight, DragRect };
|
|
DragMode mDragMode = DragNone;
|
|
//double mDragStartX = 0;
|
|
double mDragStartY = 0;
|
|
QCPRange mDragStartRange;
|
|
|
|
// 添加最小宽度成员变量
|
|
double mMinWidth;
|
|
};
|
|
|
|
#endif // TRANSPARENTDRAGGABLERESUL_H
|