QwtPlotRenderer.3 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527
  1. .TH "QwtPlotRenderer" 3 "Mon Dec 28 2020" "Version 6.1.6" "Qwt User's Guide" \" -*- nroff -*-
  2. .ad l
  3. .nh
  4. .SH NAME
  5. QwtPlotRenderer \- Renderer for exporting a plot to a document, a printer or anything else, that is supported by QPainter/QPaintDevice\&.
  6. .SH SYNOPSIS
  7. .br
  8. .PP
  9. .PP
  10. \fC#include <qwt_plot_renderer\&.h>\fP
  11. .PP
  12. Inherits QObject\&.
  13. .SS "Public Types"
  14. .in +1c
  15. .ti -1c
  16. .RI "enum \fBDiscardFlag\fP { \fBDiscardNone\fP = 0x00, \fBDiscardBackground\fP = 0x01, \fBDiscardTitle\fP = 0x02, \fBDiscardLegend\fP = 0x04, \fBDiscardCanvasBackground\fP = 0x08, \fBDiscardFooter\fP = 0x10, \fBDiscardCanvasFrame\fP = 0x20 }"
  17. .br
  18. .RI "Disard flags\&. "
  19. .ti -1c
  20. .RI "enum \fBLayoutFlag\fP { \fBDefaultLayout\fP = 0x00, \fBFrameWithScales\fP = 0x01 }"
  21. .br
  22. .RI "Layout flags\&. "
  23. .ti -1c
  24. .RI "typedef QFlags< \fBDiscardFlag\fP > \fBDiscardFlags\fP"
  25. .br
  26. .RI "Disard flags\&. "
  27. .ti -1c
  28. .RI "typedef QFlags< \fBLayoutFlag\fP > \fBLayoutFlags\fP"
  29. .br
  30. .RI "Layout flags\&. "
  31. .in -1c
  32. .SS "Public Member Functions"
  33. .in +1c
  34. .ti -1c
  35. .RI "\fBQwtPlotRenderer\fP (QObject *=NULL)"
  36. .br
  37. .ti -1c
  38. .RI "virtual \fB~QwtPlotRenderer\fP ()"
  39. .br
  40. .RI "Destructor\&. "
  41. .ti -1c
  42. .RI "void \fBsetDiscardFlag\fP (\fBDiscardFlag\fP flag, bool on=true)"
  43. .br
  44. .ti -1c
  45. .RI "bool \fBtestDiscardFlag\fP (\fBDiscardFlag\fP flag) const"
  46. .br
  47. .ti -1c
  48. .RI "void \fBsetDiscardFlags\fP (\fBDiscardFlags\fP flags)"
  49. .br
  50. .ti -1c
  51. .RI "\fBDiscardFlags\fP \fBdiscardFlags\fP () const"
  52. .br
  53. .ti -1c
  54. .RI "void \fBsetLayoutFlag\fP (\fBLayoutFlag\fP flag, bool on=true)"
  55. .br
  56. .ti -1c
  57. .RI "bool \fBtestLayoutFlag\fP (\fBLayoutFlag\fP flag) const"
  58. .br
  59. .ti -1c
  60. .RI "void \fBsetLayoutFlags\fP (\fBLayoutFlags\fP flags)"
  61. .br
  62. .ti -1c
  63. .RI "\fBLayoutFlags\fP \fBlayoutFlags\fP () const"
  64. .br
  65. .ti -1c
  66. .RI "void \fBrenderDocument\fP (\fBQwtPlot\fP *, const QString &fileName, const QSizeF &sizeMM, int resolution=85)"
  67. .br
  68. .ti -1c
  69. .RI "void \fBrenderDocument\fP (\fBQwtPlot\fP *, const QString &fileName, const QString &format, const QSizeF &sizeMM, int resolution=85)"
  70. .br
  71. .ti -1c
  72. .RI "void \fBrenderTo\fP (\fBQwtPlot\fP *, QPrinter &) const"
  73. .br
  74. .RI "Render the plot to a QPrinter\&. "
  75. .ti -1c
  76. .RI "void \fBrenderTo\fP (\fBQwtPlot\fP *, QPaintDevice &) const"
  77. .br
  78. .RI "Render the plot to a \fCQPaintDevice\fP\&. "
  79. .ti -1c
  80. .RI "virtual void \fBrender\fP (\fBQwtPlot\fP *, QPainter *, const QRectF &plotRect) const"
  81. .br
  82. .ti -1c
  83. .RI "virtual void \fBrenderTitle\fP (const \fBQwtPlot\fP *, QPainter *, const QRectF &titleRect) const"
  84. .br
  85. .ti -1c
  86. .RI "virtual void \fBrenderFooter\fP (const \fBQwtPlot\fP *, QPainter *, const QRectF &footerRect) const"
  87. .br
  88. .ti -1c
  89. .RI "virtual void \fBrenderScale\fP (const \fBQwtPlot\fP *, QPainter *, int axisId, int startDist, int endDist, int baseDist, const QRectF &scaleRect) const"
  90. .br
  91. .RI "Paint a scale into a given rectangle\&. Paint the scale into a given rectangle\&. "
  92. .ti -1c
  93. .RI "virtual void \fBrenderCanvas\fP (const \fBQwtPlot\fP *, QPainter *, const QRectF &canvasRect, const \fBQwtScaleMap\fP *maps) const"
  94. .br
  95. .ti -1c
  96. .RI "virtual void \fBrenderLegend\fP (const \fBQwtPlot\fP *, QPainter *, const QRectF &legendRect) const"
  97. .br
  98. .ti -1c
  99. .RI "bool \fBexportTo\fP (\fBQwtPlot\fP *, const QString &documentName, const QSizeF &sizeMM=QSizeF(300, 200), int resolution=85)"
  100. .br
  101. .RI "Execute a file dialog and render the plot to the selected file\&. "
  102. .in -1c
  103. .SH "Detailed Description"
  104. .PP
  105. Renderer for exporting a plot to a document, a printer or anything else, that is supported by QPainter/QPaintDevice\&.
  106. .SH "Member Enumeration Documentation"
  107. .PP
  108. .SS "enum \fBQwtPlotRenderer::DiscardFlag\fP"
  109. .PP
  110. Disard flags\&.
  111. .PP
  112. \fBEnumerator\fP
  113. .in +1c
  114. .TP
  115. \fB\fIDiscardNone \fP\fP
  116. Render all components of the plot\&.
  117. .TP
  118. \fB\fIDiscardBackground \fP\fP
  119. Don't render the background of the plot\&.
  120. .TP
  121. \fB\fIDiscardTitle \fP\fP
  122. Don't render the title of the plot\&.
  123. .TP
  124. \fB\fIDiscardLegend \fP\fP
  125. Don't render the legend of the plot\&.
  126. .TP
  127. \fB\fIDiscardCanvasBackground \fP\fP
  128. Don't render the background of the canvas\&.
  129. .TP
  130. \fB\fIDiscardFooter \fP\fP
  131. Don't render the footer of the plot\&.
  132. .TP
  133. \fB\fIDiscardCanvasFrame \fP\fP
  134. Don't render the frame of the canvas
  135. .PP
  136. \fBNote\fP
  137. .RS 4
  138. This flag has no effect when using style sheets, where the frame is part of the background
  139. .RE
  140. .PP
  141. .SS "enum \fBQwtPlotRenderer::LayoutFlag\fP"
  142. .PP
  143. Layout flags\&.
  144. .PP
  145. \fBSee also\fP
  146. .RS 4
  147. \fBsetLayoutFlag()\fP, \fBtestLayoutFlag()\fP
  148. .RE
  149. .PP
  150. .PP
  151. \fBEnumerator\fP
  152. .in +1c
  153. .TP
  154. \fB\fIDefaultLayout \fP\fP
  155. Use the default layout as on screen\&.
  156. .TP
  157. \fB\fIFrameWithScales \fP\fP
  158. Instead of the scales a box is painted around the plot canvas, where the scale ticks are aligned to\&.
  159. .SH "Constructor & Destructor Documentation"
  160. .PP
  161. .SS "QwtPlotRenderer::QwtPlotRenderer (QObject * parent = \fCNULL\fP)\fC [explicit]\fP"
  162. Constructor
  163. .PP
  164. \fBParameters\fP
  165. .RS 4
  166. \fIparent\fP Parent object
  167. .RE
  168. .PP
  169. .SH "Member Function Documentation"
  170. .PP
  171. .SS "\fBQwtPlotRenderer::DiscardFlags\fP QwtPlotRenderer::discardFlags () const"
  172. .PP
  173. \fBReturns\fP
  174. .RS 4
  175. Flags, indicating what to discard from rendering
  176. .RE
  177. .PP
  178. \fBSee also\fP
  179. .RS 4
  180. \fBDiscardFlag\fP, \fBsetDiscardFlags()\fP, \fBsetDiscardFlag()\fP, \fBtestDiscardFlag()\fP
  181. .RE
  182. .PP
  183. .SS "bool QwtPlotRenderer::exportTo (\fBQwtPlot\fP * plot, const QString & documentName, const QSizeF & sizeMM = \fCQSizeF( 300, 200 )\fP, int resolution = \fC85\fP)"
  184. .PP
  185. Execute a file dialog and render the plot to the selected file\&.
  186. .PP
  187. \fBParameters\fP
  188. .RS 4
  189. \fIplot\fP Plot widget
  190. .br
  191. \fIdocumentName\fP Default document name
  192. .br
  193. \fIsizeMM\fP Size for the document in millimeters\&.
  194. .br
  195. \fIresolution\fP Resolution in dots per Inch (dpi)
  196. .RE
  197. .PP
  198. \fBReturns\fP
  199. .RS 4
  200. True, when exporting was successful
  201. .RE
  202. .PP
  203. \fBSee also\fP
  204. .RS 4
  205. \fBrenderDocument()\fP
  206. .RE
  207. .PP
  208. .SS "\fBQwtPlotRenderer::LayoutFlags\fP QwtPlotRenderer::layoutFlags () const"
  209. .PP
  210. \fBReturns\fP
  211. .RS 4
  212. Layout flags
  213. .RE
  214. .PP
  215. \fBSee also\fP
  216. .RS 4
  217. \fBLayoutFlag\fP, \fBsetLayoutFlags()\fP, \fBsetLayoutFlag()\fP, \fBtestLayoutFlag()\fP
  218. .RE
  219. .PP
  220. .SS "void QwtPlotRenderer::render (\fBQwtPlot\fP * plot, QPainter * painter, const QRectF & plotRect) const\fC [virtual]\fP"
  221. Paint the contents of a \fBQwtPlot\fP instance into a given rectangle\&.
  222. .PP
  223. \fBParameters\fP
  224. .RS 4
  225. \fIplot\fP Plot to be rendered
  226. .br
  227. \fIpainter\fP Painter
  228. .br
  229. \fIplotRect\fP Bounding rectangle
  230. .RE
  231. .PP
  232. \fBSee also\fP
  233. .RS 4
  234. \fBrenderDocument()\fP, \fBrenderTo()\fP, \fBQwtPainter::setRoundingAlignment()\fP
  235. .RE
  236. .PP
  237. .SS "void QwtPlotRenderer::renderCanvas (const \fBQwtPlot\fP * plot, QPainter * painter, const QRectF & canvasRect, const \fBQwtScaleMap\fP * maps) const\fC [virtual]\fP"
  238. Render the canvas into a given rectangle\&.
  239. .PP
  240. \fBParameters\fP
  241. .RS 4
  242. \fIplot\fP Plot widget
  243. .br
  244. \fIpainter\fP Painter
  245. .br
  246. \fImaps\fP Maps mapping between plot and paint device coordinates
  247. .br
  248. \fIcanvasRect\fP Canvas rectangle
  249. .RE
  250. .PP
  251. .SS "void QwtPlotRenderer::renderDocument (\fBQwtPlot\fP * plot, const QString & fileName, const QSizeF & sizeMM, int resolution = \fC85\fP)"
  252. Render a plot to a file
  253. .PP
  254. The format of the document will be auto-detected from the suffix of the file name\&.
  255. .PP
  256. \fBParameters\fP
  257. .RS 4
  258. \fIplot\fP Plot widget
  259. .br
  260. \fIfileName\fP Path of the file, where the document will be stored
  261. .br
  262. \fIsizeMM\fP Size for the document in millimeters\&.
  263. .br
  264. \fIresolution\fP Resolution in dots per Inch (dpi)
  265. .RE
  266. .PP
  267. .SS "void QwtPlotRenderer::renderDocument (\fBQwtPlot\fP * plot, const QString & fileName, const QString & format, const QSizeF & sizeMM, int resolution = \fC85\fP)"
  268. Render a plot to a file
  269. .PP
  270. Supported formats are:
  271. .PP
  272. .IP "\(bu" 2
  273. pdf
  274. .br
  275. Portable Document Format PDF
  276. .IP "\(bu" 2
  277. ps
  278. .br
  279. Postcript
  280. .IP "\(bu" 2
  281. svg
  282. .br
  283. Scalable Vector Graphics SVG
  284. .IP "\(bu" 2
  285. all image formats supported by Qt
  286. .br
  287. see QImageWriter::supportedImageFormats()
  288. .PP
  289. .PP
  290. Scalable vector graphic formats like PDF or SVG are superior to raster graphics formats\&.
  291. .PP
  292. \fBParameters\fP
  293. .RS 4
  294. \fIplot\fP Plot widget
  295. .br
  296. \fIfileName\fP Path of the file, where the document will be stored
  297. .br
  298. \fIformat\fP Format for the document
  299. .br
  300. \fIsizeMM\fP Size for the document in millimeters\&.
  301. .br
  302. \fIresolution\fP Resolution in dots per Inch (dpi)
  303. .RE
  304. .PP
  305. \fBSee also\fP
  306. .RS 4
  307. \fBrenderTo()\fP, \fBrender()\fP, \fBQwtPainter::setRoundingAlignment()\fP
  308. .RE
  309. .PP
  310. .SS "void QwtPlotRenderer::renderFooter (const \fBQwtPlot\fP * plot, QPainter * painter, const QRectF & footerRect) const\fC [virtual]\fP"
  311. Render the footer into a given rectangle\&.
  312. .PP
  313. \fBParameters\fP
  314. .RS 4
  315. \fIplot\fP Plot widget
  316. .br
  317. \fIpainter\fP Painter
  318. .br
  319. \fIfooterRect\fP Bounding rectangle for the footer
  320. .RE
  321. .PP
  322. .SS "void QwtPlotRenderer::renderLegend (const \fBQwtPlot\fP * plot, QPainter * painter, const QRectF & legendRect) const\fC [virtual]\fP"
  323. Render the legend into a given rectangle\&.
  324. .PP
  325. \fBParameters\fP
  326. .RS 4
  327. \fIplot\fP Plot widget
  328. .br
  329. \fIpainter\fP Painter
  330. .br
  331. \fIlegendRect\fP Bounding rectangle for the legend
  332. .RE
  333. .PP
  334. .SS "void QwtPlotRenderer::renderScale (const \fBQwtPlot\fP * plot, QPainter * painter, int axisId, int startDist, int endDist, int baseDist, const QRectF & scaleRect) const\fC [virtual]\fP"
  335. .PP
  336. Paint a scale into a given rectangle\&. Paint the scale into a given rectangle\&.
  337. .PP
  338. \fBParameters\fP
  339. .RS 4
  340. \fIplot\fP Plot widget
  341. .br
  342. \fIpainter\fP Painter
  343. .br
  344. \fIaxisId\fP Axis
  345. .br
  346. \fIstartDist\fP Start border distance
  347. .br
  348. \fIendDist\fP End border distance
  349. .br
  350. \fIbaseDist\fP Base distance
  351. .br
  352. \fIscaleRect\fP Bounding rectangle for the scale
  353. .RE
  354. .PP
  355. .SS "void QwtPlotRenderer::renderTitle (const \fBQwtPlot\fP * plot, QPainter * painter, const QRectF & titleRect) const\fC [virtual]\fP"
  356. Render the title into a given rectangle\&.
  357. .PP
  358. \fBParameters\fP
  359. .RS 4
  360. \fIplot\fP Plot widget
  361. .br
  362. \fIpainter\fP Painter
  363. .br
  364. \fItitleRect\fP Bounding rectangle for the title
  365. .RE
  366. .PP
  367. .SS "void QwtPlotRenderer::renderTo (\fBQwtPlot\fP * plot, QPaintDevice & paintDevice) const"
  368. .PP
  369. Render the plot to a \fCQPaintDevice\fP\&. This function renders the contents of a \fBQwtPlot\fP instance to \fCQPaintDevice\fP object\&. The target rectangle is derived from its device metrics\&.
  370. .PP
  371. \fBParameters\fP
  372. .RS 4
  373. \fIplot\fP Plot to be rendered
  374. .br
  375. \fIpaintDevice\fP device to paint on, f\&.e a QImage
  376. .RE
  377. .PP
  378. \fBSee also\fP
  379. .RS 4
  380. \fBrenderDocument()\fP, \fBrender()\fP, \fBQwtPainter::setRoundingAlignment()\fP
  381. .RE
  382. .PP
  383. .SS "void QwtPlotRenderer::renderTo (\fBQwtPlot\fP * plot, QPrinter & printer) const"
  384. .PP
  385. Render the plot to a QPrinter\&. This function renders the contents of a \fBQwtPlot\fP instance to \fCQPaintDevice\fP object\&. The size is derived from the printer metrics\&.
  386. .PP
  387. \fBParameters\fP
  388. .RS 4
  389. \fIplot\fP Plot to be rendered
  390. .br
  391. \fIprinter\fP Printer to paint on
  392. .RE
  393. .PP
  394. \fBSee also\fP
  395. .RS 4
  396. \fBrenderDocument()\fP, \fBrender()\fP, \fBQwtPainter::setRoundingAlignment()\fP
  397. .RE
  398. .PP
  399. .SS "void QwtPlotRenderer::setDiscardFlag (\fBDiscardFlag\fP flag, bool on = \fCtrue\fP)"
  400. Change a flag, indicating what to discard from rendering
  401. .PP
  402. \fBParameters\fP
  403. .RS 4
  404. \fIflag\fP Flag to change
  405. .br
  406. \fIon\fP On/Off
  407. .RE
  408. .PP
  409. \fBSee also\fP
  410. .RS 4
  411. \fBDiscardFlag\fP, \fBtestDiscardFlag()\fP, \fBsetDiscardFlags()\fP, \fBdiscardFlags()\fP
  412. .RE
  413. .PP
  414. .SS "void QwtPlotRenderer::setDiscardFlags (\fBDiscardFlags\fP flags)"
  415. Set the flags, indicating what to discard from rendering
  416. .PP
  417. \fBParameters\fP
  418. .RS 4
  419. \fIflags\fP Flags
  420. .RE
  421. .PP
  422. \fBSee also\fP
  423. .RS 4
  424. \fBDiscardFlag\fP, \fBsetDiscardFlag()\fP, \fBtestDiscardFlag()\fP, \fBdiscardFlags()\fP
  425. .RE
  426. .PP
  427. .SS "void QwtPlotRenderer::setLayoutFlag (\fBLayoutFlag\fP flag, bool on = \fCtrue\fP)"
  428. Change a layout flag
  429. .PP
  430. \fBParameters\fP
  431. .RS 4
  432. \fIflag\fP Flag to change
  433. .br
  434. \fIon\fP On/Off
  435. .RE
  436. .PP
  437. \fBSee also\fP
  438. .RS 4
  439. \fBLayoutFlag\fP, \fBtestLayoutFlag()\fP, \fBsetLayoutFlags()\fP, \fBlayoutFlags()\fP
  440. .RE
  441. .PP
  442. .SS "void QwtPlotRenderer::setLayoutFlags (\fBLayoutFlags\fP flags)"
  443. Set the layout flags
  444. .PP
  445. \fBParameters\fP
  446. .RS 4
  447. \fIflags\fP Flags
  448. .RE
  449. .PP
  450. \fBSee also\fP
  451. .RS 4
  452. \fBLayoutFlag\fP, \fBsetLayoutFlag()\fP, \fBtestLayoutFlag()\fP, \fBlayoutFlags()\fP
  453. .RE
  454. .PP
  455. .SS "bool QwtPlotRenderer::testDiscardFlag (\fBDiscardFlag\fP flag) const"
  456. .PP
  457. \fBReturns\fP
  458. .RS 4
  459. True, if flag is enabled\&.
  460. .RE
  461. .PP
  462. \fBParameters\fP
  463. .RS 4
  464. \fIflag\fP Flag to be tested
  465. .RE
  466. .PP
  467. \fBSee also\fP
  468. .RS 4
  469. \fBDiscardFlag\fP, \fBsetDiscardFlag()\fP, \fBsetDiscardFlags()\fP, \fBdiscardFlags()\fP
  470. .RE
  471. .PP
  472. .SS "bool QwtPlotRenderer::testLayoutFlag (\fBLayoutFlag\fP flag) const"
  473. .PP
  474. \fBReturns\fP
  475. .RS 4
  476. True, if flag is enabled\&.
  477. .RE
  478. .PP
  479. \fBParameters\fP
  480. .RS 4
  481. \fIflag\fP Flag to be tested
  482. .RE
  483. .PP
  484. \fBSee also\fP
  485. .RS 4
  486. \fBLayoutFlag\fP, \fBsetLayoutFlag()\fP, \fBsetLayoutFlags()\fP, \fBlayoutFlags()\fP
  487. .RE
  488. .PP
  489. .SH "Author"
  490. .PP
  491. Generated automatically by Doxygen for Qwt User's Guide from the source code\&.