1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407
|
.TH "QwtPlotScaleItem" 3 "Thu Dec 11 2014" "Version 6.1.2" "Qwt User's Guide" \" -*- nroff -*-
.ad l
.nh
.SH NAME
QwtPlotScaleItem \-
.PP
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 "\fIConstructor for scale item at the position pos\&. \fP"
.ti -1c
.RI "virtual \fB~QwtPlotScaleItem\fP ()"
.br
.RI "\fIDestructor\&. \fP"
.ti -1c
.RI "virtual int \fBrtti\fP () const "
.br
.ti -1c
.RI "void \fBsetScaleDiv\fP (const \fBQwtScaleDiv\fP &)"
.br
.RI "\fIAssign a scale division\&. \fP"
.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 "\fISet a scale draw\&. \fP"
.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 numPixels)"
.br
.RI "\fIAlign the scale to the canvas\&. \fP"
.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 *p, const \fBQwtScaleMap\fP &xMap, const \fBQwtScaleMap\fP &yMap, const QRectF &rect) const "
.br
.RI "\fIDraw the scale\&. \fP"
.ti -1c
.RI "virtual void \fBupdateScaleDiv\fP (const \fBQwtScaleDiv\fP &, const \fBQwtScaleDiv\fP &)"
.br
.RI "\fIUpdate the item to changes of the axes scale division\&. \fP"
.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 = \fC\fBQwtScaleDraw::BottomScale\fP\fP, const doublepos = \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 "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 "\fBQwtScaleDraw\fP * QwtPlotScaleItem::scaleDraw ()"
.PP
\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
\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 (intdistance)"
.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 (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\&.
.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\&.
|