QWT API (中文) 7.3.0
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
qwt_plot_picker.h
1/******************************************************************************
2 * Qwt Widget Library
3 * Copyright (C) 2024 ChenZongYan <czy.t@163.com>
4 *****************************************************************************/
5
6#ifndef QWT_PLOT_PICKER_H
7#define QWT_PLOT_PICKER_H
8
9#include "qwt_global.h"
10#include "qwt_picker.h"
11#include "qwt_axis_id.h"
12
13class QwtPlot;
14class QPointF;
15class QRectF;
16
17#if QT_VERSION < 0x060000
18template< typename T >
19class QVector;
20#endif
21
28class QWT_EXPORT QwtPlotPicker : public QwtPicker
29{
30 Q_OBJECT
31
32public:
34 explicit QwtPlotPicker(QWidget* canvas);
35
37 ~QwtPlotPicker() override;
38
40 explicit QwtPlotPicker(QwtAxisId xAxisId, QwtAxisId yAxisId, QWidget*);
41
43 explicit QwtPlotPicker(QwtAxisId xAxisId, QwtAxisId yAxisId, RubberBand rubberBand, DisplayMode trackerMode, QWidget*);
44
46 virtual void setAxes(QwtAxisId xAxisId, QwtAxisId yAxisId);
47
49 QwtAxisId xAxis() const;
50
52 QwtAxisId yAxis() const;
53
55 QwtPlot* plot();
56
58 const QwtPlot* plot() const;
59
61 QWidget* canvas();
62
64 const QWidget* canvas() const;
65
66Q_SIGNALS:
67
72 void selected(const QPointF& pos);
73
78 void selected(const QRectF& rect);
79
85
91 void appended(const QPointF& pos);
92
98 void moved(const QPointF& pos);
99
100protected:
102 QRectF scaleRect() const;
103
105 QRectF invTransform(const QRect&) const;
106
108 QRect transform(const QRectF&) const;
109
111 QPointF invTransform(const QPoint&) const;
112
114 QPoint transform(const QPointF&) const;
115
117 virtual QwtText trackerText(const QPoint&) const override;
118
120 virtual QwtText trackerTextF(const QPointF&) const;
121
123 virtual void move(const QPoint&) override;
124
126 virtual void append(const QPoint&) override;
127
129 virtual bool end(bool ok = true) override;
130
131private:
132 QWT_DECLARE_PRIVATE(QwtPlotPicker)
133};
134
135#endif
Definition qwt_clipper.h:41
QwtPicker provides selections on a widget
Definition qwt_picker.h:108
DisplayMode
Display mode
Definition qwt_picker.h:163
virtual void move(const QPoint &)
Move the last point of the selection The moved() signal is emitted.
Definition qwt_picker.cpp:1241
virtual void append(const QPoint &)
Append a point to the selection and update rubber band and tracker.
Definition qwt_picker.cpp:1224
RubberBand
Rubber band style
Definition qwt_picker.h:130
virtual QwtText trackerText(const QPoint &pos) const
Return the label for a position
Definition qwt_picker.cpp:485
virtual bool end(bool ok=true)
Close a selection setting the state to inactive.
Definition qwt_picker.cpp:1178
QwtPlotPicker provides selections on a plot canvas
Definition qwt_plot_picker.h:29
void selected(const QPointF &pos)
Signal emitted in case of QwtPickerMachine::PointSelection
void moved(const QPointF &pos)
Signal emitted whenever the last appended point of the selection has been moved
void appended(const QPointF &pos)
Signal emitted when a point has been appended to the selection
QwtPlotPicker(QwtAxisId xAxisId, QwtAxisId yAxisId, QWidget *)
Constructor with axes
void selected(const QVector< QPointF > &pa)
Signal emitting the selected points at the end of a selection
void selected(const QRectF &rect)
Signal emitted in case of QwtPickerMachine::RectSelection
QwtPlotPicker(QwtAxisId xAxisId, QwtAxisId yAxisId, RubberBand rubberBand, DisplayMode trackerMode, QWidget *)
Constructor with axes, rubber band and tracker mode
~QwtPlotPicker() override
Destructor
A 2-D plotting widget
Definition qwt_plot.h:99
A class representing a text
Definition qwt_text.h:70