QwtPlotRescaler takes care of fixed aspect ratios for plot scales.
More...
#include <qwt_plot_rescaler.h>
QwtPlotRescaler takes care of fixed aspect ratios for plot scales.
◆ ExpandingDirection
Expanding directions.
| Enumerator |
|---|
| ExpandUp | The upper limit of the scale is adjusted.
|
| ExpandDown | The lower limit of the scale is adjusted.
|
| ExpandBoth | Both limits of the scale are adjusted.
|
◆ RescalePolicy
Rescale policies.
| Enumerator |
|---|
| Fixed | The interval of the reference axis remains unchanged, when the geometry of the canvas changes. All other axes will be adjusted according to their aspect ratio.
|
| Expanding | The interval of the reference axis will be shrunk/expanded, when the geometry of the canvas changes. All other axes will be adjusted according to their aspect ratio.
The interval, that is represented by one pixel is fixed.
|
| Fitting | The intervals of the axes are calculated, so that all axes include their interval hint.
|
◆ QwtPlotRescaler()
Constructs a rescaler for the given canvas
- Parameters
-
| [in] | canvas | Canvas widget |
| [in] | referenceAxis | Reference axis, see RescalePolicy |
| [in] | policy | Rescale policy |
- See also
- setRescalePolicy(), setReferenceAxis()
◆ ~QwtPlotRescaler()
| QwtPlotRescaler::~QwtPlotRescaler |
( |
| ) |
|
|
virtual |
◆ aspectRatio()
| double QwtPlotRescaler::aspectRatio |
( |
QwtAxisId |
axisId | ) |
const |
Gets the aspect ratio for a specific axis
- Parameters
-
| [in] | axisId | Axis identifier |
- Returns
- Aspect ratio between the specified axis and the reference axis
- See also
- setAspectRatio()
◆ canvas() [1/2]
| QWidget * QwtPlotRescaler::canvas |
( |
| ) |
|
Gets the canvas widget
- Returns
- Canvas widget
◆ canvas() [2/2]
| const QWidget * QwtPlotRescaler::canvas |
( |
| ) |
const |
Gets the canvas widget (const version)
- Returns
- Canvas widget (const)
◆ canvasResizeEvent()
| void QwtPlotRescaler::canvasResizeEvent |
( |
QResizeEvent * |
event | ) |
|
|
protectedvirtual |
Event handler for resize events of the plot canvas.
- Parameters
-
- See also
- rescale()
◆ eventFilter()
| bool QwtPlotRescaler::eventFilter |
( |
QObject * |
object, |
|
|
QEvent * |
event |
|
) |
| |
|
overridevirtual |
Event filter for the plot canvas
Handles resize and polish request events for the canvas.
- Parameters
-
| [in] | object | Object that received the event |
| [in] | event | Event that was received |
- Returns
- false to allow further processing of the event
◆ expandingDirection()
Gets the expanding direction for a specific axis
- Parameters
-
| [in] | axisId | Axis identifier |
- Returns
- Expanding direction for the specified axis
- See also
- setExpandingDirection()
◆ expandInterval()
Expand the interval.
- Parameters
-
| interval | Interval to be expanded |
| width | Distance to be added to the interval |
| direction | Direction of the expand operation |
- Returns
- Expanded interval
◆ expandScale()
| QwtInterval QwtPlotRescaler::expandScale |
( |
QwtAxisId |
axisId, |
|
|
const QSize & |
oldSize, |
|
|
const QSize & |
newSize |
|
) |
| const |
|
protectedvirtual |
Calculate the new scale interval of a plot axis.
- Parameters
-
| axisId | Axis |
| oldSize | Previous size of the canvas |
| newSize | New size of the canvas |
- Returns
- Calculated new interval for the axis
◆ interval()
| QwtInterval QwtPlotRescaler::interval |
( |
QwtAxisId |
axisId | ) |
const |
|
protected |
- Parameters
-
- Returns
- Normalized interval of an axis
◆ intervalHint()
| QwtInterval QwtPlotRescaler::intervalHint |
( |
QwtAxisId |
axisId | ) |
const |
◆ isEnabled()
| bool QwtPlotRescaler::isEnabled |
( |
| ) |
const |
◆ orientation()
| Qt::Orientation QwtPlotRescaler::orientation |
( |
QwtAxisId |
axisId | ) |
const |
|
protected |
- Returns
- Orientation of an axis
- Parameters
-
◆ plot() [1/2]
| QwtPlot * QwtPlotRescaler::plot |
( |
| ) |
|
Gets the plot widget
- Returns
- Plot widget
◆ plot() [2/2]
| const QwtPlot * QwtPlotRescaler::plot |
( |
| ) |
const |
Gets the plot widget (const version)
- Returns
- Plot widget (const)
◆ referenceAxis()
| QwtAxisId QwtPlotRescaler::referenceAxis |
( |
| ) |
const |
◆ rescale() [1/2]
| void QwtPlotRescaler::rescale |
( |
| ) |
const |
Rescales the plot axes
Adjusts the plot axes scales based on the current canvas size.
◆ rescale() [2/2]
| void QwtPlotRescaler::rescale |
( |
const QSize & |
oldSize, |
|
|
const QSize & |
newSize |
|
) |
| const |
|
protectedvirtual |
Adjust the plot axes scales.
- Parameters
-
| oldSize | Previous size of the canvas |
| newSize | New size of the canvas |
◆ rescalePolicy()
◆ setAspectRatio() [1/2]
| void QwtPlotRescaler::setAspectRatio |
( |
double |
ratio | ) |
|
Sets the aspect ratio for all axes
Sets the aspect ratio between the scale of the reference axis and other scales. The default ratio is 1.0.
- Parameters
-
- See also
- aspectRatio()
◆ setAspectRatio() [2/2]
| void QwtPlotRescaler::setAspectRatio |
( |
QwtAxisId |
axisId, |
|
|
double |
ratio |
|
) |
| |
Sets the aspect ratio for a specific axis
Sets the aspect ratio between the scale of the reference axis and another scale. The default ratio is 1.0.
- Parameters
-
| [in] | axisId | Axis identifier |
| [in] | ratio | Aspect ratio |
- See also
- aspectRatio()
◆ setEnabled()
| void QwtPlotRescaler::setEnabled |
( |
bool |
on | ) |
|
Enables or disables the rescaler
When enabled is true, an event filter is installed for the canvas, otherwise the event filter is removed.
- Parameters
-
| [in] | on | true to enable, false to disable |
- See also
- isEnabled(), eventFilter()
◆ setExpandingDirection() [1/2]
Sets the expanding direction for all axes
- Parameters
-
| [in] | direction | Expanding direction |
- See also
- expandingDirection()
◆ setExpandingDirection() [2/2]
| void QwtPlotRescaler::setExpandingDirection |
( |
QwtAxisId |
axisId, |
|
|
ExpandingDirection |
direction |
|
) |
| |
Sets the expanding direction for a specific axis
- Parameters
-
| [in] | axisId | Axis identifier |
| [in] | direction | Expanding direction |
- See also
- expandingDirection()
◆ setIntervalHint()
| void QwtPlotRescaler::setIntervalHint |
( |
QwtAxisId |
axisId, |
|
|
const QwtInterval & |
interval |
|
) |
| |
Sets an interval hint for an axis
In Fitting mode, the hint is used as the minimal interval that always needs to be displayed.
- Parameters
-
| [in] | axisId | Axis identifier |
| [in] | interval | Interval hint |
- See also
- intervalHint(), RescalePolicy
◆ setReferenceAxis()
| void QwtPlotRescaler::setReferenceAxis |
( |
QwtAxisId |
axisId | ) |
|
Sets the reference axis
The reference axis is used as the basis for rescale calculations.
- Parameters
-
| [in] | axisId | Axis identifier |
- See also
- referenceAxis()
◆ setRescalePolicy()
◆ syncScale()
| QwtInterval QwtPlotRescaler::syncScale |
( |
QwtAxisId |
axisId, |
|
|
const QwtInterval & |
reference, |
|
|
const QSize & |
size |
|
) |
| const |
|
protectedvirtual |
Synchronize an axis scale according to the scale of the reference axis.
- Parameters
-
| axisId | Axis |
| reference | Interval of the reference axis |
| size | Size of the canvas |
- Returns
- New interval for axis
◆ updateScales()
| void QwtPlotRescaler::updateScales |
( |
QwtInterval |
intervals[QwtAxis::AxisPositions] | ) |
const |
|
protectedvirtual |
Update the axes scales.
- Parameters
-
The documentation for this class was generated from the following files:
- /home/runner/work/QWT/QWT/src/plot/qwt_plot_rescaler.h
- /home/runner/work/QWT/QWT/src/plot/qwt_plot_rescaler.cpp