.TH "QwtPlotRescaler" 3 "Sun Jul 18 2021" "Version 6.2.0" "Qwt User's Guide" \" -*- nroff -*- .ad l .nh .SH NAME QwtPlotRescaler \- \fBQwtPlotRescaler\fP takes care of fixed aspect ratios for plot scales\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits QObject\&. .SS "Public Types" .in +1c .ti -1c .RI "enum \fBRescalePolicy\fP { \fBFixed\fP, \fBExpanding\fP, \fBFitting\fP }" .br .ti -1c .RI "enum \fBExpandingDirection\fP { \fBExpandUp\fP, \fBExpandDown\fP, \fBExpandBoth\fP }" .br .in -1c .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBQwtPlotRescaler\fP (QWidget *\fBcanvas\fP, QwtAxisId \fBreferenceAxis\fP=\fBQwtAxis::XBottom\fP, \fBRescalePolicy\fP=\fBExpanding\fP)" .br .ti -1c .RI "virtual \fB~QwtPlotRescaler\fP ()" .br .RI "Destructor\&. " .ti -1c .RI "void \fBsetEnabled\fP (bool)" .br .RI "En/disable the rescaler\&. " .ti -1c .RI "bool \fBisEnabled\fP () const" .br .ti -1c .RI "void \fBsetRescalePolicy\fP (\fBRescalePolicy\fP)" .br .ti -1c .RI "\fBRescalePolicy\fP \fBrescalePolicy\fP () const" .br .ti -1c .RI "void \fBsetExpandingDirection\fP (\fBExpandingDirection\fP)" .br .ti -1c .RI "void \fBsetExpandingDirection\fP (QwtAxisId, \fBExpandingDirection\fP)" .br .ti -1c .RI "\fBExpandingDirection\fP \fBexpandingDirection\fP (QwtAxisId) const" .br .ti -1c .RI "void \fBsetReferenceAxis\fP (QwtAxisId)" .br .ti -1c .RI "QwtAxisId \fBreferenceAxis\fP () const" .br .ti -1c .RI "void \fBsetAspectRatio\fP (double ratio)" .br .ti -1c .RI "void \fBsetAspectRatio\fP (QwtAxisId, double ratio)" .br .ti -1c .RI "double \fBaspectRatio\fP (QwtAxisId) const" .br .ti -1c .RI "void \fBsetIntervalHint\fP (QwtAxisId, const \fBQwtInterval\fP &)" .br .ti -1c .RI "\fBQwtInterval\fP \fBintervalHint\fP (QwtAxisId) const" .br .ti -1c .RI "QWidget * \fBcanvas\fP ()" .br .ti -1c .RI "const QWidget * \fBcanvas\fP () const" .br .ti -1c .RI "\fBQwtPlot\fP * \fBplot\fP ()" .br .ti -1c .RI "const \fBQwtPlot\fP * \fBplot\fP () const" .br .ti -1c .RI "virtual bool \fBeventFilter\fP (QObject *, QEvent *) override" .br .RI "Event filter for the plot canvas\&. " .ti -1c .RI "void \fBrescale\fP () const" .br .RI "Adjust the plot axes scales\&. " .in -1c .SS "Protected Member Functions" .in +1c .ti -1c .RI "virtual void \fBcanvasResizeEvent\fP (QResizeEvent *)" .br .ti -1c .RI "virtual void \fBrescale\fP (const QSize &oldSize, const QSize &newSize) const" .br .ti -1c .RI "virtual \fBQwtInterval\fP \fBexpandScale\fP (QwtAxisId, const QSize &oldSize, const QSize &newSize) const" .br .ti -1c .RI "virtual \fBQwtInterval\fP \fBsyncScale\fP (QwtAxisId, const \fBQwtInterval\fP &reference, const QSize &size) const" .br .ti -1c .RI "virtual void \fBupdateScales\fP (\fBQwtInterval\fP intervals[QwtAxis::AxisPositions]) const" .br .ti -1c .RI "Qt::Orientation \fBorientation\fP (QwtAxisId) const" .br .ti -1c .RI "\fBQwtInterval\fP \fBinterval\fP (QwtAxisId) const" .br .ti -1c .RI "\fBQwtInterval\fP \fBexpandInterval\fP (const \fBQwtInterval\fP &, double width, \fBExpandingDirection\fP) const" .br .in -1c .SH "Detailed Description" .PP \fBQwtPlotRescaler\fP takes care of fixed aspect ratios for plot scales\&. \fBQwtPlotRescaler\fP auto adjusts the axes of a \fBQwtPlot\fP according to fixed aspect ratios\&. .PP Definition at line 29 of file qwt_plot_rescaler\&.h\&. .SH "Member Enumeration Documentation" .PP .SS "enum \fBQwtPlotRescaler::ExpandingDirection\fP" When \fBrescalePolicy()\fP is set to Expanding its direction depends on ExpandingDirection .PP \fBEnumerator\fP .in +1c .TP \fB\fIExpandUp \fP\fP The upper limit of the scale is adjusted\&. .TP \fB\fIExpandDown \fP\fP The lower limit of the scale is adjusted\&. .TP \fB\fIExpandBoth \fP\fP Both limits of the scale are adjusted\&. .PP Definition at line 70 of file qwt_plot_rescaler\&.h\&. .SS "enum \fBQwtPlotRescaler::RescalePolicy\fP" The rescale policy defines how to rescale the reference axis and their depending axes\&. .PP \fBSee also\fP .RS 4 \fBExpandingDirection\fP, \fBsetIntervalHint()\fP .RE .PP .PP \fBEnumerator\fP .in +1c .TP \fB\fIFixed \fP\fP 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\&. .TP \fB\fIExpanding \fP\fP 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\&. .PP The interval, that is represented by one pixel is fixed\&. .TP \fB\fIFitting \fP\fP The intervals of the axes are calculated, so that all axes include their interval hint\&. .PP Definition at line 40 of file qwt_plot_rescaler\&.h\&. .SH "Constructor & Destructor Documentation" .PP .SS "QwtPlotRescaler::QwtPlotRescaler (QWidget * canvas, QwtAxisId referenceAxis = \fC\fBQwtAxis::XBottom\fP\fP, \fBRescalePolicy\fP policy = \fC\fBExpanding\fP\fP)\fC [explicit]\fP" Constructor .PP \fBParameters\fP .RS 4 \fIcanvas\fP Canvas .br \fIreferenceAxis\fP Reference axis, see RescalePolicy .br \fIpolicy\fP Rescale policy .RE .PP \fBSee also\fP .RS 4 \fBsetRescalePolicy()\fP, \fBsetReferenceAxis()\fP .RE .PP .PP Definition at line 71 of file qwt_plot_rescaler\&.cpp\&. .SH "Member Function Documentation" .PP .SS "double QwtPlotRescaler::aspectRatio (QwtAxisId axisId) const" .PP \fBReturns\fP .RS 4 Aspect ratio between an axis and the reference axis\&. .RE .PP \fBParameters\fP .RS 4 \fIaxisId\fP Axis .RE .PP \fBSee also\fP .RS 4 \fBsetAspectRatio()\fP .RE .PP .PP Definition at line 243 of file qwt_plot_rescaler\&.cpp\&. .SS "QWidget * QwtPlotRescaler::canvas ()" .PP \fBReturns\fP .RS 4 plot canvas .RE .PP .PP Definition at line 282 of file qwt_plot_rescaler\&.cpp\&. .SS "const QWidget * QwtPlotRescaler::canvas () const" .PP \fBReturns\fP .RS 4 plot canvas .RE .PP .PP Definition at line 288 of file qwt_plot_rescaler\&.cpp\&. .SS "void QwtPlotRescaler::canvasResizeEvent (QResizeEvent * event)\fC [protected]\fP, \fC [virtual]\fP" Event handler for resize events of the plot canvas .PP \fBParameters\fP .RS 4 \fIevent\fP Resize event .RE .PP \fBSee also\fP .RS 4 \fBrescale()\fP .RE .PP .PP Definition at line 343 of file qwt_plot_rescaler\&.cpp\&. .SS "\fBQwtPlotRescaler::ExpandingDirection\fP QwtPlotRescaler::expandingDirection (QwtAxisId axisId) const" .PP \fBReturns\fP .RS 4 Direction in which an axis should be expanded .RE .PP \fBParameters\fP .RS 4 \fIaxisId\fP Axis .RE .PP \fBSee also\fP .RS 4 \fBsetExpandingDirection()\fP .RE .PP .PP Definition at line 197 of file qwt_plot_rescaler\&.cpp\&. .SS "\fBQwtInterval\fP QwtPlotRescaler::expandInterval (const \fBQwtInterval\fP & interval, double width, \fBExpandingDirection\fP direction) const\fC [protected]\fP" Expand the interval .PP \fBParameters\fP .RS 4 \fIinterval\fP Interval to be expanded .br \fIwidth\fP Distance to be added to the interval .br \fIdirection\fP Direction of the expand operation .RE .PP \fBReturns\fP .RS 4 Expanded interval .RE .PP .PP Definition at line 526 of file qwt_plot_rescaler\&.cpp\&. .SS "\fBQwtInterval\fP QwtPlotRescaler::expandScale (QwtAxisId axisId, const QSize & oldSize, const QSize & newSize) const\fC [protected]\fP, \fC [virtual]\fP" Calculate the new scale interval of a plot axis .PP \fBParameters\fP .RS 4 \fIaxisId\fP Axis .br \fIoldSize\fP Previous size of the canvas .br \fInewSize\fP New size of the canvas .RE .PP \fBReturns\fP .RS 4 Calculated new interval for the axis .RE .PP .PP Definition at line 405 of file qwt_plot_rescaler\&.cpp\&. .SS "\fBQwtInterval\fP QwtPlotRescaler::interval (QwtAxisId axisId) const\fC [protected]\fP" .PP \fBParameters\fP .RS 4 \fIaxisId\fP Axis .RE .PP \fBReturns\fP .RS 4 Normalized interval of an axis .RE .PP .PP Definition at line 509 of file qwt_plot_rescaler\&.cpp\&. .SS "\fBQwtInterval\fP QwtPlotRescaler::intervalHint (QwtAxisId axisId) const" .PP \fBParameters\fP .RS 4 \fIaxisId\fP Axis .RE .PP \fBReturns\fP .RS 4 Interval hint .RE .PP \fBSee also\fP .RS 4 \fBsetIntervalHint()\fP, \fBRescalePolicy\fP .RE .PP .PP Definition at line 273 of file qwt_plot_rescaler\&.cpp\&. .SS "bool QwtPlotRescaler::isEnabled () const" .PP \fBReturns\fP .RS 4 true when enabled, false otherwise .RE .PP \fBSee also\fP .RS 4 \fBsetEnabled\fP, \fBeventFilter()\fP .RE .PP .PP Definition at line 118 of file qwt_plot_rescaler\&.cpp\&. .SS "Qt::Orientation QwtPlotRescaler::orientation (QwtAxisId axisId) const\fC [protected]\fP" .PP \fBReturns\fP .RS 4 Orientation of an axis .RE .PP \fBParameters\fP .RS 4 \fIaxisId\fP Axis .RE .PP .PP Definition at line 500 of file qwt_plot_rescaler\&.cpp\&. .SS "\fBQwtPlot\fP * QwtPlotRescaler::plot ()" .PP \fBReturns\fP .RS 4 plot widget .RE .PP .PP Definition at line 294 of file qwt_plot_rescaler\&.cpp\&. .SS "const \fBQwtPlot\fP * QwtPlotRescaler::plot () const" .PP \fBReturns\fP .RS 4 plot widget .RE .PP .PP Definition at line 304 of file qwt_plot_rescaler\&.cpp\&. .SS "QwtAxisId QwtPlotRescaler::referenceAxis () const" .PP \fBReturns\fP .RS 4 Reference axis ( see RescalePolicy ) .RE .PP \fBSee also\fP .RS 4 \fBsetReferenceAxis()\fP .RE .PP .PP Definition at line 158 of file qwt_plot_rescaler\&.cpp\&. .SS "void QwtPlotRescaler::rescale (const QSize & oldSize, const QSize & newSize) const\fC [protected]\fP, \fC [virtual]\fP" Adjust the plot axes scales .PP \fBParameters\fP .RS 4 \fIoldSize\fP Previous size of the canvas .br \fInewSize\fP New size of the canvas .RE .PP .PP Definition at line 367 of file qwt_plot_rescaler\&.cpp\&. .SS "\fBQwtPlotRescaler::RescalePolicy\fP QwtPlotRescaler::rescalePolicy () const" .PP \fBReturns\fP .RS 4 Rescale policy .RE .PP \fBSee also\fP .RS 4 \fBsetRescalePolicy()\fP .RE .PP .PP Definition at line 138 of file qwt_plot_rescaler\&.cpp\&. .SS "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 .PP \fBParameters\fP .RS 4 \fIratio\fP Aspect ratio .RE .PP \fBSee also\fP .RS 4 \fBaspectRatio()\fP .RE .PP .PP Definition at line 212 of file qwt_plot_rescaler\&.cpp\&. .SS "void QwtPlotRescaler::setAspectRatio (QwtAxisId axisId, double ratio)" Set the aspect ratio between the scale of the reference axis and another scale\&. The default ratio is 1\&.0 .PP \fBParameters\fP .RS 4 \fIaxisId\fP Axis .br \fIratio\fP Aspect ratio .RE .PP \fBSee also\fP .RS 4 \fBaspectRatio()\fP .RE .PP .PP Definition at line 226 of file qwt_plot_rescaler\&.cpp\&. .SS "void QwtPlotRescaler::setEnabled (bool on)" .PP En/disable the rescaler\&. When enabled is true an event filter is installed for the canvas, otherwise the event filter is removed\&. .PP \fBParameters\fP .RS 4 \fIon\fP true or false .RE .PP \fBSee also\fP .RS 4 \fBisEnabled()\fP, \fBeventFilter()\fP .RE .PP .PP Definition at line 97 of file qwt_plot_rescaler\&.cpp\&. .SS "void QwtPlotRescaler::setExpandingDirection (\fBExpandingDirection\fP direction)" Set the direction in which all axis should be expanded .PP \fBParameters\fP .RS 4 \fIdirection\fP Direction .RE .PP \fBSee also\fP .RS 4 \fBexpandingDirection()\fP .RE .PP .PP Definition at line 169 of file qwt_plot_rescaler\&.cpp\&. .SS "void QwtPlotRescaler::setExpandingDirection (QwtAxisId axisId, \fBExpandingDirection\fP direction)" Set the direction in which an axis should be expanded .PP \fBParameters\fP .RS 4 \fIaxisId\fP Axis .br \fIdirection\fP Direction .RE .PP \fBSee also\fP .RS 4 \fBexpandingDirection()\fP .RE .PP .PP Definition at line 183 of file qwt_plot_rescaler\&.cpp\&. .SS "void QwtPlotRescaler::setIntervalHint (QwtAxisId axisId, const \fBQwtInterval\fP & interval)" Set an interval hint for an axis .PP In Fitting mode, the hint is used as minimal interval that always needs to be displayed\&. .PP \fBParameters\fP .RS 4 \fIaxisId\fP Axis .br \fIinterval\fP Axis .RE .PP \fBSee also\fP .RS 4 \fBintervalHint()\fP, \fBRescalePolicy\fP .RE .PP .PP Definition at line 261 of file qwt_plot_rescaler\&.cpp\&. .SS "void QwtPlotRescaler::setReferenceAxis (QwtAxisId axisId)" Set the reference axis ( see RescalePolicy ) .PP \fBParameters\fP .RS 4 \fIaxisId\fP Axis .RE .PP \fBSee also\fP .RS 4 \fBreferenceAxis()\fP .RE .PP .PP Definition at line 149 of file qwt_plot_rescaler\&.cpp\&. .SS "void QwtPlotRescaler::setRescalePolicy (\fBRescalePolicy\fP policy)" Change the rescale policy .PP \fBParameters\fP .RS 4 \fIpolicy\fP Rescale policy .RE .PP \fBSee also\fP .RS 4 \fBrescalePolicy()\fP .RE .PP .PP Definition at line 129 of file qwt_plot_rescaler\&.cpp\&. .SS "\fBQwtInterval\fP QwtPlotRescaler::syncScale (QwtAxisId axisId, const \fBQwtInterval\fP & reference, const QSize & size) const\fC [protected]\fP, \fC [virtual]\fP" Synchronize an axis scale according to the scale of the reference axis .PP \fBParameters\fP .RS 4 \fIaxisId\fP Axis .br \fIreference\fP Interval of the reference axis .br \fIsize\fP Size of the canvas .RE .PP \fBReturns\fP .RS 4 New interval for axis .RE .PP .PP Definition at line 469 of file qwt_plot_rescaler\&.cpp\&. .SS "void QwtPlotRescaler::updateScales (\fBQwtInterval\fP intervals[QwtAxis::AxisPositions]) const\fC [protected]\fP, \fC [virtual]\fP" Update the axes scales .PP \fBParameters\fP .RS 4 \fIintervals\fP Scale intervals .RE .PP .PP Definition at line 588 of file qwt_plot_rescaler\&.cpp\&. .SH "Author" .PP Generated automatically by Doxygen for Qwt User's Guide from the source code\&.