QWT API (中文) 7.0.1
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
qwt_figure_widget_overlay.h
1#ifndef QWTFIGUREWIDGETOVERLAY_H
2#define QWTFIGUREWIDGETOVERLAY_H
3#include "qwt_widget_overlay.h"
4// Qt
5class QEvent;
6class QMouseEvent;
7class QHoverEvent;
8class QKeyEvent;
9// Qwt
10class QwtFigure;
11class QwtPlot;
12
37{
38 Q_OBJECT
39 QWT_DECLARE_PRIVATE(QwtFigureWidgetOverlay)
40public:
51 {
52 ControlLineTop,
53 ControlLineBottom,
54 ControlLineLeft,
55 ControlLineRight,
56 ControlPointTopLeft,
57 ControlPointTopRight,
58 ControlPointBottomLeft,
59 ControlPointBottomRight,
60 Inner,
61 OutSide
62 };
63 Q_ENUM(ControlType)
64
65
75 {
76 FunSelectCurrentPlot = 1,
77 FunResizePlot = 2
78 };
79 Q_ENUM(BuiltInFunctionsFlag)
80 Q_DECLARE_FLAGS(BuiltInFunctions, BuiltInFunctionsFlag)
81 Q_FLAG(BuiltInFunctions)
82
83public:
85 explicit QwtFigureWidgetOverlay(QwtFigure* fig);
88 QwtFigure* figure() const;
89 void setTransparentForMouseEvents(bool on);
90 bool isTransparentForMouseEvents() const;
91
92public:
94 static Qt::CursorShape controlTypeToCursor(ControlType rr);
96 static ControlType getPositionControlType(const QPoint& pos, const QRect& region, int err = 1);
98 static bool isPointInRectEdget(const QPoint& pos, const QRect& region, int err = 1);
100 void setBuiltInFunctionsEnable(BuiltInFunctionsFlag flag, bool on = true);
102 bool testBuiltInFunctions(BuiltInFunctionsFlag flag) const;
104 bool hasActiveWidget() const;
106 bool isResizing() const;
108 void setBorderPen(const QPen& p);
110 QPen borderPen() const;
112 void setControlPointBrush(const QBrush& b);
114 QBrush controlPointBrush() const;
116 void setControlPointSize(const QSize& c);
118 QSize controlPointSize() const;
120 void selectNextWidget(bool forward = true);
122 void selectNextPlot(bool forward = true);
124 QWidget* currentActiveWidget() const;
126 QwtPlot* currentActivePlot() const;
128 void showPercentText(bool on = true);
130 virtual bool cancel();
131public Q_SLOTS:
133 void setActiveWidget(QWidget* w);
134
135protected:
136 virtual void drawOverlay(QPainter* p) const override;
137 virtual QRegion maskHint() const override;
139 virtual void drawActiveWidget(QPainter* painter, QWidget* activeW) const;
141 virtual void drawResizeingControlLine(QPainter* painter, const QRectF& willSetNormRect) const;
143 virtual void drawControlLine(QPainter* painter, const QRect& actualRect, const QRectF& normRect) const;
145 void startResize(ControlType controlType, const QPoint& pos);
146
147protected:
148 void mouseMoveEvent(QMouseEvent* me) override;
149 void mouseReleaseEvent(QMouseEvent* me) override;
150 void mousePressEvent(QMouseEvent* me) override;
151 void keyPressEvent(QKeyEvent* ke) override;
152Q_SIGNALS:
153
169 void widgetNormGeometryChanged(QWidget* w, const QRectF& oldNormGeo, const QRectF& newNormGeo);
170
184 void activeWidgetChanged(QWidget* oldActive, QWidget* newActive);
185
197 void finished(bool isCancel);
198private Q_SLOTS:
199 void onAxesRemove(QwtPlot* removedAxes);
200};
201
202#endif // QWTFIGUREWIDGETOVERLAY_H
针对QwtFigure的操作蒙版
Definition qwt_figure_widget_overlay.h:37
void finished(bool isCancel)
操作完成信号
void activeWidgetChanged(QWidget *oldActive, QWidget *newActive)
激活窗口发生变化的信号
ControlType
用于标记矩形的区域
Definition qwt_figure_widget_overlay.h:51
void widgetNormGeometryChanged(QWidget *w, const QRectF &oldNormGeo, const QRectF &newNormGeo)
绘图尺寸发生改变信号
BuiltInFunctionsFlag
内置的功能标志
Definition qwt_figure_widget_overlay.h:75
用于组织Qwt绘图的图形容器,提供灵活的布局选项
Definition qwt_figure.h:77
二维绘图部件
Definition qwt_plot.h:138
控件的覆盖层
Definition qwt_widget_overlay.h:80
virtual void drawOverlay(QPainter *painter) const =0
绘制控件覆盖层
virtual QRegion maskHint() const
Calculate an approximation for the mask
Definition qwt_widget_overlay.cpp:413