- bookworm 6.1.4-2
- testing 6.1.4-2
- unstable 6.1.4-2
- experimental 6.2.0-1
QwtPlotRescaler(3) | Qwt User's Guide | QwtPlotRescaler(3) |
NAME¶
QwtPlotRescaler - QwtPlotRescaler takes care of fixed aspect ratios for plot scales.
SYNOPSIS¶
#include <qwt_plot_rescaler.h>
Inherits QObject.
Public Types¶
enum RescalePolicy { Fixed, Expanding,
Fitting }
enum ExpandingDirection { ExpandUp, ExpandDown,
ExpandBoth }
Public Member Functions¶
QwtPlotRescaler (QWidget *canvas, int
referenceAxis=QwtPlot::xBottom,
RescalePolicy=Expanding)
virtual ~QwtPlotRescaler ()
Destructor. void setEnabled (bool)
En/disable the rescaler. bool isEnabled () const
void setRescalePolicy (RescalePolicy)
RescalePolicy rescalePolicy () const
void setExpandingDirection (ExpandingDirection)
void setExpandingDirection (int axis, ExpandingDirection)
ExpandingDirection expandingDirection (int axis) const
void setReferenceAxis (int axis)
int referenceAxis () const
void setAspectRatio (double ratio)
void setAspectRatio (int axis, double ratio)
double aspectRatio (int axis) const
void setIntervalHint (int axis, const QwtInterval &)
QwtInterval intervalHint (int axis) const
QWidget * canvas ()
const QWidget * canvas () const
QwtPlot * plot ()
const QwtPlot * plot () const
virtual bool eventFilter (QObject *, QEvent *)
Event filter for the plot canvas. void rescale () const
Adjust the plot axes scales.
Protected Member Functions¶
virtual void canvasResizeEvent (QResizeEvent *)
virtual void rescale (const QSize &oldSize, const QSize
&newSize) const
virtual QwtInterval expandScale (int axis, const QSize
&oldSize, const QSize &newSize) const
virtual QwtInterval syncScale (int axis, const
QwtInterval &reference, const QSize &size) const
virtual void updateScales (QwtInterval
intervals[QwtPlot::axisCnt]) const
Qt::Orientation orientation (int axis) const
QwtInterval interval (int axis) const
QwtInterval expandInterval (const QwtInterval &,
double width, ExpandingDirection) const
Detailed Description¶
QwtPlotRescaler takes care of fixed aspect ratios for plot scales.
QwtPlotRescaler auto adjusts the axes of a QwtPlot according to fixed aspect ratios.
Member Enumeration Documentation¶
enum QwtPlotRescaler::ExpandingDirection¶
When rescalePolicy() is set to Expanding its direction depends on ExpandingDirection
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.
enum QwtPlotRescaler::RescalePolicy¶
The rescale policy defines how to rescale the reference axis and their depending axes.
See also:
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.
Constructor & Destructor Documentation¶
QwtPlotRescaler::QwtPlotRescaler (QWidget * canvas, int referenceAxis = QwtPlot::xBottom, RescalePolicy policy = Expanding) [explicit]¶
Constructor
Parameters:
referenceAxis Reference axis, see RescalePolicy
policy Rescale policy
See also:
Member Function Documentation¶
double QwtPlotRescaler::aspectRatio (int axis) const¶
Returns:
Parameters:
See also:
QWidget * QwtPlotRescaler::canvas ()¶
Returns:
const QWidget * QwtPlotRescaler::canvas () const¶
Returns:
void QwtPlotRescaler::canvasResizeEvent (QResizeEvent * event) [protected], [virtual]¶
Event handler for resize events of the plot canvas
Parameters:
See also:
QwtPlotRescaler::ExpandingDirection QwtPlotRescaler::expandingDirection (int axis) const¶
Returns:
Parameters:
See also:
QwtInterval QwtPlotRescaler::expandInterval (const QwtInterval & interval, double width, ExpandingDirection direction) const [protected]¶
Expand the interval
Parameters:
width Distance to be added to the interval
direction Direction of the expand operation
Returns:
QwtInterval QwtPlotRescaler::expandScale (int axis, const QSize & oldSize, const QSize & newSize) const [protected], [virtual]¶
Calculate the new scale interval of a plot axis
Parameters:
oldSize Previous size of the canvas
newSize New size of the canvas
Returns:
QwtInterval QwtPlotRescaler::interval (int axis) const [protected]¶
Parameters:
Returns:
QwtInterval QwtPlotRescaler::intervalHint (int axis) const¶
Parameters:
Returns:
See also:
bool QwtPlotRescaler::isEnabled () const¶
Returns:
See also:
Qt::Orientation QwtPlotRescaler::orientation (int axis) const [protected]¶
Returns:
Parameters:
QwtPlot * QwtPlotRescaler::plot ()¶
Returns:
const QwtPlot * QwtPlotRescaler::plot () const¶
Returns:
int QwtPlotRescaler::referenceAxis () const¶
Returns:
See also:
void QwtPlotRescaler::rescale (const QSize & oldSize, const QSize & newSize) const [protected], [virtual]¶
Adjust the plot axes scales
Parameters:
newSize New size of the canvas
QwtPlotRescaler::RescalePolicy QwtPlotRescaler::rescalePolicy () const¶
Returns:
See also:
void QwtPlotRescaler::setAspectRatio (double ratio)¶
Set the aspect ratio between the scale of the reference axis and the other scales. The default ratio is 1.0
Parameters:
See also:
void QwtPlotRescaler::setAspectRatio (int axis, double ratio)¶
Set the aspect ratio between the scale of the reference axis and another scale. The default ratio is 1.0
Parameters:
ratio Aspect ratio
See also:
void QwtPlotRescaler::setEnabled (bool on)¶
En/disable the rescaler. When enabled is true an event filter is installed for the canvas, otherwise the event filter is removed.
Parameters:
See also:
void QwtPlotRescaler::setExpandingDirection (ExpandingDirection direction)¶
Set the direction in which all axis should be expanded
Parameters:
See also:
void QwtPlotRescaler::setExpandingDirection (int axis, ExpandingDirection direction)¶
Set the direction in which an axis should be expanded
Parameters:
direction Direction
See also:
void QwtPlotRescaler::setIntervalHint (int axis, const QwtInterval & interval)¶
Set an interval hint for an axis
In Fitting mode, the hint is used as minimal interval that always needs to be displayed.
Parameters:
interval Axis
See also:
void QwtPlotRescaler::setReferenceAxis (int axis)¶
Set the reference axis ( see RescalePolicy )
Parameters:
See also:
void QwtPlotRescaler::setRescalePolicy (RescalePolicy policy)¶
Change the rescale policy
Parameters:
See also:
QwtInterval QwtPlotRescaler::syncScale (int axis, const QwtInterval & reference, const QSize & size) const [protected], [virtual]¶
Synchronize an axis scale according to the scale of the reference axis
Parameters:
reference Interval of the reference axis
size Size of the canvas
Returns:
void QwtPlotRescaler::updateScales (QwtInterval intervals[QwtPlot::axisCnt]) const [protected], [virtual]¶
Update the axes scales
Parameters:
Author¶
Generated automatically by Doxygen for Qwt User's Guide from the source code.
Wed Jan 2 2019 | Version 6.1.4 |