Dhanya Thattil 38cd10d4e6
Qt5 built in qwt (#570)
- qt4->qt5
- in built qt5 6.1.5 because rhel7 is not upto date with qt5, removed findqwt.cmake
- made a fix in qwt lib (qwt_plot_layout.h) to work with 5.15 and lower versions for qrect constr.
- qt5 forms fixed, qt4 many hard coding forms switched to forms including qtabwidget, scrolls etc, fonts moved to forms
 - docking option enabled by default, removed option to disable docking feature from "Mode"
- added qVersionResolve utility functions to handle compatibility before and after qt5.12
- qtplots (ian's code) takes in gain mode enable to set some settings within the class, with proper gain plot ticks
- ensure gain plots have no zooming of z axis in 2d and y axis in 1d
- removed placeholder text in qpalette in main window form as its not supportd until 5.12 (so using qt5.9 designer insted of qt5.15 to cope)
- tab order
Servers:
- fixed some error messages that were empty for fail in funcs (mostly minor as if this error, major issues)
2022-11-11 15:15:10 +01:00

405 lines
8.8 KiB
Groff

.TH "QwtPlotScaleItem" 3 "Mon Jun 1 2020" "Version 6.1.5" "Qwt User's Guide" \" -*- nroff -*-
.ad l
.nh
.SH NAME
QwtPlotScaleItem \- A class which draws a scale inside the plot canvas\&.
.SH SYNOPSIS
.br
.PP
.PP
\fC#include <qwt_plot_scaleitem\&.h>\fP
.PP
Inherits \fBQwtPlotItem\fP\&.
.SS "Public Member Functions"
.in +1c
.ti -1c
.RI "\fBQwtPlotScaleItem\fP (\fBQwtScaleDraw::Alignment\fP=\fBQwtScaleDraw::BottomScale\fP, const double pos=0\&.0)"
.br
.RI "Constructor for scale item at the position pos\&. "
.ti -1c
.RI "virtual \fB~QwtPlotScaleItem\fP ()"
.br
.RI "Destructor\&. "
.ti -1c
.RI "virtual int \fBrtti\fP () const"
.br
.ti -1c
.RI "void \fBsetScaleDiv\fP (const \fBQwtScaleDiv\fP &)"
.br
.RI "Assign a scale division\&. "
.ti -1c
.RI "const \fBQwtScaleDiv\fP & \fBscaleDiv\fP () const"
.br
.ti -1c
.RI "void \fBsetScaleDivFromAxis\fP (bool on)"
.br
.ti -1c
.RI "bool \fBisScaleDivFromAxis\fP () const"
.br
.ti -1c
.RI "void \fBsetPalette\fP (const QPalette &)"
.br
.ti -1c
.RI "QPalette \fBpalette\fP () const"
.br
.ti -1c
.RI "void \fBsetFont\fP (const QFont &)"
.br
.ti -1c
.RI "QFont \fBfont\fP () const"
.br
.ti -1c
.RI "void \fBsetScaleDraw\fP (\fBQwtScaleDraw\fP *)"
.br
.RI "Set a scale draw\&. "
.ti -1c
.RI "const \fBQwtScaleDraw\fP * \fBscaleDraw\fP () const"
.br
.ti -1c
.RI "\fBQwtScaleDraw\fP * \fBscaleDraw\fP ()"
.br
.ti -1c
.RI "void \fBsetPosition\fP (double pos)"
.br
.ti -1c
.RI "double \fBposition\fP () const"
.br
.ti -1c
.RI "void \fBsetBorderDistance\fP (int)"
.br
.RI "Align the scale to the canvas\&. "
.ti -1c
.RI "int \fBborderDistance\fP () const"
.br
.ti -1c
.RI "void \fBsetAlignment\fP (\fBQwtScaleDraw::Alignment\fP)"
.br
.ti -1c
.RI "virtual void \fBdraw\fP (QPainter *, const \fBQwtScaleMap\fP &xMap, const \fBQwtScaleMap\fP &yMap, const QRectF &canvasRect) const"
.br
.RI "Draw the scale\&. "
.ti -1c
.RI "virtual void \fBupdateScaleDiv\fP (const \fBQwtScaleDiv\fP &, const \fBQwtScaleDiv\fP &)"
.br
.RI "Update the item to changes of the axes scale division\&. "
.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
\\endpar
.RE
.PP
.SH "Constructor & Destructor Documentation"
.PP
.SS "QwtPlotScaleItem::QwtPlotScaleItem (\fBQwtScaleDraw::Alignment\fP alignment = \fC\fBQwtScaleDraw::BottomScale\fP\fP, const double pos = \fC0\&.0\fP)\fC [explicit]\fP"
.PP
Constructor for scale item at the position pos\&.
.PP
\fBParameters\fP
.RS 4
\fIalignment\fP In case of \fBQwtScaleDraw::BottomScale\fP or \fBQwtScaleDraw::TopScale\fP 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"
.PP
\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"
.PP
\fBReturns\fP
.RS 4
tick label font
.RE
.PP
\fBSee also\fP
.RS 4
\fBsetFont()\fP
.RE
.PP
.SS "bool QwtPlotScaleItem::isScaleDivFromAxis () const"
.PP
\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"
.PP
\fBReturns\fP
.RS 4
palette
.RE
.PP
\fBSee also\fP
.RS 4
\fBsetPalette()\fP
.RE
.PP
.SS "double QwtPlotScaleItem::position () const"
.PP
\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"
.PP
\fBReturns\fP
.RS 4
\fBQwtPlotItem::Rtti_PlotScale\fP
.RE
.PP
.PP
Reimplemented from \fBQwtPlotItem\fP\&.
.SS "const \fBQwtScaleDiv\fP & QwtPlotScaleItem::scaleDiv () const"
.PP
\fBReturns\fP
.RS 4
Scale division
.RE
.PP
.SS "\fBQwtScaleDraw\fP * QwtPlotScaleItem::scaleDraw ()"
.PP
\fBReturns\fP
.RS 4
Scale draw
.RE
.PP
\fBSee also\fP
.RS 4
\fBsetScaleDraw()\fP
.RE
.PP
.SS "const \fBQwtScaleDraw\fP * QwtPlotScaleItem::scaleDraw () const"
.PP
\fBReturns\fP
.RS 4
Scale draw
.RE
.PP
\fBSee also\fP
.RS 4
\fBsetScaleDraw()\fP
.RE
.PP
.SS "void QwtPlotScaleItem::setAlignment (\fBQwtScaleDraw::Alignment\fP alignment)"
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
\fBQwtScaleDraw::BottomScale\fP: horizontal, ticks below
.IP "\(bu" 2
\fBQwtScaleDraw::TopScale\fP: horizontal, ticks above
.IP "\(bu" 2
\fBQwtScaleDraw::LeftScale\fP: vertical, ticks left
.IP "\(bu" 2
\fBQwtScaleDraw::RightScale\fP: 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 (int distance)"
.PP
Align the scale to the canvas\&. If distance is >= 0 the scale will be aligned to a border of the contents rectangle of the canvas\&. If alignment() is \fBQwtScaleDraw::LeftScale\fP, the scale will be aligned to the right border, if it is \fBQwtScaleDraw::TopScale\fP 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 (double pos)"
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 (bool on)"
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\&.
.PP
\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\&.