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

QwtPlotCachePanner 提供绘图画布的平移功能 更多...

#include <qwt_plot_cache_panner.h>

类 QwtPlotCachePanner 继承关系图:
QwtCachePanner

class  PrivateData
 

Public 槽

virtual void moveCanvas (int dx, int dy)
 Move the canvas by the specified offset
 

Public 成员函数

 QwtPlotCachePanner (QWidget *)
 Constructor
 
virtual ~QwtPlotCachePanner ()
 Destructor
 
QWidget * canvas ()
 Get the canvas widget
 
const QWidget * canvas () const
 Get the canvas widget (const version)
 
QwtPlotplot ()
 Get the plot widget
 
const QwtPlotplot () const
 Get the plot widget (const version)
 
void setAxisEnabled (QwtAxisId axisId, bool on)
 Enable or disable an axis for panning
 
bool isAxisEnabled (QwtAxisId) const
 Check if an axis is enabled for panning
 
- Public 成员函数 继承自 QwtCachePanner
 QwtCachePanner (QWidget *parent)
 创建一个启用左键鼠标按钮的平移器
 
virtual ~QwtCachePanner ()
 析构函数
 
void setEnabled (bool)
 启用/禁用平移器
 
bool isEnabled () const
 返回平移器是否启用
 
void setMouseButton (Qt::MouseButton, Qt::KeyboardModifiers=Qt::NoModifier)
 更改用于平移的鼠标按钮和修饰键
 
void getMouseButton (Qt::MouseButton &button, Qt::KeyboardModifiers &) const
 获取用于平移的鼠标按钮和修饰键
 
void setAbortKey (int key, Qt::KeyboardModifiers=Qt::NoModifier)
 更改中止键
 
void getAbortKey (int &key, Qt::KeyboardModifiers &) const
 获取中止键和修饰键
 
void setCursor (const QCursor &)
 更改平移时激活的光标
 
const QCursor cursor () const
 返回平移时激活的光标
 
void setOrientations (Qt::Orientations)
 设置启用平移的方向
 
Qt::Orientations orientations () const
 返回启用平移的方向
 
bool isOrientationEnabled (Qt::Orientation) const
 检查某个方向是否启用
 
virtual bool eventFilter (QObject *, QEvent *) override
 事件过滤器
 

Protected 成员函数

virtual QBitmap contentsMask () const override
 Get the contents mask
 
virtual QPixmap grab () const override
 Grab the canvas
 
- Protected 成员函数 继承自 QwtCachePanner
virtual void widgetMousePressEvent (QMouseEvent *)
 Handle a mouse press event for the observed widget.
 
virtual void widgetMouseReleaseEvent (QMouseEvent *)
 Handle a mouse release event for the observed widget.
 
virtual void widgetMouseMoveEvent (QMouseEvent *)
 Handle a mouse move event for the observed widget.
 
virtual void widgetKeyPressEvent (QKeyEvent *)
 Handle a key press event for the observed widget.
 
virtual void widgetKeyReleaseEvent (QKeyEvent *)
 Handle a key release event for the observed widget.
 
virtual void paintEvent (QPaintEvent *) override
 绘制事件
 

额外继承的成员函数

- 信号 继承自 QwtCachePanner
void panned (int dx, int dy)
 平移完成时发出的信号
 
void moved (int dx, int dy)
 控件移动但平移未完成时发出的信号
 

详细描述

QwtPlotCachePanner 提供绘图画布的平移功能

构造及析构函数说明

◆ QwtPlotCachePanner()

QwtPlotCachePanner::QwtPlotCachePanner ( QWidget *  canvas)
explicit

Constructor

构造绑定为绘图部件画布的平移器

创建一个绑定到指定画布的 QwtPlotCachePanner 对象。 默认情况下,所有坐标轴都启用平移功能。

参数
canvas要平移的绘图画布,同时作为父对象
参见
setAxisEnabled()

◆ ~QwtPlotCachePanner()

QwtPlotCachePanner::~QwtPlotCachePanner ( )
virtual

Destructor

析构函数

释放平移器持有的所有资源。

成员函数说明

◆ canvas() [1/2]

QWidget * QwtPlotCachePanner::canvas ( )

Get the canvas widget

返回被观察的绘图画布

返回
画布部件的指针

◆ canvas() [2/2]

const QWidget * QwtPlotCachePanner::canvas ( ) const

Get the canvas widget (const version)

返回被观察的绘图画布(常量版本)

返回
画布部件的常量指针

◆ contentsMask()

QBitmap QwtPlotCachePanner::contentsMask ( ) const
overrideprotectedvirtual

Get the contents mask

Calculate a mask from the border path of the canvas

返回
Mask as bitmap
参见
QwtPlotCanvas::borderPath()

重载 QwtCachePanner .

◆ grab()

QPixmap QwtPlotCachePanner::grab ( ) const
overrideprotectedvirtual

Grab the canvas

返回
Pixmap with the content of the canvas

重载 QwtCachePanner .

◆ isAxisEnabled()

bool QwtPlotCachePanner::isAxisEnabled ( QwtAxisId  axisId) const

Check if an axis is enabled for panning

测试坐标轴是否启用平移功能

参数
axisId要测试的坐标轴标识符
返回
如果坐标轴已启用则返回 true,否则返回 false
参见
setAxisEnabled(), moveCanvas()

◆ moveCanvas

void QwtPlotCachePanner::moveCanvas ( int  dx,
int  dy 
)
virtualslot

Move the canvas by the specified offset

根据像素偏移量调整已启用的坐标轴

按指定的像素偏移量移动画布,并相应地更新坐标轴比例尺。 只有已启用的坐标轴会受到影响。

参数
dxX 方向的像素偏移量
dyY 方向的像素偏移量
参见
QwtPanner::panned(), setAxisEnabled()

◆ plot() [1/2]

QwtPlot * QwtPlotCachePanner::plot ( )

Get the plot widget

返回包含被观察画布的绘图部件

返回
QwtPlot 部件的指针,如果未找到则返回 nullptr

◆ plot() [2/2]

const QwtPlot * QwtPlotCachePanner::plot ( ) const

Get the plot widget (const version)

返回包含被观察画布的绘图部件(常量版本)

返回
QwtPlot 部件的常量指针,如果未找到则返回 nullptr

◆ setAxisEnabled()

void QwtPlotCachePanner::setAxisEnabled ( QwtAxisId  axisId,
bool  on 
)

Enable or disable an axis for panning

启用或禁用坐标轴的平移功能

启用的坐标轴会在平移操作后同步更新, 其他未启用的坐标轴将保持不变。

参数
axisId坐标轴标识符
ontrue 为启用,false 为禁用
参见
isAxisEnabled(), moveCanvas()

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