QwtPlotMarker.3 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518
  1. .TH "QwtPlotMarker" 3 "Mon Dec 28 2020" "Version 6.1.6" "Qwt User's Guide" \" -*- nroff -*-
  2. .ad l
  3. .nh
  4. .SH NAME
  5. QwtPlotMarker \- A class for drawing markers\&.
  6. .SH SYNOPSIS
  7. .br
  8. .PP
  9. .PP
  10. \fC#include <qwt_plot_marker\&.h>\fP
  11. .PP
  12. Inherits \fBQwtPlotItem\fP\&.
  13. .SS "Public Types"
  14. .in +1c
  15. .ti -1c
  16. .RI "enum \fBLineStyle\fP { \fBNoLine\fP, \fBHLine\fP, \fBVLine\fP, \fBCross\fP }"
  17. .br
  18. .in -1c
  19. .SS "Public Member Functions"
  20. .in +1c
  21. .ti -1c
  22. .RI "\fBQwtPlotMarker\fP (const QString &\fBtitle\fP=QString())"
  23. .br
  24. .RI "Sets alignment to Qt::AlignCenter, and style to \fBQwtPlotMarker::NoLine\fP\&. "
  25. .ti -1c
  26. .RI "\fBQwtPlotMarker\fP (const \fBQwtText\fP &\fBtitle\fP)"
  27. .br
  28. .RI "Sets alignment to Qt::AlignCenter, and style to \fBQwtPlotMarker::NoLine\fP\&. "
  29. .ti -1c
  30. .RI "virtual \fB~QwtPlotMarker\fP ()"
  31. .br
  32. .RI "Destructor\&. "
  33. .ti -1c
  34. .RI "virtual int \fBrtti\fP () const"
  35. .br
  36. .ti -1c
  37. .RI "double \fBxValue\fP () const"
  38. .br
  39. .RI "Return x Value\&. "
  40. .ti -1c
  41. .RI "double \fByValue\fP () const"
  42. .br
  43. .RI "Return y Value\&. "
  44. .ti -1c
  45. .RI "QPointF \fBvalue\fP () const"
  46. .br
  47. .RI "Return Value\&. "
  48. .ti -1c
  49. .RI "void \fBsetXValue\fP (double)"
  50. .br
  51. .RI "Set X Value\&. "
  52. .ti -1c
  53. .RI "void \fBsetYValue\fP (double)"
  54. .br
  55. .RI "Set Y Value\&. "
  56. .ti -1c
  57. .RI "void \fBsetValue\fP (double, double)"
  58. .br
  59. .RI "Set Value\&. "
  60. .ti -1c
  61. .RI "void \fBsetValue\fP (const QPointF &)"
  62. .br
  63. .RI "Set Value\&. "
  64. .ti -1c
  65. .RI "void \fBsetLineStyle\fP (\fBLineStyle\fP)"
  66. .br
  67. .RI "Set the line style\&. "
  68. .ti -1c
  69. .RI "\fBLineStyle\fP \fBlineStyle\fP () const"
  70. .br
  71. .ti -1c
  72. .RI "void \fBsetLinePen\fP (const QColor &, qreal width=0\&.0, Qt::PenStyle=Qt::SolidLine)"
  73. .br
  74. .ti -1c
  75. .RI "void \fBsetLinePen\fP (const QPen &)"
  76. .br
  77. .ti -1c
  78. .RI "const QPen & \fBlinePen\fP () const"
  79. .br
  80. .ti -1c
  81. .RI "void \fBsetSymbol\fP (const \fBQwtSymbol\fP *)"
  82. .br
  83. .RI "Assign a symbol\&. "
  84. .ti -1c
  85. .RI "const \fBQwtSymbol\fP * \fBsymbol\fP () const"
  86. .br
  87. .ti -1c
  88. .RI "void \fBsetLabel\fP (const \fBQwtText\fP &)"
  89. .br
  90. .RI "Set the label\&. "
  91. .ti -1c
  92. .RI "\fBQwtText\fP \fBlabel\fP () const"
  93. .br
  94. .ti -1c
  95. .RI "void \fBsetLabelAlignment\fP (Qt::Alignment)"
  96. .br
  97. .RI "Set the alignment of the label\&. "
  98. .ti -1c
  99. .RI "Qt::Alignment \fBlabelAlignment\fP () const"
  100. .br
  101. .ti -1c
  102. .RI "void \fBsetLabelOrientation\fP (Qt::Orientation)"
  103. .br
  104. .RI "Set the orientation of the label\&. "
  105. .ti -1c
  106. .RI "Qt::Orientation \fBlabelOrientation\fP () const"
  107. .br
  108. .ti -1c
  109. .RI "void \fBsetSpacing\fP (int)"
  110. .br
  111. .RI "Set the spacing\&. "
  112. .ti -1c
  113. .RI "int \fBspacing\fP () const"
  114. .br
  115. .ti -1c
  116. .RI "virtual void \fBdraw\fP (QPainter *, const \fBQwtScaleMap\fP &xMap, const \fBQwtScaleMap\fP &yMap, const QRectF &) const"
  117. .br
  118. .ti -1c
  119. .RI "virtual QRectF \fBboundingRect\fP () const"
  120. .br
  121. .ti -1c
  122. .RI "virtual \fBQwtGraphic\fP \fBlegendIcon\fP (int index, const QSizeF &) const"
  123. .br
  124. .in -1c
  125. .SS "Protected Member Functions"
  126. .in +1c
  127. .ti -1c
  128. .RI "virtual void \fBdrawLines\fP (QPainter *, const QRectF &, const QPointF &) const"
  129. .br
  130. .ti -1c
  131. .RI "virtual void \fBdrawLabel\fP (QPainter *, const QRectF &, const QPointF &) const"
  132. .br
  133. .in -1c
  134. .SH "Detailed Description"
  135. .PP
  136. A class for drawing markers\&.
  137. A marker can be a horizontal line, a vertical line, a symbol, a label or any combination of them, which can be drawn around a center point inside a bounding rectangle\&.
  138. .PP
  139. The \fBsetSymbol()\fP member assigns a symbol to the marker\&. The symbol is drawn at the specified point\&.
  140. .PP
  141. With \fBsetLabel()\fP, a label can be assigned to the marker\&. The \fBsetLabelAlignment()\fP member specifies where the label is drawn\&. All the Align*-constants in Qt::AlignmentFlags (see Qt documentation) are valid\&. The interpretation of the alignment depends on the marker's line style\&. The alignment refers to the center point of the marker, which means, for example, that the label would be printed left above the center point if the alignment was set to Qt::AlignLeft | Qt::AlignTop\&.
  142. .PP
  143. \fBNote\fP
  144. .RS 4
  145. \fBQwtPlotTextLabel\fP is intended to align a text label according to the geometry of canvas ( unrelated to plot coordinates )
  146. .RE
  147. .PP
  148. .SH "Member Enumeration Documentation"
  149. .PP
  150. .SS "enum \fBQwtPlotMarker::LineStyle\fP"
  151. Line styles\&.
  152. .PP
  153. \fBSee also\fP
  154. .RS 4
  155. \fBsetLineStyle()\fP, \fBlineStyle()\fP
  156. .RE
  157. .PP
  158. .PP
  159. \fBEnumerator\fP
  160. .in +1c
  161. .TP
  162. \fB\fINoLine \fP\fP
  163. No line\&.
  164. .TP
  165. \fB\fIHLine \fP\fP
  166. A horizontal line\&.
  167. .TP
  168. \fB\fIVLine \fP\fP
  169. A vertical line\&.
  170. .TP
  171. \fB\fICross \fP\fP
  172. A crosshair\&.
  173. .SH "Member Function Documentation"
  174. .PP
  175. .SS "QRectF QwtPlotMarker::boundingRect () const\fC [virtual]\fP"
  176. .PP
  177. \fBReturns\fP
  178. .RS 4
  179. An invalid bounding rect: QRectF(1\&.0, 1\&.0, -2\&.0, -2\&.0)
  180. .RE
  181. .PP
  182. \fBNote\fP
  183. .RS 4
  184. A width or height < 0\&.0 is ignored by the autoscaler
  185. .RE
  186. .PP
  187. .PP
  188. Reimplemented from \fBQwtPlotItem\fP\&.
  189. .SS "void QwtPlotMarker::draw (QPainter * painter, const \fBQwtScaleMap\fP & xMap, const \fBQwtScaleMap\fP & yMap, const QRectF & canvasRect) const\fC [virtual]\fP"
  190. Draw the marker
  191. .PP
  192. \fBParameters\fP
  193. .RS 4
  194. \fIpainter\fP Painter
  195. .br
  196. \fIxMap\fP x Scale Map
  197. .br
  198. \fIyMap\fP y Scale Map
  199. .br
  200. \fIcanvasRect\fP Contents rectangle of the canvas in painter coordinates
  201. .RE
  202. .PP
  203. .PP
  204. Implements \fBQwtPlotItem\fP\&.
  205. .SS "void QwtPlotMarker::drawLabel (QPainter * painter, const QRectF & canvasRect, const QPointF & pos) const\fC [protected]\fP, \fC [virtual]\fP"
  206. Align and draw the text label of the marker
  207. .PP
  208. \fBParameters\fP
  209. .RS 4
  210. \fIpainter\fP Painter
  211. .br
  212. \fIcanvasRect\fP Contents rectangle of the canvas in painter coordinates
  213. .br
  214. \fIpos\fP Position of the marker, translated into widget coordinates
  215. .RE
  216. .PP
  217. \fBSee also\fP
  218. .RS 4
  219. \fBdrawLabel()\fP, \fBQwtSymbol::drawSymbol()\fP
  220. .RE
  221. .PP
  222. .SS "void QwtPlotMarker::drawLines (QPainter * painter, const QRectF & canvasRect, const QPointF & pos) const\fC [protected]\fP, \fC [virtual]\fP"
  223. Draw the lines marker
  224. .PP
  225. \fBParameters\fP
  226. .RS 4
  227. \fIpainter\fP Painter
  228. .br
  229. \fIcanvasRect\fP Contents rectangle of the canvas in painter coordinates
  230. .br
  231. \fIpos\fP Position of the marker, translated into widget coordinates
  232. .RE
  233. .PP
  234. \fBSee also\fP
  235. .RS 4
  236. \fBdrawLabel()\fP, \fBQwtSymbol::drawSymbol()\fP
  237. .RE
  238. .PP
  239. .SS "\fBQwtText\fP QwtPlotMarker::label () const"
  240. .PP
  241. \fBReturns\fP
  242. .RS 4
  243. the label
  244. .RE
  245. .PP
  246. \fBSee also\fP
  247. .RS 4
  248. \fBsetLabel()\fP
  249. .RE
  250. .PP
  251. .SS "Qt::Alignment QwtPlotMarker::labelAlignment () const"
  252. .PP
  253. \fBReturns\fP
  254. .RS 4
  255. the label alignment
  256. .RE
  257. .PP
  258. \fBSee also\fP
  259. .RS 4
  260. \fBsetLabelAlignment()\fP, \fBsetLabelOrientation()\fP
  261. .RE
  262. .PP
  263. .SS "Qt::Orientation QwtPlotMarker::labelOrientation () const"
  264. .PP
  265. \fBReturns\fP
  266. .RS 4
  267. the label orientation
  268. .RE
  269. .PP
  270. \fBSee also\fP
  271. .RS 4
  272. \fBsetLabelOrientation()\fP, \fBlabelAlignment()\fP
  273. .RE
  274. .PP
  275. .SS "\fBQwtGraphic\fP QwtPlotMarker::legendIcon (int index, const QSizeF & size) const\fC [virtual]\fP"
  276. .PP
  277. \fBReturns\fP
  278. .RS 4
  279. Icon representing the marker on the legend
  280. .RE
  281. .PP
  282. \fBParameters\fP
  283. .RS 4
  284. \fIindex\fP Index of the legend entry ( usually there is only one )
  285. .br
  286. \fIsize\fP Icon size
  287. .RE
  288. .PP
  289. \fBSee also\fP
  290. .RS 4
  291. \fBsetLegendIconSize()\fP, \fBlegendData()\fP
  292. .RE
  293. .PP
  294. .PP
  295. Reimplemented from \fBQwtPlotItem\fP\&.
  296. .SS "const QPen & QwtPlotMarker::linePen () const"
  297. .PP
  298. \fBReturns\fP
  299. .RS 4
  300. the line pen
  301. .RE
  302. .PP
  303. \fBSee also\fP
  304. .RS 4
  305. \fBsetLinePen()\fP
  306. .RE
  307. .PP
  308. .SS "\fBQwtPlotMarker::LineStyle\fP QwtPlotMarker::lineStyle () const"
  309. .PP
  310. \fBReturns\fP
  311. .RS 4
  312. the line style
  313. .RE
  314. .PP
  315. \fBSee also\fP
  316. .RS 4
  317. \fBsetLineStyle()\fP
  318. .RE
  319. .PP
  320. .SS "int QwtPlotMarker::rtti () const\fC [virtual]\fP"
  321. .PP
  322. \fBReturns\fP
  323. .RS 4
  324. \fBQwtPlotItem::Rtti_PlotMarker\fP
  325. .RE
  326. .PP
  327. .PP
  328. Reimplemented from \fBQwtPlotItem\fP\&.
  329. .SS "void QwtPlotMarker::setLabel (const \fBQwtText\fP & label)"
  330. .PP
  331. Set the label\&.
  332. .PP
  333. \fBParameters\fP
  334. .RS 4
  335. \fIlabel\fP Label text
  336. .RE
  337. .PP
  338. \fBSee also\fP
  339. .RS 4
  340. \fBlabel()\fP
  341. .RE
  342. .PP
  343. .SS "void QwtPlotMarker::setLabelAlignment (Qt::Alignment align)"
  344. .PP
  345. Set the alignment of the label\&. In case of \fBQwtPlotMarker::HLine\fP the alignment is relative to the y position of the marker, but the horizontal flags correspond to the canvas rectangle\&. In case of \fBQwtPlotMarker::VLine\fP the alignment is relative to the x position of the marker, but the vertical flags correspond to the canvas rectangle\&.
  346. .PP
  347. In all other styles the alignment is relative to the marker's position\&.
  348. .PP
  349. \fBParameters\fP
  350. .RS 4
  351. \fIalign\fP Alignment\&.
  352. .RE
  353. .PP
  354. \fBSee also\fP
  355. .RS 4
  356. \fBlabelAlignment()\fP, \fBlabelOrientation()\fP
  357. .RE
  358. .PP
  359. .SS "void QwtPlotMarker::setLabelOrientation (Qt::Orientation orientation)"
  360. .PP
  361. Set the orientation of the label\&. When orientation is Qt::Vertical the label is rotated by 90\&.0 degrees ( from bottom to top )\&.
  362. .PP
  363. \fBParameters\fP
  364. .RS 4
  365. \fIorientation\fP Orientation of the label
  366. .RE
  367. .PP
  368. \fBSee also\fP
  369. .RS 4
  370. \fBlabelOrientation()\fP, \fBsetLabelAlignment()\fP
  371. .RE
  372. .PP
  373. .SS "void QwtPlotMarker::setLinePen (const QColor & color, qreal width = \fC0\&.0\fP, Qt::PenStyle style = \fCQt::SolidLine\fP)"
  374. Build and assign a line pen
  375. .PP
  376. In Qt5 the default pen width is 1\&.0 ( 0\&.0 in Qt4 ) what makes it non cosmetic ( see QPen::isCosmetic() )\&. This method has been introduced to hide this incompatibility\&.
  377. .PP
  378. \fBParameters\fP
  379. .RS 4
  380. \fIcolor\fP Pen color
  381. .br
  382. \fIwidth\fP Pen width
  383. .br
  384. \fIstyle\fP Pen style
  385. .RE
  386. .PP
  387. \fBSee also\fP
  388. .RS 4
  389. pen(), brush()
  390. .RE
  391. .PP
  392. .SS "void QwtPlotMarker::setLinePen (const QPen & pen)"
  393. Specify a pen for the line\&.
  394. .PP
  395. \fBParameters\fP
  396. .RS 4
  397. \fIpen\fP New pen
  398. .RE
  399. .PP
  400. \fBSee also\fP
  401. .RS 4
  402. \fBlinePen()\fP
  403. .RE
  404. .PP
  405. .SS "void QwtPlotMarker::setLineStyle (\fBLineStyle\fP style)"
  406. .PP
  407. Set the line style\&.
  408. .PP
  409. \fBParameters\fP
  410. .RS 4
  411. \fIstyle\fP Line style\&.
  412. .RE
  413. .PP
  414. \fBSee also\fP
  415. .RS 4
  416. \fBlineStyle()\fP
  417. .RE
  418. .PP
  419. .SS "void QwtPlotMarker::setSpacing (int spacing)"
  420. .PP
  421. Set the spacing\&. When the label is not centered on the marker position, the spacing is the distance between the position and the label\&.
  422. .PP
  423. \fBParameters\fP
  424. .RS 4
  425. \fIspacing\fP Spacing
  426. .RE
  427. .PP
  428. \fBSee also\fP
  429. .RS 4
  430. \fBspacing()\fP, \fBsetLabelAlignment()\fP
  431. .RE
  432. .PP
  433. .SS "void QwtPlotMarker::setSymbol (const \fBQwtSymbol\fP * symbol)"
  434. .PP
  435. Assign a symbol\&.
  436. .PP
  437. \fBParameters\fP
  438. .RS 4
  439. \fIsymbol\fP New symbol
  440. .RE
  441. .PP
  442. \fBSee also\fP
  443. .RS 4
  444. \fBsymbol()\fP
  445. .RE
  446. .PP
  447. .SS "int QwtPlotMarker::spacing () const"
  448. .PP
  449. \fBReturns\fP
  450. .RS 4
  451. the spacing
  452. .RE
  453. .PP
  454. \fBSee also\fP
  455. .RS 4
  456. \fBsetSpacing()\fP
  457. .RE
  458. .PP
  459. .SS "const \fBQwtSymbol\fP * QwtPlotMarker::symbol () const"
  460. .PP
  461. \fBReturns\fP
  462. .RS 4
  463. the symbol
  464. .RE
  465. .PP
  466. \fBSee also\fP
  467. .RS 4
  468. \fBsetSymbol()\fP, \fBQwtSymbol\fP
  469. .RE
  470. .PP
  471. .SH "Author"
  472. .PP
  473. Generated automatically by Doxygen for Qwt User's Guide from the source code\&.