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

QwtPlotCachePanner provides panning of a plot canvas 更多...

#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
 
 ~QwtPlotCachePanner () override
 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)
 Creates a panner that is enabled for the left mouse button
 
void setEnabled (bool)
 En/disable the panner
 
bool isEnabled () const
 Return whether the panner is enabled
 
void setMouseButton (Qt::MouseButton, Qt::KeyboardModifiers=Qt::NoModifier)
 Change the mouse button and modifiers used for panning
 
void getMouseButton (Qt::MouseButton &button, Qt::KeyboardModifiers &) const
 Get mouse button and modifiers used for panning
 
void setAbortKey (int key, Qt::KeyboardModifiers=Qt::NoModifier)
 Change the abort key
 
void getAbortKey (int &key, Qt::KeyboardModifiers &) const
 Get the abort key and modifiers
 
void setCursor (const QCursor &)
 Change the cursor that is active while panning
 
const QCursor cursor () const
 Return the cursor that is active while panning
 
void setOrientations (Qt::Orientations)
 Set the orientations where panning is enabled
 
Qt::Orientations orientations () const
 Return the orientation where panning is enabled
 
bool isOrientationEnabled (Qt::Orientation) const
 Check if an orientation is enabled
 
virtual bool eventFilter (QObject *, QEvent *) override
 Event filter
 

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
 Paint event
 

额外继承的成员函数

- 信号 继承自 QwtCachePanner
void panned (int dx, int dy)
 Signal emitted when panning is done
 
void moved (int dx, int dy)
 Signal emitted while the widget moved, but panning is not finished
 

详细描述

QwtPlotCachePanner provides panning of a plot canvas

QwtPlotCachePanner is a panner for a plot canvas, that adjusts the scales of the axes after dropping the canvas on its new position.

Together with QwtPlotZoomer and QwtPlotMagnifier powerful ways of navigating on a QwtPlot widget can be implemented easily.

注解
The axes are not updated, while dragging the canvas
参见
QwtPlotZoomer, QwtPlotMagnifier

构造及析构函数说明

◆ QwtPlotCachePanner()

QwtPlotCachePanner::QwtPlotCachePanner ( QWidget *  canvas)
explicit

Constructor

Constructs a panner for the canvas of a QwtPlot

Creates a QwtPlotCachePanner object attached to the given canvas. The panner is enabled for all axes by default.

参数
canvasPlot canvas to pan, also becomes the parent object
参见
setAxisEnabled()

Destructor

Releases all resources held by the panner.

成员函数说明

◆ canvas() [1/2]

QWidget * QwtPlotCachePanner::canvas ( )

Get the canvas widget

Returns the observed plot canvas

返回
Pointer to the canvas widget

◆ canvas() [2/2]

const QWidget * QwtPlotCachePanner::canvas ( ) const

Get the canvas widget (const version)

Returns the observed plot canvas (const version)

返回
Const pointer to the canvas widget

◆ 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

Tests if an axis is enabled for panning

参数
axisIdAxis identifier to test
返回
True if the axis is enabled, false otherwise
参见
setAxisEnabled(), moveCanvas()

◆ moveCanvas

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

Move the canvas by the specified offset

Adjusts the enabled axes according to the pixel offset

Moves the canvas by the specified pixel offset and updates the axis scales accordingly. Only enabled axes are affected.

参数
dxPixel offset in x direction
dyPixel offset in y direction
参见
QwtPanner::panned(), setAxisEnabled()

◆ plot() [1/2]

QwtPlot * QwtPlotCachePanner::plot ( )

Get the plot widget

Returns the plot widget containing the observed canvas

返回
Pointer to the QwtPlot widget, or nullptr if not found

◆ plot() [2/2]

const QwtPlot * QwtPlotCachePanner::plot ( ) const

Get the plot widget (const version)

Returns the plot widget containing the observed canvas (const version)

返回
Const pointer to the QwtPlot widget, or nullptr if not found

◆ setAxisEnabled()

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

Enable or disable an axis for panning

Enables or disables an axis for panning

Axes that are enabled will be synchronized to the result of panning. All other axes will remain unchanged.

参数
axisIdAxis identifier
onTrue to enable, false to disable
参见
isAxisEnabled(), moveCanvas()

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