QwtPlotScaleItem.3 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404
  1. .TH "QwtPlotScaleItem" 3 "Mon Dec 28 2020" "Version 6.1.6" "Qwt User's Guide" \" -*- nroff -*-
  2. .ad l
  3. .nh
  4. .SH NAME
  5. QwtPlotScaleItem \- A class which draws a scale inside the plot canvas\&.
  6. .SH SYNOPSIS
  7. .br
  8. .PP
  9. .PP
  10. \fC#include <qwt_plot_scaleitem\&.h>\fP
  11. .PP
  12. Inherits \fBQwtPlotItem\fP\&.
  13. .SS "Public Member Functions"
  14. .in +1c
  15. .ti -1c
  16. .RI "\fBQwtPlotScaleItem\fP (\fBQwtScaleDraw::Alignment\fP=\fBQwtScaleDraw::BottomScale\fP, const double pos=0\&.0)"
  17. .br
  18. .RI "Constructor for scale item at the position pos\&. "
  19. .ti -1c
  20. .RI "virtual \fB~QwtPlotScaleItem\fP ()"
  21. .br
  22. .RI "Destructor\&. "
  23. .ti -1c
  24. .RI "virtual int \fBrtti\fP () const"
  25. .br
  26. .ti -1c
  27. .RI "void \fBsetScaleDiv\fP (const \fBQwtScaleDiv\fP &)"
  28. .br
  29. .RI "Assign a scale division\&. "
  30. .ti -1c
  31. .RI "const \fBQwtScaleDiv\fP & \fBscaleDiv\fP () const"
  32. .br
  33. .ti -1c
  34. .RI "void \fBsetScaleDivFromAxis\fP (bool on)"
  35. .br
  36. .ti -1c
  37. .RI "bool \fBisScaleDivFromAxis\fP () const"
  38. .br
  39. .ti -1c
  40. .RI "void \fBsetPalette\fP (const QPalette &)"
  41. .br
  42. .ti -1c
  43. .RI "QPalette \fBpalette\fP () const"
  44. .br
  45. .ti -1c
  46. .RI "void \fBsetFont\fP (const QFont &)"
  47. .br
  48. .ti -1c
  49. .RI "QFont \fBfont\fP () const"
  50. .br
  51. .ti -1c
  52. .RI "void \fBsetScaleDraw\fP (\fBQwtScaleDraw\fP *)"
  53. .br
  54. .RI "Set a scale draw\&. "
  55. .ti -1c
  56. .RI "const \fBQwtScaleDraw\fP * \fBscaleDraw\fP () const"
  57. .br
  58. .ti -1c
  59. .RI "\fBQwtScaleDraw\fP * \fBscaleDraw\fP ()"
  60. .br
  61. .ti -1c
  62. .RI "void \fBsetPosition\fP (double pos)"
  63. .br
  64. .ti -1c
  65. .RI "double \fBposition\fP () const"
  66. .br
  67. .ti -1c
  68. .RI "void \fBsetBorderDistance\fP (int)"
  69. .br
  70. .RI "Align the scale to the canvas\&. "
  71. .ti -1c
  72. .RI "int \fBborderDistance\fP () const"
  73. .br
  74. .ti -1c
  75. .RI "void \fBsetAlignment\fP (\fBQwtScaleDraw::Alignment\fP)"
  76. .br
  77. .ti -1c
  78. .RI "virtual void \fBdraw\fP (QPainter *, const \fBQwtScaleMap\fP &xMap, const \fBQwtScaleMap\fP &yMap, const QRectF &canvasRect) const"
  79. .br
  80. .RI "Draw the scale\&. "
  81. .ti -1c
  82. .RI "virtual void \fBupdateScaleDiv\fP (const \fBQwtScaleDiv\fP &, const \fBQwtScaleDiv\fP &)"
  83. .br
  84. .RI "Update the item to changes of the axes scale division\&. "
  85. .in -1c
  86. .SS "Additional Inherited Members"
  87. .SH "Detailed Description"
  88. .PP
  89. A class which draws a scale inside the plot canvas\&.
  90. \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\&.
  91. .PP
  92. 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\&.
  93. .PP
  94. The scale might be at a specific position (f\&.e 0\&.0) or it might be aligned to a canvas border\&.
  95. .PP
  96. \fBExample\fP
  97. .RS 4
  98. The following example shows how to replace the left axis, by a scale item at the x position 0\&.0\&.
  99. .PP
  100. .nf
  101. QwtPlotScaleItem *scaleItem = new QwtPlotScaleItem( QwtScaleDraw::RightScale, 0\&.0 );
  102. scaleItem->setFont( plot->axisWidget( QwtPlot::yLeft )->font() );
  103. scaleItem->attach(plot);
  104. plot->enableAxis( QwtPlot::yLeft, false );
  105. .fi
  106. .PP
  107. \\endpar
  108. .RE
  109. .PP
  110. .SH "Constructor & Destructor Documentation"
  111. .PP
  112. .SS "QwtPlotScaleItem::QwtPlotScaleItem (\fBQwtScaleDraw::Alignment\fP alignment = \fC\fBQwtScaleDraw::BottomScale\fP\fP, const double pos = \fC0\&.0\fP)\fC [explicit]\fP"
  113. .PP
  114. Constructor for scale item at the position pos\&.
  115. .PP
  116. \fBParameters\fP
  117. .RS 4
  118. \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\&.
  119. .br
  120. \fIpos\fP x or y position, depending on the corresponding axis\&.
  121. .RE
  122. .PP
  123. \fBSee also\fP
  124. .RS 4
  125. \fBsetPosition()\fP, \fBsetAlignment()\fP
  126. .RE
  127. .PP
  128. .SH "Member Function Documentation"
  129. .PP
  130. .SS "int QwtPlotScaleItem::borderDistance () const"
  131. .PP
  132. \fBReturns\fP
  133. .RS 4
  134. Distance from a canvas border
  135. .RE
  136. .PP
  137. \fBSee also\fP
  138. .RS 4
  139. \fBsetBorderDistance()\fP, \fBsetPosition()\fP
  140. .RE
  141. .PP
  142. .SS "QFont QwtPlotScaleItem::font () const"
  143. .PP
  144. \fBReturns\fP
  145. .RS 4
  146. tick label font
  147. .RE
  148. .PP
  149. \fBSee also\fP
  150. .RS 4
  151. \fBsetFont()\fP
  152. .RE
  153. .PP
  154. .SS "bool QwtPlotScaleItem::isScaleDivFromAxis () const"
  155. .PP
  156. \fBReturns\fP
  157. .RS 4
  158. True, if the synchronization of the scale division with the corresponding axis is enabled\&.
  159. .RE
  160. .PP
  161. \fBSee also\fP
  162. .RS 4
  163. \fBsetScaleDiv()\fP, \fBsetScaleDivFromAxis()\fP
  164. .RE
  165. .PP
  166. .SS "QPalette QwtPlotScaleItem::palette () const"
  167. .PP
  168. \fBReturns\fP
  169. .RS 4
  170. palette
  171. .RE
  172. .PP
  173. \fBSee also\fP
  174. .RS 4
  175. \fBsetPalette()\fP
  176. .RE
  177. .PP
  178. .SS "double QwtPlotScaleItem::position () const"
  179. .PP
  180. \fBReturns\fP
  181. .RS 4
  182. Position of the scale
  183. .RE
  184. .PP
  185. \fBSee also\fP
  186. .RS 4
  187. \fBsetPosition()\fP, \fBsetAlignment()\fP
  188. .RE
  189. .PP
  190. .SS "int QwtPlotScaleItem::rtti () const\fC [virtual]\fP"
  191. .PP
  192. \fBReturns\fP
  193. .RS 4
  194. \fBQwtPlotItem::Rtti_PlotScale\fP
  195. .RE
  196. .PP
  197. .PP
  198. Reimplemented from \fBQwtPlotItem\fP\&.
  199. .SS "const \fBQwtScaleDiv\fP & QwtPlotScaleItem::scaleDiv () const"
  200. .PP
  201. \fBReturns\fP
  202. .RS 4
  203. Scale division
  204. .RE
  205. .PP
  206. .SS "\fBQwtScaleDraw\fP * QwtPlotScaleItem::scaleDraw ()"
  207. .PP
  208. \fBReturns\fP
  209. .RS 4
  210. Scale draw
  211. .RE
  212. .PP
  213. \fBSee also\fP
  214. .RS 4
  215. \fBsetScaleDraw()\fP
  216. .RE
  217. .PP
  218. .SS "const \fBQwtScaleDraw\fP * QwtPlotScaleItem::scaleDraw () const"
  219. .PP
  220. \fBReturns\fP
  221. .RS 4
  222. Scale draw
  223. .RE
  224. .PP
  225. \fBSee also\fP
  226. .RS 4
  227. \fBsetScaleDraw()\fP
  228. .RE
  229. .PP
  230. .SS "void QwtPlotScaleItem::setAlignment (\fBQwtScaleDraw::Alignment\fP alignment)"
  231. Change the alignment of the scale
  232. .PP
  233. The alignment sets the orientation of the scale and the position of the ticks:
  234. .PP
  235. .IP "\(bu" 2
  236. \fBQwtScaleDraw::BottomScale\fP: horizontal, ticks below
  237. .IP "\(bu" 2
  238. \fBQwtScaleDraw::TopScale\fP: horizontal, ticks above
  239. .IP "\(bu" 2
  240. \fBQwtScaleDraw::LeftScale\fP: vertical, ticks left
  241. .IP "\(bu" 2
  242. \fBQwtScaleDraw::RightScale\fP: vertical, ticks right
  243. .PP
  244. .PP
  245. For horizontal scales the position corresponds to \fBQwtPlotItem::yAxis()\fP, otherwise to \fBQwtPlotItem::xAxis()\fP\&.
  246. .PP
  247. \fBSee also\fP
  248. .RS 4
  249. \fBscaleDraw()\fP, \fBQwtScaleDraw::alignment()\fP, \fBsetPosition()\fP
  250. .RE
  251. .PP
  252. .SS "void QwtPlotScaleItem::setBorderDistance (int distance)"
  253. .PP
  254. 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),
  255. .PP
  256. If distance is < 0 the scale will be at the \fBposition()\fP\&.
  257. .PP
  258. \fBParameters\fP
  259. .RS 4
  260. \fIdistance\fP Number of pixels between the canvas border and the backbone of the scale\&.
  261. .RE
  262. .PP
  263. \fBSee also\fP
  264. .RS 4
  265. \fBsetPosition()\fP, \fBborderDistance()\fP
  266. .RE
  267. .PP
  268. .SS "void QwtPlotScaleItem::setFont (const QFont & font)"
  269. Change the tick label font
  270. .PP
  271. \fBSee also\fP
  272. .RS 4
  273. \fBfont()\fP
  274. .RE
  275. .PP
  276. .SS "void QwtPlotScaleItem::setPalette (const QPalette & palette)"
  277. Set the palette
  278. .PP
  279. \fBSee also\fP
  280. .RS 4
  281. \fBQwtAbstractScaleDraw::draw()\fP, \fBpalette()\fP
  282. .RE
  283. .PP
  284. .SS "void QwtPlotScaleItem::setPosition (double pos)"
  285. Change the position of the scale
  286. .PP
  287. The position is interpreted as y value for horizontal axes and as x value for vertical axes\&.
  288. .PP
  289. The border distance is set to -1\&.
  290. .PP
  291. \fBParameters\fP
  292. .RS 4
  293. \fIpos\fP New position
  294. .RE
  295. .PP
  296. \fBSee also\fP
  297. .RS 4
  298. \fBposition()\fP, \fBsetAlignment()\fP
  299. .RE
  300. .PP
  301. .SS "void QwtPlotScaleItem::setScaleDiv (const \fBQwtScaleDiv\fP & scaleDiv)"
  302. .PP
  303. Assign a scale division\&. When assigning a scaleDiv the scale division won't be synchronized with the corresponding axis anymore\&.
  304. .PP
  305. \fBParameters\fP
  306. .RS 4
  307. \fIscaleDiv\fP Scale division
  308. .RE
  309. .PP
  310. \fBSee also\fP
  311. .RS 4
  312. \fBscaleDiv()\fP, \fBsetScaleDivFromAxis()\fP, \fBisScaleDivFromAxis()\fP
  313. .RE
  314. .PP
  315. .SS "void QwtPlotScaleItem::setScaleDivFromAxis (bool on)"
  316. Enable/Disable the synchronization of the scale division with the corresponding axis\&.
  317. .PP
  318. \fBParameters\fP
  319. .RS 4
  320. \fIon\fP true/false
  321. .RE
  322. .PP
  323. \fBSee also\fP
  324. .RS 4
  325. \fBisScaleDivFromAxis()\fP
  326. .RE
  327. .PP
  328. .SS "void QwtPlotScaleItem::setScaleDraw (\fBQwtScaleDraw\fP * scaleDraw)"
  329. .PP
  330. Set a scale draw\&.
  331. .PP
  332. \fBParameters\fP
  333. .RS 4
  334. \fIscaleDraw\fP object responsible for drawing scales\&.
  335. .RE
  336. .PP
  337. The main use case for replacing the default \fBQwtScaleDraw\fP is to overload \fBQwtAbstractScaleDraw::label\fP, to replace or swallow tick labels\&.
  338. .PP
  339. \fBSee also\fP
  340. .RS 4
  341. \fBscaleDraw()\fP
  342. .RE
  343. .PP
  344. .SS "void QwtPlotScaleItem::updateScaleDiv (const \fBQwtScaleDiv\fP & xScaleDiv, const \fBQwtScaleDiv\fP & yScaleDiv)\fC [virtual]\fP"
  345. .PP
  346. Update the item to changes of the axes scale division\&. In case of \fBisScaleDivFromAxis()\fP, the scale draw is synchronized to the correspond axis\&.
  347. .PP
  348. \fBParameters\fP
  349. .RS 4
  350. \fIxScaleDiv\fP Scale division of the x-axis
  351. .br
  352. \fIyScaleDiv\fP Scale division of the y-axis
  353. .RE
  354. .PP
  355. \fBSee also\fP
  356. .RS 4
  357. \fBQwtPlot::updateAxes()\fP
  358. .RE
  359. .PP
  360. .PP
  361. Reimplemented from \fBQwtPlotItem\fP\&.
  362. .SH "Author"
  363. .PP
  364. Generated automatically by Doxygen for Qwt User's Guide from the source code\&.