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

QwtPlotMagnifier provides zooming, by magnifying in steps 更多...

#include <qwt_plot_magnifier.h>

类 QwtPlotMagnifier 继承关系图:
QwtMagnifier

class  PrivateData
 

Public 槽

virtual void rescale (double factor) override
 Rescale the plot axes by the given factor
 

Public 成员函数

 QwtPlotMagnifier (QWidget *)
 Constructor
 
void setAxisEnabled (QwtAxisId, bool on)
 Enable or disable an axis for magnification
 
bool isAxisEnabled (QwtAxisId) const
 Check if an axis is enabled for magnification
 
QWidget * canvas ()
 Return the observed plot canvas
 
const QWidget * canvas () const
 Return the observed plot canvas (const version)
 
QwtPlotplot ()
 Return the plot widget containing the observed canvas
 
const QwtPlotplot () const
 Return the plot widget containing the observed canvas (const version)
 
- Public 成员函数 继承自 QwtMagnifier
 QwtMagnifier (QWidget *)
 Constructor
 
QWidget * parentWidget ()
 Return the parent widget where the rescaling happens
 
const QWidget * parentWidget () const
 Return the parent widget where the rescaling happens
 
void setEnabled (bool)
 En/disable the magnifier
 
bool isEnabled () const
 Return whether the magnifier is enabled
 
void setMouseFactor (double)
 Change the mouse factor
 
double mouseFactor () const
 Return the mouse factor
 
void setMouseButton (Qt::MouseButton, Qt::KeyboardModifiers=Qt::NoModifier)
 Assign the mouse button that is used for zooming in/out
 
void getMouseButton (Qt::MouseButton &, Qt::KeyboardModifiers &) const
 Get the mouse button and modifiers used for zooming
 
void setWheelFactor (double)
 Change the wheel factor
 
double wheelFactor () const
 Return the wheel factor
 
void setWheelModifiers (Qt::KeyboardModifiers)
 Assign keyboard modifiers for zooming in/out using the wheel
 
Qt::KeyboardModifiers wheelModifiers () const
 Return the wheel modifiers
 
void setKeyFactor (double)
 Change the key factor
 
double keyFactor () const
 Return the key factor
 
void setZoomInKey (int key, Qt::KeyboardModifiers=Qt::NoModifier)
 Assign the key that is used for zooming in
 
void getZoomInKey (int &key, Qt::KeyboardModifiers &) const
 Retrieve the settings of the zoom in key
 
void setZoomOutKey (int key, Qt::KeyboardModifiers=Qt::NoModifier)
 Assign the key that is used for zooming out
 
void getZoomOutKey (int &key, Qt::KeyboardModifiers &) const
 Retrieve the settings of the zoom out key
 
virtual bool eventFilter (QObject *, QEvent *) override
 Event filter
 

额外继承的成员函数

- Protected 成员函数 继承自 QwtMagnifier
virtual void rescale (double factor)=0
 
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 widgetWheelEvent (QWheelEvent *)
 Handle a wheel 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.
 

详细描述

QwtPlotMagnifier provides zooming, by magnifying in steps

Using QwtPlotMagnifier a plot can be zoomed in/out in steps using keys, the mouse wheel or moving a mouse button in vertical direction.

Together with QwtPlotZoomer and QwtPlotPanner it is possible to implement individual and powerful navigation of the plot canvas.

参见
QwtPlotZoomer, QwtPlotPanner, QwtPlot

构造及析构函数说明

◆ QwtPlotMagnifier()

QwtPlotMagnifier::QwtPlotMagnifier ( QWidget *  canvas)
explicit

Constructor

参数
canvasPlot canvas to be magnified

Creates a magnifier attached to the given plot canvas. All axes are enabled by default.

Destructor

成员函数说明

◆ canvas() [1/2]

QWidget * QwtPlotMagnifier::canvas ( )

Return the observed plot canvas

返回
Pointer to the canvas widget

◆ canvas() [2/2]

const QWidget * QwtPlotMagnifier::canvas ( ) const

Return the observed plot canvas (const version)

返回
Const pointer to the canvas widget

◆ isAxisEnabled()

bool QwtPlotMagnifier::isAxisEnabled ( QwtAxisId  axisId) const

Check if an axis is enabled for magnification

参数
axisIdAxis identifier
返回
true if the axis is enabled, false otherwise
参见
setAxisEnabled()

◆ plot() [1/2]

QwtPlot * QwtPlotMagnifier::plot ( )

Return the plot widget containing the observed canvas

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

◆ plot() [2/2]

const QwtPlot * QwtPlotMagnifier::plot ( ) const

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

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

◆ rescale

void QwtPlotMagnifier::rescale ( double  factor)
overridevirtualslot

Rescale the plot axes by the given factor

参数
factorMagnification factor. A value < 1.0 zooms in, a value > 1.0 zooms out.

This method zooms in/out the axes scales by applying the given factor to all enabled axes. The zoom is centered around the current viewport center.

For parasite plots, this method does nothing.

The method handles all plots in the plot list, including parasite plots that share the same canvas area.

◆ setAxisEnabled()

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

Enable or disable an axis for magnification

参数
axisIdAxis identifier
ontrue to enable, false to disable

Only axes that are enabled will be zoomed when the magnifier is triggered. All other axes will remain unchanged.

All axes are enabled by default.

参见
isAxisEnabled()

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