|
QWT API (中文) 7.3.0
Qt绘图库 - 中文API文档
|
QwtPlotMagnifier provides zooming, by magnifying in steps 更多...
#include <qwt_plot_magnifier.h>
类 | |
| 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) | |
| QwtPlot * | plot () |
| Return the plot widget containing the observed canvas | |
| const QwtPlot * | plot () 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.
|
explicit |
Constructor
| canvas | Plot canvas to be magnified |
Creates a magnifier attached to the given plot canvas. All axes are enabled by default.
Destructor
| QWidget * QwtPlotMagnifier::canvas | ( | ) |
Return the observed plot canvas
| const QWidget * QwtPlotMagnifier::canvas | ( | ) | const |
Return the observed plot canvas (const version)
| bool QwtPlotMagnifier::isAxisEnabled | ( | QwtAxisId | axisId | ) | const |
Check if an axis is enabled for magnification
| axisId | Axis identifier |
| QwtPlot * QwtPlotMagnifier::plot | ( | ) |
Return the plot widget containing the observed canvas
| const QwtPlot * QwtPlotMagnifier::plot | ( | ) | const |
Return the plot widget containing the observed canvas (const version)
|
overridevirtualslot |
Rescale the plot axes by the given factor
| factor | Magnification 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.
| void QwtPlotMagnifier::setAxisEnabled | ( | QwtAxisId | axisId, |
| bool | on | ||
| ) |
Enable or disable an axis for magnification
| axisId | Axis identifier |
| on | true 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.