QWT API (中文) 7.0.1
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
| Public 槽 | 信号 | Public 成员函数 | Protected 成员函数 | 所有成员列表
QwtPlotAxisZoomer类 参考

QwtPlotAxisZoomer 为绘图部件提供堆叠式缩放功能 更多...

#include <qwt_plot_axis_zoomer.h>

类 QwtPlotAxisZoomer 继承关系图:
QwtPlotPicker QwtPicker QwtEventPattern

class  PrivateData
 

Public 槽

void moveBy (double dx, double dy)
 通过偏移量移动当前缩放矩形。
 
virtual void moveTo (const QPointF &)
 移动当前缩放矩形。
 
virtual void zoom (const QRectF &)
 放大到指定矩形。
 
virtual void zoom (int offset)
 通过偏移量放大或缩小。
 
- Public 槽 继承自 QwtPicker
void setEnabled (bool)
 启用或禁用选择器
 

信号

void zoomed (const QRectF &rect)
 
- 信号 继承自 QwtPlotPicker
void selected (const QPointF &pos)
 QwtPickerMachine::PointSelection 情况下发出的信号
 
void selected (const QRectF &rect)
 QwtPickerMachine::RectSelection 情况下发出的信号
 
void selected (const QVector< QPointF > &pa)
 在选择结束时发出选中点的信号
 
void appended (const QPointF &pos)
 当一个点被添加到选择中时发出的信号
 
void moved (const QPointF &pos)
 当选择中最后添加的点被移动时发出的信号
 
- 信号 继承自 QwtPicker
void activated (bool on)
 当选择器被激活时发出的信号
 
void selected (const QPolygon &polygon)
 在选择结束时发出选定点的信号
 
void appended (const QPoint &pos)
 当一个点被添加到选择时发出的信号
 
void moved (const QPoint &pos)
 当选择的最后一个添加点被移动时发出的信号
 
void removed (const QPoint &pos)
 当选择的最后一个添加点被移除时发出的信号
 
void changed (const QPolygon &selection)
 当活动选择被更改时发出的信号
 

Public 成员函数

 QwtPlotAxisZoomer (QWidget *, bool doReplot=true)
 为绘图画布创建缩放器。
 
 QwtPlotAxisZoomer (QwtAxisId xAxis, QwtAxisId yAxis, QWidget *, bool doReplot=true)
 使用指定的坐标轴为绘图画布创建缩放器。
 
virtual void setZoomBase (bool doReplot=true)
 使用 scaleRect() 作为基准重新初始化缩放堆栈。
 
virtual void setZoomBase (const QRectF &)
 设置缩放器的初始大小。
 
QRectF zoomBase () const
 返回缩放器的初始矩形。
 
QRectF zoomRect () const
 返回缩放堆栈当前位置的矩形。
 
virtual void setAxes (QwtAxisId xAxis, QwtAxisId yAxis) override
 重新初始化坐标轴,并将缩放基准设置为它们的刻度。
 
void setMaxStackDepth (int)
 限制递归缩放操作的数量。
 
int maxStackDepth () const
 返回缩放堆栈的最大深度。
 
const QStack< QRectF > & zoomStack () const
 返回缩放堆栈。
 
void setZoomStack (const QStack< QRectF > &, int zoomRectIndex=-1)
 设置缩放堆栈。
 
uint zoomRectIndex () const
 返回缩放堆栈当前位置的索引。
 
- Public 成员函数 继承自 QwtPlotPicker
 QwtPlotPicker (QWidget *canvas)
 Constructor
 
virtual ~QwtPlotPicker ()
 Destructor
 
 QwtPlotPicker (QwtAxisId xAxisId, QwtAxisId yAxisId, QWidget *)
 Constructor with axes
 
 QwtPlotPicker (QwtAxisId xAxisId, QwtAxisId yAxisId, RubberBand rubberBand, DisplayMode trackerMode, QWidget *)
 Constructor with axes, rubber band and tracker mode
 
QwtAxisId xAxis () const
 Get the x axis
 
QwtAxisId yAxis () const
 Get the y axis
 
QwtPlotplot ()
 Get the plot widget
 
const QwtPlotplot () const
 Get the plot widget (const version)
 
QWidget * canvas ()
 Get the canvas widget
 
const QWidget * canvas () const
 Get the canvas widget (const version)
 
- Public 成员函数 继承自 QwtPicker
 QwtPicker (QWidget *parent)
 构造函数
 
 QwtPicker (RubberBand rubberBand, DisplayMode trackerMode, QWidget *)
 
void setStateMachine (QwtPickerMachine *)
 设置状态机并删除前一个
 
const QwtPickerMachinestateMachine () const
 返回分配的状态机(const)
 
QwtPickerMachinestateMachine ()
 返回分配的状态机
 
void setRubberBand (RubberBand)
 设置橡皮筋样式
 
RubberBand rubberBand () const
 返回橡皮筋样式
 
void setTrackerMode (DisplayMode)
 设置追踪器的显示模式
 
DisplayMode trackerMode () const
 返回追踪器显示模式
 
void setResizeMode (ResizeMode)
 设置调整大小模式
 
ResizeMode resizeMode () const
 返回调整大小模式
 
void setRubberBandPen (const QPen &)
 设置橡皮筋的画笔
 
QPen rubberBandPen () const
 返回橡皮筋画笔
 
void setTrackerPen (const QPen &)
 设置追踪器的画笔
 
QPen trackerPen () const
 返回追踪器画笔
 
void setTrackerFont (const QFont &)
 设置追踪器的字体
 
QFont trackerFont () const
 返回追踪器字体
 
bool isEnabled () const
 启用时返回 true,否则返回 false
 
bool isActive () const
 选择器在 begin()end() 之间处于活动状态
 
virtual bool eventFilter (QObject *, QEvent *) override
 处理事件的事件过滤器
 
QWidget * parentWidget ()
 返回发生选择的父控件
 
const QWidget * parentWidget () const
 返回发生选择的父控件(const)
 
virtual QPainterPath pickArea () const
 找到观察部件上可能发生选择的区域
 
virtual void drawRubberBand (QPainter *) const
 根据橡皮筋样式绘制橡皮筋
 
virtual void drawTracker (QPainter *) const
 绘制追踪器
 
virtual QRegion trackerMask () const
 计算追踪器覆盖层的掩码
 
virtual QRegion rubberBandMask () const
 计算橡皮筋覆盖层的掩码
 
virtual QRect trackerRect (const QFont &) const
 从追踪器当前位置计算追踪器文本的边界矩形
 
virtual void setTrackerPosition (const QPoint &pos)
 手动设置追踪器位置
 
QPoint trackerPosition () const
 返回追踪器的当前位置
 
QPolygon selection () const
 返回选定的点
 
void update ()
 
void setActive (bool on)
 
- Public 成员函数 继承自 QwtEventPattern
 QwtEventPattern ()
 构造函数
 
virtual ~QwtEventPattern ()
 析构函数
 
void initMousePattern (int numButtons)
 根据鼠标按钮数量设置默认鼠标模式
 
void initKeyPattern ()
 设置默认按键模式
 
void setMousePattern (MousePatternCode, Qt::MouseButton button, Qt::KeyboardModifiers=Qt::NoModifier)
 更改一个鼠标模式
 
void setKeyPattern (KeyPatternCode, int key, Qt::KeyboardModifiers modifiers=Qt::NoModifier)
 更改一个按键模式
 
void setMousePattern (const QVector< MousePattern > &)
 更改鼠标事件模式
 
void setKeyPattern (const QVector< KeyPattern > &)
 更改按键事件模式
 
const QVector< MousePattern > & mousePattern () const
 返回鼠标模式向量
 
const QVector< KeyPattern > & keyPattern () const
 返回按键模式向量
 
QVector< MousePattern > & mousePattern ()
 返回鼠标模式向量
 
QVector< KeyPattern > & keyPattern ()
 返回按键模式向量
 
bool mouseMatch (MousePatternCode, const QMouseEvent *) const
 将鼠标事件与事件模式进行比较
 
bool keyMatch (KeyPatternCode, const QKeyEvent *) const
 将按键事件与事件模式进行比较
 

Protected 成员函数

virtual void rescale ()
 Rescale the plot
 
virtual QSizeF minZoomSize () const
 Get minimum zoom size
 
virtual void widgetMouseReleaseEvent (QMouseEvent *) override
 Handle mouse release event
 
virtual void widgetKeyPressEvent (QKeyEvent *) override
 Handle key press event
 
virtual void begin () override
 Begin selection
 
virtual bool end (bool ok=true) override
 End selection
 
virtual bool accept (QPolygon &) const override
 Accept selection
 
- Protected 成员函数 继承自 QwtPlotPicker
QRectF scaleRect () const
 Get the scale rectangle
 
QRectF invTransform (const QRect &) const
 Inverse transform a rectangle
 
QRect transform (const QRectF &) const
 Transform a rectangle
 
QPointF invTransform (const QPoint &) const
 Inverse transform a point
 
QPoint transform (const QPointF &) const
 Transform a point
 
virtual QwtText trackerText (const QPoint &) const override
 Get the tracker text for a point
 
virtual QwtText trackerTextF (const QPointF &) const
 Get the tracker text for a point (floating point)
 
virtual void move (const QPoint &) override
 Move the selection
 
virtual void append (const QPoint &) override
 Append a point to the selection
 
- Protected 成员函数 继承自 QwtPicker
virtual QPolygon adjustedPoints (const QPolygon &) const
 pickedPoints() 映射为 selection()
 
virtual void transition (const QEvent *)
 Passes an event to the state machine and executes the resulting commands.
 
virtual void remove ()
 Remove the last point of the selection The removed() signal is emitted.
 
virtual void reset ()
 Reset the state machine and terminate ( end(false) ) the selection
 
virtual void widgetMousePressEvent (QMouseEvent *)
 Handle a mouse press event for the observed widget.
 
virtual void widgetMouseDoubleClickEvent (QMouseEvent *)
 Handle mouse double click event for the observed widget.
 
virtual void widgetMouseMoveEvent (QMouseEvent *)
 Handle a mouse move event for the observed widget.
 
virtual void widgetWheelEvent (QWheelEvent *)
 Handle a wheel event for the observed widget.
 
virtual void widgetKeyReleaseEvent (QKeyEvent *)
 Handle a key release event for the observed widget.
 
virtual void widgetEnterEvent (QEvent *)
 Handle a enter event for the observed widget.
 
virtual void widgetLeaveEvent (QEvent *)
 Handle a leave event for the observed widget.
 
virtual void stretchSelection (const QSize &oldSize, const QSize &newSize)
 Scale the selection by the ratios of oldSize and newSize The changed() signal is emitted.
 
virtual void updateDisplay ()
 Update the state of rubber band and tracker label
 
const QwtWidgetOverlayrubberBandOverlay () const
 返回显示橡皮筋的覆盖层
 
const QwtWidgetOverlaytrackerOverlay () const
 返回显示追踪器文本的覆盖层
 
const QPolygon & pickedPoints () const
 返回到目前为止收集的点
 
- Protected 成员函数 继承自 QwtEventPattern
virtual bool mouseMatch (const MousePattern &, const QMouseEvent *) const
 Compare a mouse event with an event pattern.
 
virtual bool keyMatch (const KeyPattern &, const QKeyEvent *) const
 Compare a key event with an event pattern.
 

额外继承的成员函数

- Public 类型 继承自 QwtPicker
enum  RubberBand {
  NoRubberBand = 0 , HLineRubberBand , VLineRubberBand , CrossRubberBand ,
  RectRubberBand , EllipseRubberBand , PolygonRubberBand , UserRubberBand = 100
}
 橡皮筋样式 更多...
 
enum  DisplayMode { AlwaysOff , AlwaysOn , ActiveOnly }
 显示模式 更多...
 
enum  ResizeMode { Stretch , KeepSize }
 控制当观察部件调整大小时对选定点的处理方式 更多...
 
- Public 类型 继承自 QwtEventPattern
enum  MousePatternCode {
  MouseSelect1 , MouseSelect2 , MouseSelect3 , MouseSelect4 ,
  MouseSelect5 , MouseSelect6 , MousePatternCount
}
 Symbolic mouse input codes 更多...
 
enum  KeyPatternCode {
  KeySelect1 , KeySelect2 , KeyAbort , KeyLeft ,
  KeyRight , KeyUp , KeyDown , KeyRedo ,
  KeyUndo , KeyHome , KeyPatternCount
}
 Symbolic keyboard input codes 更多...
 
- 属性 继承自 QwtPicker
bool isEnabled
 
ResizeMode resizeMode
 
DisplayMode trackerMode
 
QPen trackerPen
 
QFont trackerFont
 
RubberBand rubberBand
 
QPen rubberBandPen
 

详细描述

QwtPlotAxisZoomer 为绘图部件提供堆叠式缩放功能

构造及析构函数说明

◆ QwtPlotAxisZoomer() [1/2]

QwtPlotAxisZoomer::QwtPlotAxisZoomer ( QWidget *  canvas,
bool  doReplot = true 
)
explicit

为绘图画布创建缩放器。

◆ QwtPlotAxisZoomer() [2/2]

QwtPlotAxisZoomer::QwtPlotAxisZoomer ( QwtAxisId  xAxisId,
QwtAxisId  yAxisId,
QWidget *  canvas,
bool  doReplot = true 
)
explicit

使用指定的坐标轴为绘图画布创建缩放器。

成员函数说明

◆ accept()

bool QwtPlotAxisZoomer::accept ( QPolygon &  pa) const
overrideprotectedvirtual

Accept selection

Check and correct a selected rectangle

Reject rectangles with a height or width < 2, otherwise expand the selected rectangle to a minimum size of 11x11 and accept it.

返回
true If the rectangle is accepted, or has been changed to an accepted one.

重载 QwtPicker .

◆ begin()

void QwtPlotAxisZoomer::begin ( )
overrideprotectedvirtual

Begin selection

Rejects selections, when the stack depth is too deep, or the zoomed rectangle is minZoomSize().

参见
minZoomSize(), maxStackDepth()

重载 QwtPicker .

◆ end()

bool QwtPlotAxisZoomer::end ( bool  ok = true)
overrideprotectedvirtual

End selection

Expand the selected rectangle to minZoomSize() and zoom in if accepted.

参数
okIf true, complete the selection and emit selected signals otherwise discard the selection.
参见
accept(), minZoomSize()
返回
True if the selection has been accepted, false otherwise

重载 QwtPlotPicker .

◆ maxStackDepth()

int QwtPlotAxisZoomer::maxStackDepth ( ) const

返回缩放堆栈的最大深度。

◆ minZoomSize()

QSizeF QwtPlotAxisZoomer::minZoomSize ( ) const
protectedvirtual

Get minimum zoom size

Limit zooming by a minimum rectangle

返回
zoomBase().width() / 10e4, zoomBase().height() / 10e4

◆ moveBy

void QwtPlotAxisZoomer::moveBy ( double  dx,
double  dy 
)
slot

通过偏移量移动当前缩放矩形。

◆ moveTo

void QwtPlotAxisZoomer::moveTo ( const QPointF &  pos)
virtualslot

移动当前缩放矩形。

◆ rescale()

void QwtPlotAxisZoomer::rescale ( )
protectedvirtual

Rescale the plot

Adjust the observed plot to zoomRect()

注解
Initiates QwtPlot::replot()

◆ setAxes()

void QwtPlotAxisZoomer::setAxes ( QwtAxisId  xAxisId,
QwtAxisId  yAxisId 
)
overridevirtual

重新初始化坐标轴,并将缩放基准设置为它们的刻度。

重载 QwtPlotPicker .

◆ setMaxStackDepth()

void QwtPlotAxisZoomer::setMaxStackDepth ( int  depth)

限制递归缩放操作的数量。

◆ setZoomBase() [1/2]

void QwtPlotAxisZoomer::setZoomBase ( bool  doReplot = true)
virtual

使用 scaleRect() 作为基准重新初始化缩放堆栈。

◆ setZoomBase() [2/2]

void QwtPlotAxisZoomer::setZoomBase ( const QRectF &  base)
virtual

设置缩放器的初始大小。

◆ setZoomStack()

void QwtPlotAxisZoomer::setZoomStack ( const QStack< QRectF > &  zoomStack,
int  zoomRectIndex = -1 
)

设置缩放堆栈。

◆ widgetKeyPressEvent()

void QwtPlotAxisZoomer::widgetKeyPressEvent ( QKeyEvent *  ke)
overrideprotectedvirtual

Handle key press event

Qt::Key_Plus zooms in, Qt::Key_Minus zooms out one position on the zoom stack, Qt::Key_Escape zooms out to the zoom base.

Changes the current position on the stack, but doesn't pop any rectangle.

注解
The keys codes can be changed, using QwtEventPattern::setKeyPattern: 3, 4, 5

重载 QwtPicker .

◆ widgetMouseReleaseEvent()

void QwtPlotAxisZoomer::widgetMouseReleaseEvent ( QMouseEvent *  me)
overrideprotectedvirtual

Handle mouse release event

Qt::MidButton zooms out one position on the zoom stack, Qt::RightButton to the zoom base.

Changes the current position on the stack, but doesn't pop any rectangle.

注解
The mouse events can be changed, using QwtEventPattern::setMousePattern: 2, 1

重载 QwtPicker .

◆ zoom [1/2]

void QwtPlotAxisZoomer::zoom ( const QRectF &  rect)
virtualslot

放大到指定矩形。

◆ zoom [2/2]

void QwtPlotAxisZoomer::zoom ( int  offset)
virtualslot

通过偏移量放大或缩小。

◆ zoomBase()

QRectF QwtPlotAxisZoomer::zoomBase ( ) const

返回缩放器的初始矩形。

◆ zoomed

void QwtPlotAxisZoomer::zoomed ( const QRectF &  rect)
signal

当绘图被放大或缩小时发出的信号,包含当前的缩放矩形。

参数
rect当前缩放矩形。

◆ zoomRect()

QRectF QwtPlotAxisZoomer::zoomRect ( ) const

返回缩放堆栈当前位置的矩形。

◆ zoomRectIndex()

uint QwtPlotAxisZoomer::zoomRectIndex ( ) const

返回缩放堆栈当前位置的索引。

◆ zoomStack()

const QStack< QRectF > & QwtPlotAxisZoomer::zoomStack ( ) const

返回缩放堆栈。


该类的文档由以下文件生成: