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.
23 lines
704 B
C++
23 lines
704 B
C++
#pragma once
|
|
|
|
#include "nmObjLineTool.h"
|
|
|
|
class NM_PLOT_EXPORT nmObjLineMeasureTool : public nmObjLineTool
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
nmObjLineMeasureTool();
|
|
// 按下时记录本次起点,松手后才提交有效测量。
|
|
virtual bool onLeftDown(const QPointF& pt) override;
|
|
virtual bool onLeftUp(const QPointF& pt) override;
|
|
// Esc 只取消正在拖动的预览,保留上次结果和测量工具。
|
|
virtual bool cancelInteraction() override;
|
|
// 拖动时用测量线的颜色绘制虚线和空心端点。
|
|
virtual void onPaint(QPainter* painter, const ZxPaintParam& param) override;
|
|
|
|
private:
|
|
// 结束本次手势并清除预览,供松手和 Esc 共用。
|
|
void clearMeasurePreview();
|
|
};
|