.TH "QwtPlotScaleItem" 3 "Tue Nov 20 2012" "Version 5.2.3" "Qwt User's Guide" \" -*- nroff -*- .ad l .nh .SH NAME QwtPlotScaleItem \- .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits \fBQwtPlotItem\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBQwtPlotScaleItem\fP (\fBQwtScaleDraw::Alignment\fP=QwtScaleDraw::BottomScale, const double pos=0\&.0)" .br .ti -1c .RI "virtual \fB~QwtPlotScaleItem\fP ()" .br .ti -1c .RI "int \fBborderDistance\fP () const " .br .ti -1c .RI "virtual void \fBdraw\fP (QPainter *p, const \fBQwtScaleMap\fP &xMap, const \fBQwtScaleMap\fP &yMap, const QRect &rect) const " .br .ti -1c .RI "QFont \fBfont\fP () const " .br .ti -1c .RI "bool \fBisScaleDivFromAxis\fP () const " .br .ti -1c .RI "QPalette \fBpalette\fP () const " .br .ti -1c .RI "double \fBposition\fP () const " .br .ti -1c .RI "virtual int \fBrtti\fP () const " .br .ti -1c .RI "const \fBQwtScaleDiv\fP & \fBscaleDiv\fP () const " .br .ti -1c .RI "const \fBQwtScaleDraw\fP * \fBscaleDraw\fP () const " .br .ti -1c .RI "\fBQwtScaleDraw\fP * \fBscaleDraw\fP ()" .br .ti -1c .RI "void \fBsetAlignment\fP (\fBQwtScaleDraw::Alignment\fP)" .br .ti -1c .RI "void \fBsetBorderDistance\fP (int numPixels)" .br .ti -1c .RI "void \fBsetFont\fP (const QFont &)" .br .ti -1c .RI "void \fBsetPalette\fP (const QPalette &)" .br .ti -1c .RI "void \fBsetPosition\fP (double pos)" .br .ti -1c .RI "void \fBsetScaleDiv\fP (const \fBQwtScaleDiv\fP &)" .br .ti -1c .RI "void \fBsetScaleDivFromAxis\fP (bool on)" .br .ti -1c .RI "void \fBsetScaleDraw\fP (\fBQwtScaleDraw\fP *)" .br .ti -1c .RI "virtual void \fBupdateScaleDiv\fP (const \fBQwtScaleDiv\fP &, const \fBQwtScaleDiv\fP &)" .br .in -1c .SS "Additional Inherited Members" .SH "Detailed Description" .PP A class which draws a scale inside the plot canvas\&. \fBQwtPlotScaleItem\fP can be used to draw an axis inside the plot canvas\&. It might by synchronized to one of the axis of the plot, but can also display its own ticks and labels\&. .PP It is allowed to synchronize the scale item with a disabled axis\&. In plots with vertical and horizontal scale items, it might be necessary to remove ticks at the intersections, by overloading \fBupdateScaleDiv()\fP\&. .PP The scale might be at a specific position (f\&.e 0\&.0) or it might be aligned to a canvas border\&. .PP \fBExample\fP .RS 4 The following example shows how to replace the left axis, by a scale item at the x position 0\&.0\&. .PP .nf QwtPlotScaleItem *scaleItem = new QwtPlotScaleItem(QwtScaleDraw::RightScale, 0.0); scaleItem->setFont(plot->axisWidget(QwtPlot::yLeft)->font()); scaleItem->attach(plot); plot->enableAxis(QwtPlot::yLeft, false); .fi .PP .RE .PP .SH "Constructor & Destructor Documentation" .PP .SS "QwtPlotScaleItem::QwtPlotScaleItem (\fBQwtScaleDraw::Alignment\fPalignment = \fCQwtScaleDraw::BottomScale\fP, const doublepos = \fC0\&.0\fP)\fC [explicit]\fP" .PP Constructor for scale item at the position pos\&. \fBParameters:\fP .RS 4 \fIalignment\fP In case of QwtScaleDraw::BottomScale/QwtScaleDraw::TopScale the scale item is corresponding to the \fBxAxis()\fP, otherwise it corresponds to the \fByAxis()\fP\&. .br \fIpos\fP x or y position, depending on the corresponding axis\&. .RE .PP \fBSee also:\fP .RS 4 \fBsetPosition()\fP, \fBsetAlignment()\fP .RE .PP .SH "Member Function Documentation" .PP .SS "int QwtPlotScaleItem::borderDistance () const" \fBReturns:\fP .RS 4 Distance from a canvas border .RE .PP \fBSee also:\fP .RS 4 \fBsetBorderDistance()\fP, \fBsetPosition()\fP .RE .PP .SS "QFont QwtPlotScaleItem::font () const" \fBReturns:\fP .RS 4 tick label font .RE .PP \fBSee also:\fP .RS 4 \fBsetFont()\fP .RE .PP .SS "bool QwtPlotScaleItem::isScaleDivFromAxis () const" \fBReturns:\fP .RS 4 True, if the synchronization of the scale division with the corresponding axis is enabled\&. .RE .PP \fBSee also:\fP .RS 4 \fBsetScaleDiv()\fP, \fBsetScaleDivFromAxis()\fP .RE .PP .SS "QPalette QwtPlotScaleItem::palette () const" \fBReturns:\fP .RS 4 palette .RE .PP \fBSee also:\fP .RS 4 \fBsetPalette()\fP .RE .PP .SS "double QwtPlotScaleItem::position () const" \fBReturns:\fP .RS 4 Position of the scale .RE .PP \fBSee also:\fP .RS 4 \fBsetPosition()\fP, \fBsetAlignment()\fP .RE .PP .SS "int QwtPlotScaleItem::rtti () const\fC [virtual]\fP" \fBReturns:\fP .RS 4 QwtPlotItem::Rtti_PlotScale .RE .PP .PP Reimplemented from \fBQwtPlotItem\fP\&. .SS "const \fBQwtScaleDiv\fP & QwtPlotScaleItem::scaleDiv () const" \fBReturns:\fP .RS 4 Scale division .RE .PP .SS "const \fBQwtScaleDraw\fP * QwtPlotScaleItem::scaleDraw () const" \fBReturns:\fP .RS 4 Scale draw .RE .PP \fBSee also:\fP .RS 4 \fBsetScaleDraw()\fP .RE .PP .SS "\fBQwtScaleDraw\fP * QwtPlotScaleItem::scaleDraw ()" \fBReturns:\fP .RS 4 Scale draw .RE .PP \fBSee also:\fP .RS 4 \fBsetScaleDraw()\fP .RE .PP .SS "void QwtPlotScaleItem::setAlignment (\fBQwtScaleDraw::Alignment\fPalignment)" Change the alignment of the scale .PP The alignment sets the orientation of the scale and the position of the ticks: .PP .IP "\(bu" 2 QwtScaleDraw::BottomScale: horizontal, ticks below .IP "\(bu" 2 QwtScaleDraw::TopScale: horizontal, ticks above .IP "\(bu" 2 QwtScaleDraw::LeftScale: vertical, ticks left .IP "\(bu" 2 QwtScaleDraw::RightScale: vertical, ticks right .PP .PP For horizontal scales the position corresponds to \fBQwtPlotItem::yAxis()\fP, otherwise to \fBQwtPlotItem::xAxis()\fP\&. .PP \fBSee also:\fP .RS 4 \fBscaleDraw()\fP, \fBQwtScaleDraw::alignment()\fP, \fBsetPosition()\fP .RE .PP .SS "void QwtPlotScaleItem::setBorderDistance (intdistance)" .PP Align the scale to the canvas\&. If distance is >= 0 the scale will be aligned to a border of the contents rect of the canvas\&. If alignment() is QwtScaleDraw::LeftScale, the scale will be aligned to the right border, if it is QwtScaleDraw::TopScale it will be aligned to the bottom (and vice versa), .PP If distance is < 0 the scale will be at the \fBposition()\fP\&. .PP \fBParameters:\fP .RS 4 \fIdistance\fP Number of pixels between the canvas border and the backbone of the scale\&. .RE .PP \fBSee also:\fP .RS 4 \fBsetPosition()\fP, \fBborderDistance()\fP .RE .PP .SS "void QwtPlotScaleItem::setFont (const QFont &font)" Change the tick label font .PP \fBSee also:\fP .RS 4 \fBfont()\fP .RE .PP .SS "void QwtPlotScaleItem::setPalette (const QPalette &palette)" Set the palette .PP \fBSee also:\fP .RS 4 \fBQwtAbstractScaleDraw::draw()\fP, \fBpalette()\fP .RE .PP .SS "void QwtPlotScaleItem::setPosition (doublepos)" Change the position of the scale .PP The position is interpreted as y value for horizontal axes and as x value for vertical axes\&. .PP The border distance is set to \-1\&. .PP \fBParameters:\fP .RS 4 \fIpos\fP New position .RE .PP \fBSee also:\fP .RS 4 \fBposition()\fP, \fBsetAlignment()\fP .RE .PP .SS "void QwtPlotScaleItem::setScaleDiv (const \fBQwtScaleDiv\fP &scaleDiv)" .PP Assign a scale division\&. When assigning a scaleDiv the scale division won't be synchronized with the corresponding axis anymore\&. .PP \fBParameters:\fP .RS 4 \fIscaleDiv\fP Scale division .RE .PP \fBSee also:\fP .RS 4 \fBscaleDiv()\fP, \fBsetScaleDivFromAxis()\fP, \fBisScaleDivFromAxis()\fP .RE .PP .SS "void QwtPlotScaleItem::setScaleDivFromAxis (boolon)" Enable/Disable the synchronization of the scale division with the corresponding axis\&. .PP \fBParameters:\fP .RS 4 \fIon\fP true/false .RE .PP \fBSee also:\fP .RS 4 \fBisScaleDivFromAxis()\fP .RE .PP .SS "void QwtPlotScaleItem::setScaleDraw (\fBQwtScaleDraw\fP *scaleDraw)" .PP Set a scale draw\&. \fBParameters:\fP .RS 4 \fIscaleDraw\fP object responsible for drawing scales\&. .RE .PP The main use case for replacing the default \fBQwtScaleDraw\fP is to overload \fBQwtAbstractScaleDraw::label\fP, to replace or swallow tick labels\&. .PP \fBSee also:\fP .RS 4 \fBscaleDraw()\fP .RE .PP .SS "void QwtPlotScaleItem::updateScaleDiv (const \fBQwtScaleDiv\fP &xScaleDiv, const \fBQwtScaleDiv\fP &yScaleDiv)\fC [virtual]\fP" .PP Update the item to changes of the axes scale division\&. In case of \fBisScaleDivFromAxis()\fP, the scale draw is synchronized to the correspond axis\&. .PP \fBParameters:\fP .RS 4 \fIxScaleDiv\fP Scale division of the x-axis .br \fIyScaleDiv\fP Scale division of the y-axis .RE .PP \fBSee also:\fP .RS 4 \fBQwtPlot::updateAxes()\fP .RE .PP .PP Reimplemented from \fBQwtPlotItem\fP\&. .SH "Author" .PP Generated automatically by Doxygen for Qwt User's Guide from the source code\&.