|
QWT API (中文) 7.3.0
Qt绘图库 - 中文API文档
|
QwtPlotCachePanner provides panning of a plot canvas 更多...
#include <qwt_plot_cache_panner.h>
类 | |
| 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) | |
| QwtPlot * | plot () |
| Get the plot widget | |
| const QwtPlot * | plot () 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.
|
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.
| canvas | Plot canvas to pan, also becomes the parent object |
Destructor
Releases all resources held by the panner.
| QWidget * QwtPlotCachePanner::canvas | ( | ) |
Get the canvas widget
Returns the observed plot canvas
| const QWidget * QwtPlotCachePanner::canvas | ( | ) | const |
Get the canvas widget (const version)
Returns the observed plot canvas (const version)
|
overrideprotectedvirtual |
Get the contents mask
Calculate a mask from the border path of the canvas
重载 QwtCachePanner .
|
overrideprotectedvirtual |
| bool QwtPlotCachePanner::isAxisEnabled | ( | QwtAxisId | axisId | ) | const |
Check if an axis is enabled for panning
Tests if an axis is enabled for panning
| axisId | Axis identifier to test |
|
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.
| dx | Pixel offset in x direction |
| dy | Pixel offset in y direction |
| QwtPlot * QwtPlotCachePanner::plot | ( | ) |
Get the plot widget
Returns the plot widget containing the observed canvas
| const QwtPlot * QwtPlotCachePanner::plot | ( | ) | const |
Get the plot widget (const version)
Returns the plot widget containing the observed canvas (const version)
| 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.
| axisId | Axis identifier |
| on | True to enable, false to disable |