QwtSymbol.3 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866
  1. .TH "QwtSymbol" 3 "Mon Dec 28 2020" "Version 6.1.6" "Qwt User's Guide" \" -*- nroff -*-
  2. .ad l
  3. .nh
  4. .SH NAME
  5. QwtSymbol \- A class for drawing symbols\&.
  6. .SH SYNOPSIS
  7. .br
  8. .PP
  9. .PP
  10. \fC#include <qwt_symbol\&.h>\fP
  11. .SS "Public Types"
  12. .in +1c
  13. .ti -1c
  14. .RI "enum \fBStyle\fP { \fBNoSymbol\fP = -1, \fBEllipse\fP, \fBRect\fP, \fBDiamond\fP, \fBTriangle\fP, \fBDTriangle\fP, \fBUTriangle\fP, \fBLTriangle\fP, \fBRTriangle\fP, \fBCross\fP, \fBXCross\fP, \fBHLine\fP, \fBVLine\fP, \fBStar1\fP, \fBStar2\fP, \fBHexagon\fP, \fBPath\fP, \fBPixmap\fP, \fBGraphic\fP, \fBSvgDocument\fP, \fBUserStyle\fP = 1000 }"
  15. .br
  16. .ti -1c
  17. .RI "enum \fBCachePolicy\fP { \fBNoCache\fP, \fBCache\fP, \fBAutoCache\fP }"
  18. .br
  19. .in -1c
  20. .SS "Public Member Functions"
  21. .in +1c
  22. .ti -1c
  23. .RI "\fBQwtSymbol\fP (\fBStyle\fP=\fBNoSymbol\fP)"
  24. .br
  25. .ti -1c
  26. .RI "\fBQwtSymbol\fP (\fBStyle\fP, const QBrush &, const QPen &, const QSize &)"
  27. .br
  28. .RI "Constructor\&. "
  29. .ti -1c
  30. .RI "\fBQwtSymbol\fP (const QPainterPath &, const QBrush &, const QPen &)"
  31. .br
  32. .RI "Constructor\&. "
  33. .ti -1c
  34. .RI "virtual \fB~QwtSymbol\fP ()"
  35. .br
  36. .RI "Destructor\&. "
  37. .ti -1c
  38. .RI "void \fBsetCachePolicy\fP (\fBCachePolicy\fP)"
  39. .br
  40. .ti -1c
  41. .RI "\fBCachePolicy\fP \fBcachePolicy\fP () const"
  42. .br
  43. .ti -1c
  44. .RI "void \fBsetSize\fP (const QSize &)"
  45. .br
  46. .ti -1c
  47. .RI "void \fBsetSize\fP (int width, int height=\-1)"
  48. .br
  49. .RI "Specify the symbol's size\&. "
  50. .ti -1c
  51. .RI "const QSize & \fBsize\fP () const"
  52. .br
  53. .ti -1c
  54. .RI "void \fBsetPinPoint\fP (const QPointF &pos, bool enable=true)"
  55. .br
  56. .RI "Set and enable a pin point\&. "
  57. .ti -1c
  58. .RI "QPointF \fBpinPoint\fP () const"
  59. .br
  60. .ti -1c
  61. .RI "void \fBsetPinPointEnabled\fP (bool)"
  62. .br
  63. .ti -1c
  64. .RI "bool \fBisPinPointEnabled\fP () const"
  65. .br
  66. .ti -1c
  67. .RI "virtual void \fBsetColor\fP (const QColor &)"
  68. .br
  69. .RI "Set the color of the symbol\&. "
  70. .ti -1c
  71. .RI "void \fBsetBrush\fP (const QBrush &)"
  72. .br
  73. .RI "Assign a brush\&. "
  74. .ti -1c
  75. .RI "const QBrush & \fBbrush\fP () const"
  76. .br
  77. .ti -1c
  78. .RI "void \fBsetPen\fP (const QColor &, qreal width=0\&.0, Qt::PenStyle=Qt::SolidLine)"
  79. .br
  80. .ti -1c
  81. .RI "void \fBsetPen\fP (const QPen &)"
  82. .br
  83. .ti -1c
  84. .RI "const QPen & \fBpen\fP () const"
  85. .br
  86. .ti -1c
  87. .RI "void \fBsetStyle\fP (\fBStyle\fP)"
  88. .br
  89. .ti -1c
  90. .RI "\fBStyle\fP \fBstyle\fP () const"
  91. .br
  92. .ti -1c
  93. .RI "void \fBsetPath\fP (const QPainterPath &)"
  94. .br
  95. .RI "Set a painter path as symbol\&. "
  96. .ti -1c
  97. .RI "const QPainterPath & \fBpath\fP () const"
  98. .br
  99. .ti -1c
  100. .RI "void \fBsetPixmap\fP (const QPixmap &)"
  101. .br
  102. .ti -1c
  103. .RI "const QPixmap & \fBpixmap\fP () const"
  104. .br
  105. .ti -1c
  106. .RI "void \fBsetGraphic\fP (const \fBQwtGraphic\fP &)"
  107. .br
  108. .ti -1c
  109. .RI "const \fBQwtGraphic\fP & \fBgraphic\fP () const"
  110. .br
  111. .ti -1c
  112. .RI "void \fBsetSvgDocument\fP (const QByteArray &)"
  113. .br
  114. .ti -1c
  115. .RI "void \fBdrawSymbol\fP (QPainter *, const QRectF &) const"
  116. .br
  117. .RI "Draw the symbol into a rectangle\&. "
  118. .ti -1c
  119. .RI "void \fBdrawSymbol\fP (QPainter *, const QPointF &) const"
  120. .br
  121. .RI "Draw the symbol at a specified position\&. "
  122. .ti -1c
  123. .RI "void \fBdrawSymbols\fP (QPainter *, const QPolygonF &) const"
  124. .br
  125. .RI "Draw symbols at the specified points\&. "
  126. .ti -1c
  127. .RI "void \fBdrawSymbols\fP (QPainter *, const QPointF *, int numPoints) const"
  128. .br
  129. .ti -1c
  130. .RI "virtual QRect \fBboundingRect\fP () const"
  131. .br
  132. .ti -1c
  133. .RI "void \fBinvalidateCache\fP ()"
  134. .br
  135. .in -1c
  136. .SS "Protected Member Functions"
  137. .in +1c
  138. .ti -1c
  139. .RI "virtual void \fBrenderSymbols\fP (QPainter *, const QPointF *, int numPoints) const"
  140. .br
  141. .in -1c
  142. .SH "Detailed Description"
  143. .PP
  144. A class for drawing symbols\&.
  145. .SH "Member Enumeration Documentation"
  146. .PP
  147. .SS "enum \fBQwtSymbol::CachePolicy\fP"
  148. Depending on the render engine and the complexity of the symbol shape it might be faster to render the symbol to a pixmap and to paint this pixmap\&.
  149. .PP
  150. F\&.e\&. the raster paint engine is a pure software renderer where in cache mode a draw operation usually ends in raster operation with the the backing store, that are usually faster, than the algorithms for rendering polygons\&. But the opposite can be expected for graphic pipelines that can make use of hardware acceleration\&.
  151. .PP
  152. The default setting is AutoCache
  153. .PP
  154. \fBSee also\fP
  155. .RS 4
  156. \fBsetCachePolicy()\fP, \fBcachePolicy()\fP
  157. .RE
  158. .PP
  159. \fBNote\fP
  160. .RS 4
  161. The policy has no effect, when the symbol is painted to a vector graphics format ( PDF, SVG )\&.
  162. .RE
  163. .PP
  164. \fBWarning\fP
  165. .RS 4
  166. Since Qt 4\&.8 raster is the default backend on X11
  167. .RE
  168. .PP
  169. .PP
  170. \fBEnumerator\fP
  171. .in +1c
  172. .TP
  173. \fB\fINoCache \fP\fP
  174. Don't use a pixmap cache\&.
  175. .TP
  176. \fB\fICache \fP\fP
  177. Always use a pixmap cache\&.
  178. .TP
  179. \fB\fIAutoCache \fP\fP
  180. Use a cache when one of the following conditions is true:
  181. .PP
  182. .IP "\(bu" 2
  183. The symbol is rendered with the software renderer ( QPaintEngine::Raster )
  184. .PP
  185. .SS "enum \fBQwtSymbol::Style\fP"
  186. Symbol Style
  187. .PP
  188. \fBSee also\fP
  189. .RS 4
  190. \fBsetStyle()\fP, \fBstyle()\fP
  191. .RE
  192. .PP
  193. .PP
  194. \fBEnumerator\fP
  195. .in +1c
  196. .TP
  197. \fB\fINoSymbol \fP\fP
  198. No Style\&. The symbol cannot be drawn\&.
  199. .TP
  200. \fB\fIEllipse \fP\fP
  201. Ellipse or circle\&.
  202. .TP
  203. \fB\fIRect \fP\fP
  204. Rectangle\&.
  205. .TP
  206. \fB\fIDiamond \fP\fP
  207. Diamond\&.
  208. .TP
  209. \fB\fITriangle \fP\fP
  210. Triangle pointing upwards\&.
  211. .TP
  212. \fB\fIDTriangle \fP\fP
  213. Triangle pointing downwards\&.
  214. .TP
  215. \fB\fIUTriangle \fP\fP
  216. Triangle pointing upwards\&.
  217. .TP
  218. \fB\fILTriangle \fP\fP
  219. Triangle pointing left\&.
  220. .TP
  221. \fB\fIRTriangle \fP\fP
  222. Triangle pointing right\&.
  223. .TP
  224. \fB\fICross \fP\fP
  225. Cross (+)
  226. .TP
  227. \fB\fIXCross \fP\fP
  228. Diagonal cross (X)
  229. .TP
  230. \fB\fIHLine \fP\fP
  231. Horizontal line\&.
  232. .TP
  233. \fB\fIVLine \fP\fP
  234. Vertical line\&.
  235. .TP
  236. \fB\fIStar1 \fP\fP
  237. X combined with +\&.
  238. .TP
  239. \fB\fIStar2 \fP\fP
  240. Six-pointed star\&.
  241. .TP
  242. \fB\fIHexagon \fP\fP
  243. Hexagon\&.
  244. .TP
  245. \fB\fIPath \fP\fP
  246. The symbol is represented by a painter path, where the origin ( 0, 0 ) of the path coordinate system is mapped to the position of the symbol\&.
  247. .PP
  248. \fBSee also\fP
  249. .RS 4
  250. \fBsetPath()\fP, \fBpath()\fP
  251. .RE
  252. .PP
  253. .TP
  254. \fB\fIPixmap \fP\fP
  255. The symbol is represented by a pixmap\&. The pixmap is centered or aligned to its pin point\&.
  256. .PP
  257. \fBSee also\fP
  258. .RS 4
  259. \fBsetPinPoint()\fP
  260. .RE
  261. .PP
  262. .TP
  263. \fB\fIGraphic \fP\fP
  264. The symbol is represented by a graphic\&. The graphic is centered or aligned to its pin point\&.
  265. .PP
  266. \fBSee also\fP
  267. .RS 4
  268. \fBsetPinPoint()\fP
  269. .RE
  270. .PP
  271. .TP
  272. \fB\fISvgDocument \fP\fP
  273. The symbol is represented by a SVG graphic\&. The graphic is centered or aligned to its pin point\&.
  274. .PP
  275. \fBSee also\fP
  276. .RS 4
  277. \fBsetPinPoint()\fP
  278. .RE
  279. .PP
  280. .TP
  281. \fB\fIUserStyle \fP\fP
  282. Styles >= QwtSymbol::UserSymbol are reserved for derived classes of \fBQwtSymbol\fP that overload \fBdrawSymbols()\fP with additional application specific symbol types\&.
  283. .SH "Constructor & Destructor Documentation"
  284. .PP
  285. .SS "QwtSymbol::QwtSymbol (\fBStyle\fP style = \fC\fBNoSymbol\fP\fP)"
  286. Default Constructor
  287. .PP
  288. \fBParameters\fP
  289. .RS 4
  290. \fIstyle\fP Symbol Style
  291. .RE
  292. .PP
  293. The symbol is constructed with gray interior, black outline with zero width, no size and style 'NoSymbol'\&.
  294. .SS "QwtSymbol::QwtSymbol (\fBQwtSymbol::Style\fP style, const QBrush & brush, const QPen & pen, const QSize & size)"
  295. .PP
  296. Constructor\&.
  297. .PP
  298. \fBParameters\fP
  299. .RS 4
  300. \fIstyle\fP Symbol Style
  301. .br
  302. \fIbrush\fP brush to fill the interior
  303. .br
  304. \fIpen\fP outline pen
  305. .br
  306. \fIsize\fP size
  307. .RE
  308. .PP
  309. \fBSee also\fP
  310. .RS 4
  311. \fBsetStyle()\fP, \fBsetBrush()\fP, \fBsetPen()\fP, \fBsetSize()\fP
  312. .RE
  313. .PP
  314. .SS "QwtSymbol::QwtSymbol (const QPainterPath & path, const QBrush & brush, const QPen & pen)"
  315. .PP
  316. Constructor\&. The symbol gets initialized by a painter path\&. The style is set to \fBQwtSymbol::Path\fP, the size is set to empty ( the path is displayed unscaled )\&.
  317. .PP
  318. \fBParameters\fP
  319. .RS 4
  320. \fIpath\fP painter path
  321. .br
  322. \fIbrush\fP brush to fill the interior
  323. .br
  324. \fIpen\fP outline pen
  325. .RE
  326. .PP
  327. \fBSee also\fP
  328. .RS 4
  329. \fBsetPath()\fP, \fBsetBrush()\fP, \fBsetPen()\fP, \fBsetSize()\fP
  330. .RE
  331. .PP
  332. .SH "Member Function Documentation"
  333. .PP
  334. .SS "QRect QwtSymbol::boundingRect () const\fC [virtual]\fP"
  335. Calculate the bounding rectangle for a symbol at position (0,0)\&.
  336. .PP
  337. \fBReturns\fP
  338. .RS 4
  339. Bounding rectangle
  340. .RE
  341. .PP
  342. .SS "const QBrush & QwtSymbol::brush () const"
  343. .PP
  344. \fBReturns\fP
  345. .RS 4
  346. Brush
  347. .RE
  348. .PP
  349. \fBSee also\fP
  350. .RS 4
  351. \fBsetBrush()\fP
  352. .RE
  353. .PP
  354. .SS "\fBQwtSymbol::CachePolicy\fP QwtSymbol::cachePolicy () const"
  355. .PP
  356. \fBReturns\fP
  357. .RS 4
  358. Cache policy
  359. .RE
  360. .PP
  361. \fBSee also\fP
  362. .RS 4
  363. \fBCachePolicy\fP, \fBsetCachePolicy()\fP
  364. .RE
  365. .PP
  366. .SS "void QwtSymbol::drawSymbol (QPainter * painter, const QPointF & pos) const\fC [inline]\fP"
  367. .PP
  368. Draw the symbol at a specified position\&.
  369. .PP
  370. \fBParameters\fP
  371. .RS 4
  372. \fIpainter\fP Painter
  373. .br
  374. \fIpos\fP Position of the symbol in screen coordinates
  375. .RE
  376. .PP
  377. .SS "void QwtSymbol::drawSymbol (QPainter * painter, const QRectF & rect) const"
  378. .PP
  379. Draw the symbol into a rectangle\&. The symbol is painted centered and scaled into the target rectangle\&. It is always painted uncached and the pin point is ignored\&.
  380. .PP
  381. This method is primarily intended for drawing a symbol to the legend\&.
  382. .PP
  383. \fBParameters\fP
  384. .RS 4
  385. \fIpainter\fP Painter
  386. .br
  387. \fIrect\fP Target rectangle for the symbol
  388. .RE
  389. .PP
  390. .SS "void QwtSymbol::drawSymbols (QPainter * painter, const QPointF * points, int numPoints) const"
  391. Render an array of symbols
  392. .PP
  393. Painting several symbols is more effective than drawing symbols one by one, as a couple of layout calculations and setting of pen/brush can be done once for the complete array\&.
  394. .PP
  395. \fBParameters\fP
  396. .RS 4
  397. \fIpainter\fP Painter
  398. .br
  399. \fIpoints\fP Array of points
  400. .br
  401. \fInumPoints\fP Number of points
  402. .RE
  403. .PP
  404. .SS "void QwtSymbol::drawSymbols (QPainter * painter, const QPolygonF & points) const\fC [inline]\fP"
  405. .PP
  406. Draw symbols at the specified points\&.
  407. .PP
  408. \fBParameters\fP
  409. .RS 4
  410. \fIpainter\fP Painter
  411. .br
  412. \fIpoints\fP Positions of the symbols in screen coordinates
  413. .RE
  414. .PP
  415. .SS "const \fBQwtGraphic\fP & QwtSymbol::graphic () const"
  416. .PP
  417. \fBReturns\fP
  418. .RS 4
  419. Assigned graphic
  420. .RE
  421. .PP
  422. \fBSee also\fP
  423. .RS 4
  424. \fBsetGraphic()\fP
  425. .RE
  426. .PP
  427. .SS "void QwtSymbol::invalidateCache ()"
  428. Invalidate the cached symbol pixmap
  429. .PP
  430. The symbol invalidates its cache, whenever an attribute is changed that has an effect ob how to display a symbol\&. In case of derived classes with individual styles ( >= \fBQwtSymbol::UserStyle\fP ) it might be necessary to call \fBinvalidateCache()\fP for attributes that are relevant for this style\&.
  431. .PP
  432. \fBSee also\fP
  433. .RS 4
  434. \fBCachePolicy\fP, \fBsetCachePolicy()\fP, \fBdrawSymbols()\fP
  435. .RE
  436. .PP
  437. .SS "bool QwtSymbol::isPinPointEnabled () const"
  438. .PP
  439. \fBReturns\fP
  440. .RS 4
  441. True, when the pin point translation is enabled
  442. .RE
  443. .PP
  444. \fBSee also\fP
  445. .RS 4
  446. \fBsetPinPoint()\fP, \fBsetPinPointEnabled()\fP
  447. .RE
  448. .PP
  449. .SS "const QPainterPath & QwtSymbol::path () const"
  450. .PP
  451. \fBReturns\fP
  452. .RS 4
  453. Painter path for displaying the symbol
  454. .RE
  455. .PP
  456. \fBSee also\fP
  457. .RS 4
  458. \fBsetPath()\fP
  459. .RE
  460. .PP
  461. .SS "const QPen & QwtSymbol::pen () const"
  462. .PP
  463. \fBReturns\fP
  464. .RS 4
  465. Pen
  466. .RE
  467. .PP
  468. \fBSee also\fP
  469. .RS 4
  470. \fBsetPen()\fP, \fBbrush()\fP
  471. .RE
  472. .PP
  473. .SS "QPointF QwtSymbol::pinPoint () const"
  474. .PP
  475. \fBReturns\fP
  476. .RS 4
  477. Pin point
  478. .RE
  479. .PP
  480. \fBSee also\fP
  481. .RS 4
  482. \fBsetPinPoint()\fP, \fBsetPinPointEnabled()\fP
  483. .RE
  484. .PP
  485. .SS "const QPixmap & QwtSymbol::pixmap () const"
  486. .PP
  487. \fBReturns\fP
  488. .RS 4
  489. Assigned pixmap
  490. .RE
  491. .PP
  492. \fBSee also\fP
  493. .RS 4
  494. \fBsetPixmap()\fP
  495. .RE
  496. .PP
  497. .SS "void QwtSymbol::renderSymbols (QPainter * painter, const QPointF * points, int numPoints) const\fC [protected]\fP, \fC [virtual]\fP"
  498. Render the symbol to series of points
  499. .PP
  500. \fBParameters\fP
  501. .RS 4
  502. \fIpainter\fP Qt painter
  503. .br
  504. \fIpoints\fP Positions of the symbols
  505. .br
  506. \fInumPoints\fP Number of points
  507. .RE
  508. .PP
  509. .SS "void QwtSymbol::setBrush (const QBrush & brush)"
  510. .PP
  511. Assign a brush\&. The brush is used to draw the interior of the symbol\&.
  512. .PP
  513. \fBParameters\fP
  514. .RS 4
  515. \fIbrush\fP Brush
  516. .RE
  517. .PP
  518. \fBSee also\fP
  519. .RS 4
  520. \fBbrush()\fP
  521. .RE
  522. .PP
  523. .SS "void QwtSymbol::setCachePolicy (\fBQwtSymbol::CachePolicy\fP policy)"
  524. Change the cache policy
  525. .PP
  526. The default policy is AutoCache
  527. .PP
  528. \fBParameters\fP
  529. .RS 4
  530. \fIpolicy\fP Cache policy
  531. .RE
  532. .PP
  533. \fBSee also\fP
  534. .RS 4
  535. \fBCachePolicy\fP, \fBcachePolicy()\fP
  536. .RE
  537. .PP
  538. .SS "void QwtSymbol::setColor (const QColor & color)\fC [virtual]\fP"
  539. .PP
  540. Set the color of the symbol\&. Change the color of the brush for symbol types with a filled area\&. For all other symbol types the color will be assigned to the pen\&.
  541. .PP
  542. \fBParameters\fP
  543. .RS 4
  544. \fIcolor\fP Color
  545. .RE
  546. .PP
  547. \fBSee also\fP
  548. .RS 4
  549. \fBsetBrush()\fP, \fBsetPen()\fP, \fBbrush()\fP, \fBpen()\fP
  550. .RE
  551. .PP
  552. .SS "void QwtSymbol::setGraphic (const \fBQwtGraphic\fP & graphic)"
  553. Set a graphic as symbol
  554. .PP
  555. \fBParameters\fP
  556. .RS 4
  557. \fIgraphic\fP Graphic
  558. .RE
  559. .PP
  560. \fBSee also\fP
  561. .RS 4
  562. \fBgraphic()\fP, \fBsetPixmap()\fP
  563. .RE
  564. .PP
  565. \fBNote\fP
  566. .RS 4
  567. the \fBstyle()\fP is set to \fBQwtSymbol::Graphic\fP
  568. .PP
  569. \fBbrush()\fP and \fBpen()\fP have no effect
  570. .RE
  571. .PP
  572. .SS "void QwtSymbol::setPath (const QPainterPath & path)"
  573. .PP
  574. Set a painter path as symbol\&. The symbol is represented by a painter path, where the origin ( 0, 0 ) of the path coordinate system is mapped to the position of the symbol\&.
  575. .PP
  576. When the symbol has valid size the painter path gets scaled to fit into the size\&. Otherwise the symbol size depends on the bounding rectangle of the path\&.
  577. .PP
  578. \fBExample\fP
  579. .RS 4
  580. The following code defines a symbol drawing an arrow:
  581. .RE
  582. .PP
  583. .PP
  584. .nf
  585. #include <qwt_symbol\&.h>
  586. QwtSymbol *symbol = new QwtSymbol();
  587. QPen pen( Qt::black, 2 );
  588. pen\&.setJoinStyle( Qt::MiterJoin );
  589. symbol->setPen( pen );
  590. symbol->setBrush( Qt::red );
  591. QPainterPath path;
  592. path\&.moveTo( 0, 8 );
  593. path\&.lineTo( 0, 5 );
  594. path\&.lineTo( -3, 5 );
  595. path\&.lineTo( 0, 0 );
  596. path\&.lineTo( 3, 5 );
  597. path\&.lineTo( 0, 5 );
  598. QTransform transform;
  599. transform\&.rotate( -30\&.0 );
  600. path = transform\&.map( path );
  601. symbol->setPath( path );
  602. symbol->setPinPoint( QPointF( 0\&.0, 0\&.0 ) );
  603. setSize( 10, 14 );
  604. .fi
  605. .PP
  606. \\endpar
  607. .PP
  608. \fBParameters\fP
  609. .RS 4
  610. \fIpath\fP Painter path
  611. .RE
  612. .PP
  613. \fBNote\fP
  614. .RS 4
  615. The style is implicitely set to \fBQwtSymbol::Path\fP\&.
  616. .RE
  617. .PP
  618. \fBSee also\fP
  619. .RS 4
  620. \fBpath()\fP, \fBsetSize()\fP
  621. .RE
  622. .PP
  623. .SS "void QwtSymbol::setPen (const QColor & color, qreal width = \fC0\&.0\fP, Qt::PenStyle style = \fCQt::SolidLine\fP)"
  624. Build and assign a pen
  625. .PP
  626. 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\&.
  627. .PP
  628. \fBParameters\fP
  629. .RS 4
  630. \fIcolor\fP Pen color
  631. .br
  632. \fIwidth\fP Pen width
  633. .br
  634. \fIstyle\fP Pen style
  635. .RE
  636. .PP
  637. \fBSee also\fP
  638. .RS 4
  639. \fBpen()\fP, \fBbrush()\fP
  640. .RE
  641. .PP
  642. .SS "void QwtSymbol::setPen (const QPen & pen)"
  643. Assign a pen
  644. .PP
  645. The pen is used to draw the symbol's outline\&.
  646. .PP
  647. \fBParameters\fP
  648. .RS 4
  649. \fIpen\fP Pen
  650. .RE
  651. .PP
  652. \fBSee also\fP
  653. .RS 4
  654. \fBpen()\fP, \fBsetBrush()\fP
  655. .RE
  656. .PP
  657. .SS "void QwtSymbol::setPinPoint (const QPointF & pos, bool enable = \fCtrue\fP)"
  658. .PP
  659. Set and enable a pin point\&. The position of a complex symbol is not always aligned to its center ( f\&.e an arrow, where the peak points to a position )\&. The pin point defines the position inside of a Pixmap, Graphic, SvgDocument or PainterPath symbol where the represented point has to be aligned to\&.
  660. .PP
  661. \fBParameters\fP
  662. .RS 4
  663. \fIpos\fP Position
  664. .br
  665. \fIenable\fP En/Disable the pin point alignment
  666. .RE
  667. .PP
  668. \fBSee also\fP
  669. .RS 4
  670. \fBpinPoint()\fP, \fBsetPinPointEnabled()\fP
  671. .RE
  672. .PP
  673. .SS "void QwtSymbol::setPinPointEnabled (bool on)"
  674. En/Disable the pin point alignment
  675. .PP
  676. \fBParameters\fP
  677. .RS 4
  678. \fIon\fP Enabled, when on is true
  679. .RE
  680. .PP
  681. \fBSee also\fP
  682. .RS 4
  683. \fBsetPinPoint()\fP, \fBisPinPointEnabled()\fP
  684. .RE
  685. .PP
  686. .SS "void QwtSymbol::setPixmap (const QPixmap & pixmap)"
  687. Set a pixmap as symbol
  688. .PP
  689. \fBParameters\fP
  690. .RS 4
  691. \fIpixmap\fP Pixmap
  692. .RE
  693. .PP
  694. \fBSee also\fP
  695. .RS 4
  696. \fBpixmap()\fP, \fBsetGraphic()\fP
  697. .RE
  698. .PP
  699. \fBNote\fP
  700. .RS 4
  701. the \fBstyle()\fP is set to \fBQwtSymbol::Pixmap\fP
  702. .PP
  703. \fBbrush()\fP and \fBpen()\fP have no effect
  704. .RE
  705. .PP
  706. .SS "void QwtSymbol::setSize (const QSize & size)"
  707. Set the symbol's size
  708. .PP
  709. \fBParameters\fP
  710. .RS 4
  711. \fIsize\fP Size
  712. .RE
  713. .PP
  714. \fBSee also\fP
  715. .RS 4
  716. \fBsize()\fP
  717. .RE
  718. .PP
  719. .SS "void QwtSymbol::setSize (int width, int height = \fC\-1\fP)"
  720. .PP
  721. Specify the symbol's size\&. If the 'h' parameter is left out or less than 0, and the 'w' parameter is greater than or equal to 0, the symbol size will be set to (w,w)\&.
  722. .PP
  723. \fBParameters\fP
  724. .RS 4
  725. \fIwidth\fP Width
  726. .br
  727. \fIheight\fP Height (defaults to -1)
  728. .RE
  729. .PP
  730. \fBSee also\fP
  731. .RS 4
  732. \fBsize()\fP
  733. .RE
  734. .PP
  735. .SS "void QwtSymbol::setStyle (\fBQwtSymbol::Style\fP style)"
  736. Specify the symbol style
  737. .PP
  738. \fBParameters\fP
  739. .RS 4
  740. \fIstyle\fP Style
  741. .RE
  742. .PP
  743. \fBSee also\fP
  744. .RS 4
  745. \fBstyle()\fP
  746. .RE
  747. .PP
  748. .SS "void QwtSymbol::setSvgDocument (const QByteArray & svgDocument)"
  749. Set a SVG icon as symbol
  750. .PP
  751. \fBParameters\fP
  752. .RS 4
  753. \fIsvgDocument\fP SVG icon
  754. .RE
  755. .PP
  756. \fBSee also\fP
  757. .RS 4
  758. \fBsetGraphic()\fP, \fBsetPixmap()\fP
  759. .RE
  760. .PP
  761. \fBNote\fP
  762. .RS 4
  763. the \fBstyle()\fP is set to \fBQwtSymbol::SvgDocument\fP
  764. .PP
  765. \fBbrush()\fP and \fBpen()\fP have no effect
  766. .RE
  767. .PP
  768. .SS "const QSize & QwtSymbol::size () const"
  769. .PP
  770. \fBReturns\fP
  771. .RS 4
  772. Size
  773. .RE
  774. .PP
  775. \fBSee also\fP
  776. .RS 4
  777. \fBsetSize()\fP
  778. .RE
  779. .PP
  780. .SS "\fBQwtSymbol::Style\fP QwtSymbol::style () const"
  781. .PP
  782. \fBReturns\fP
  783. .RS 4
  784. Current symbol style
  785. .RE
  786. .PP
  787. \fBSee also\fP
  788. .RS 4
  789. \fBsetStyle()\fP
  790. .RE
  791. .PP
  792. .SH "Author"
  793. .PP
  794. Generated automatically by Doxygen for Qwt User's Guide from the source code\&.