QwtPlotCanvas.3 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397
  1. .TH "QwtPlotCanvas" 3 "Mon Dec 28 2020" "Version 6.1.6" "Qwt User's Guide" \" -*- nroff -*-
  2. .ad l
  3. .nh
  4. .SH NAME
  5. QwtPlotCanvas \- Canvas of a \fBQwtPlot\fP\&.
  6. .SH SYNOPSIS
  7. .br
  8. .PP
  9. .PP
  10. \fC#include <qwt_plot_canvas\&.h>\fP
  11. .PP
  12. Inherits QFrame\&.
  13. .SS "Public Types"
  14. .in +1c
  15. .ti -1c
  16. .RI "enum \fBPaintAttribute\fP { \fBBackingStore\fP = 1, \fBOpaque\fP = 2, \fBHackStyledBackground\fP = 4, \fBImmediatePaint\fP = 8 }"
  17. .br
  18. .RI "Paint attributes\&. "
  19. .ti -1c
  20. .RI "enum \fBFocusIndicator\fP { \fBNoFocusIndicator\fP, \fBCanvasFocusIndicator\fP, \fBItemFocusIndicator\fP }"
  21. .br
  22. .RI "Focus indicator The default setting is NoFocusIndicator\&. "
  23. .ti -1c
  24. .RI "typedef QFlags< \fBPaintAttribute\fP > \fBPaintAttributes\fP"
  25. .br
  26. .RI "Paint attributes\&. "
  27. .in -1c
  28. .SS "Public Slots"
  29. .in +1c
  30. .ti -1c
  31. .RI "void \fBreplot\fP ()"
  32. .br
  33. .in -1c
  34. .SS "Public Member Functions"
  35. .in +1c
  36. .ti -1c
  37. .RI "\fBQwtPlotCanvas\fP (\fBQwtPlot\fP *=NULL)"
  38. .br
  39. .RI "Constructor\&. "
  40. .ti -1c
  41. .RI "virtual \fB~QwtPlotCanvas\fP ()"
  42. .br
  43. .RI "Destructor\&. "
  44. .ti -1c
  45. .RI "\fBQwtPlot\fP * \fBplot\fP ()"
  46. .br
  47. .RI "Return parent plot widget\&. "
  48. .ti -1c
  49. .RI "const \fBQwtPlot\fP * \fBplot\fP () const"
  50. .br
  51. .RI "Return parent plot widget\&. "
  52. .ti -1c
  53. .RI "void \fBsetFocusIndicator\fP (\fBFocusIndicator\fP)"
  54. .br
  55. .ti -1c
  56. .RI "\fBFocusIndicator\fP \fBfocusIndicator\fP () const"
  57. .br
  58. .ti -1c
  59. .RI "void \fBsetBorderRadius\fP (double)"
  60. .br
  61. .ti -1c
  62. .RI "double \fBborderRadius\fP () const"
  63. .br
  64. .ti -1c
  65. .RI "void \fBsetPaintAttribute\fP (\fBPaintAttribute\fP, bool on=true)"
  66. .br
  67. .RI "Changing the paint attributes\&. "
  68. .ti -1c
  69. .RI "bool \fBtestPaintAttribute\fP (\fBPaintAttribute\fP) const"
  70. .br
  71. .ti -1c
  72. .RI "const QPixmap * \fBbackingStore\fP () const"
  73. .br
  74. .ti -1c
  75. .RI "void \fBinvalidateBackingStore\fP ()"
  76. .br
  77. .RI "Invalidate the internal backing store\&. "
  78. .ti -1c
  79. .RI "virtual bool \fBevent\fP (QEvent *)"
  80. .br
  81. .ti -1c
  82. .RI "Q_INVOKABLE QPainterPath \fBborderPath\fP (const QRect &) const"
  83. .br
  84. .in -1c
  85. .SS "Protected Member Functions"
  86. .in +1c
  87. .ti -1c
  88. .RI "virtual void \fBpaintEvent\fP (QPaintEvent *)"
  89. .br
  90. .ti -1c
  91. .RI "virtual void \fBresizeEvent\fP (QResizeEvent *)"
  92. .br
  93. .ti -1c
  94. .RI "virtual void \fBdrawFocusIndicator\fP (QPainter *)"
  95. .br
  96. .ti -1c
  97. .RI "virtual void \fBdrawBorder\fP (QPainter *)"
  98. .br
  99. .ti -1c
  100. .RI "void \fBupdateStyleSheetInfo\fP ()"
  101. .br
  102. .RI "Update the cached information about the current style sheet\&. "
  103. .in -1c
  104. .SH "Detailed Description"
  105. .PP
  106. Canvas of a \fBQwtPlot\fP\&.
  107. Canvas is the widget where all plot items are displayed
  108. .PP
  109. \fBSee also\fP
  110. .RS 4
  111. \fBQwtPlot::setCanvas()\fP, \fBQwtPlotGLCanvas\fP
  112. .RE
  113. .PP
  114. .SH "Member Enumeration Documentation"
  115. .PP
  116. .SS "enum \fBQwtPlotCanvas::FocusIndicator\fP"
  117. .PP
  118. Focus indicator The default setting is NoFocusIndicator\&.
  119. .PP
  120. \fBSee also\fP
  121. .RS 4
  122. \fBsetFocusIndicator()\fP, \fBfocusIndicator()\fP, \fBdrawFocusIndicator()\fP
  123. .RE
  124. .PP
  125. .PP
  126. \fBEnumerator\fP
  127. .in +1c
  128. .TP
  129. \fB\fINoFocusIndicator \fP\fP
  130. Don't paint a focus indicator\&.
  131. .TP
  132. \fB\fICanvasFocusIndicator \fP\fP
  133. The focus is related to the complete canvas\&. Paint the focus indicator using \fBdrawFocusIndicator()\fP
  134. .TP
  135. \fB\fIItemFocusIndicator \fP\fP
  136. The focus is related to an item (curve, point, \&.\&.\&.) on the canvas\&. It is up to the application to display a focus indication using f\&.e\&. highlighting\&.
  137. .SS "enum \fBQwtPlotCanvas::PaintAttribute\fP"
  138. .PP
  139. Paint attributes\&. The default setting enables BackingStore and Opaque\&.
  140. .PP
  141. \fBSee also\fP
  142. .RS 4
  143. \fBsetPaintAttribute()\fP, \fBtestPaintAttribute()\fP
  144. .RE
  145. .PP
  146. .PP
  147. \fBEnumerator\fP
  148. .in +1c
  149. .TP
  150. \fB\fIBackingStore \fP\fP
  151. Paint double buffered reusing the content of the pixmap buffer when possible\&. Using a backing store might improve the performance significantly, when working with widget overlays ( like rubber bands )\&. Disabling the cache might improve the performance for incremental paints (using \fBQwtPlotDirectPainter\fP )\&.
  152. .PP
  153. \fBSee also\fP
  154. .RS 4
  155. \fBbackingStore()\fP, \fBinvalidateBackingStore()\fP
  156. .RE
  157. .PP
  158. .TP
  159. \fB\fIOpaque \fP\fP
  160. Try to fill the complete contents rectangle of the plot canvas\&. When using styled backgrounds Qt assumes, that the canvas doesn't fill its area completely ( f\&.e because of rounded borders ) and fills the area below the canvas\&. When this is done with gradients it might result in a serious performance bottleneck - depending on the size\&.
  161. .PP
  162. When the Opaque attribute is enabled the canvas tries to identify the gaps with some heuristics and to fill those only\&.
  163. .PP
  164. \fBWarning\fP
  165. .RS 4
  166. Will not work for semitransparent backgrounds
  167. .RE
  168. .PP
  169. .TP
  170. \fB\fIHackStyledBackground \fP\fP
  171. Try to improve painting of styled backgrounds\&. \fBQwtPlotCanvas\fP supports the box model attributes for customizing the layout with style sheets\&. Unfortunately the design of Qt style sheets has no concept how to handle backgrounds with rounded corners - beside of padding\&.
  172. .PP
  173. When HackStyledBackground is enabled the plot canvas tries to separate the background from the background border by reverse engineering to paint the background before and the border after the plot items\&. In this order the border gets perfectly antialiased and you can avoid some pixel artifacts in the corners\&.
  174. .TP
  175. \fB\fIImmediatePaint \fP\fP
  176. When ImmediatePaint is set \fBreplot()\fP calls repaint() instead of update()\&.
  177. .PP
  178. \fBSee also\fP
  179. .RS 4
  180. \fBreplot()\fP, QWidget::repaint(), QWidget::update()
  181. .RE
  182. .PP
  183. .SH "Constructor & Destructor Documentation"
  184. .PP
  185. .SS "QwtPlotCanvas::QwtPlotCanvas (\fBQwtPlot\fP * plot = \fCNULL\fP)\fC [explicit]\fP"
  186. .PP
  187. Constructor\&.
  188. .PP
  189. \fBParameters\fP
  190. .RS 4
  191. \fIplot\fP Parent plot widget
  192. .RE
  193. .PP
  194. \fBSee also\fP
  195. .RS 4
  196. \fBQwtPlot::setCanvas()\fP
  197. .RE
  198. .PP
  199. .SH "Member Function Documentation"
  200. .PP
  201. .SS "const QPixmap * QwtPlotCanvas::backingStore () const"
  202. .PP
  203. \fBReturns\fP
  204. .RS 4
  205. Backing store, might be null
  206. .RE
  207. .PP
  208. .SS "QPainterPath QwtPlotCanvas::borderPath (const QRect & rect) const"
  209. Calculate the painter path for a styled or rounded border
  210. .PP
  211. When the canvas has no styled background or rounded borders the painter path is empty\&.
  212. .PP
  213. \fBParameters\fP
  214. .RS 4
  215. \fIrect\fP Bounding rectangle of the canvas
  216. .RE
  217. .PP
  218. \fBReturns\fP
  219. .RS 4
  220. Painter path, that can be used for clipping
  221. .RE
  222. .PP
  223. .SS "double QwtPlotCanvas::borderRadius () const"
  224. .PP
  225. \fBReturns\fP
  226. .RS 4
  227. Radius for the corners of the border frame
  228. .RE
  229. .PP
  230. \fBSee also\fP
  231. .RS 4
  232. \fBsetBorderRadius()\fP
  233. .RE
  234. .PP
  235. .SS "void QwtPlotCanvas::drawBorder (QPainter * painter)\fC [protected]\fP, \fC [virtual]\fP"
  236. Draw the border of the plot canvas
  237. .PP
  238. \fBParameters\fP
  239. .RS 4
  240. \fIpainter\fP Painter
  241. .RE
  242. .PP
  243. \fBSee also\fP
  244. .RS 4
  245. \fBsetBorderRadius()\fP
  246. .RE
  247. .PP
  248. .SS "void QwtPlotCanvas::drawFocusIndicator (QPainter * painter)\fC [protected]\fP, \fC [virtual]\fP"
  249. Draw the focus indication
  250. .PP
  251. \fBParameters\fP
  252. .RS 4
  253. \fIpainter\fP Painter
  254. .RE
  255. .PP
  256. .SS "bool QwtPlotCanvas::event (QEvent * event)\fC [virtual]\fP"
  257. Qt event handler for QEvent::PolishRequest and QEvent::StyleChange
  258. .PP
  259. \fBParameters\fP
  260. .RS 4
  261. \fIevent\fP Qt Event
  262. .RE
  263. .PP
  264. \fBReturns\fP
  265. .RS 4
  266. See QFrame::event()
  267. .RE
  268. .PP
  269. .SS "\fBQwtPlotCanvas::FocusIndicator\fP QwtPlotCanvas::focusIndicator () const"
  270. .PP
  271. \fBReturns\fP
  272. .RS 4
  273. Focus indicator
  274. .RE
  275. .PP
  276. \fBSee also\fP
  277. .RS 4
  278. \fBFocusIndicator\fP, \fBsetFocusIndicator()\fP
  279. .RE
  280. .PP
  281. .SS "void QwtPlotCanvas::paintEvent (QPaintEvent * event)\fC [protected]\fP, \fC [virtual]\fP"
  282. Paint event
  283. .PP
  284. \fBParameters\fP
  285. .RS 4
  286. \fIevent\fP Paint event
  287. .RE
  288. .PP
  289. .SS "void QwtPlotCanvas::replot ()\fC [slot]\fP"
  290. Invalidate the paint cache and repaint the canvas
  291. .PP
  292. \fBSee also\fP
  293. .RS 4
  294. invalidatePaintCache()
  295. .RE
  296. .PP
  297. .SS "void QwtPlotCanvas::resizeEvent (QResizeEvent * event)\fC [protected]\fP, \fC [virtual]\fP"
  298. Resize event
  299. .PP
  300. \fBParameters\fP
  301. .RS 4
  302. \fIevent\fP Resize event
  303. .RE
  304. .PP
  305. .SS "void QwtPlotCanvas::setBorderRadius (double radius)"
  306. Set the radius for the corners of the border frame
  307. .PP
  308. \fBParameters\fP
  309. .RS 4
  310. \fIradius\fP Radius of a rounded corner
  311. .RE
  312. .PP
  313. \fBSee also\fP
  314. .RS 4
  315. \fBborderRadius()\fP
  316. .RE
  317. .PP
  318. .SS "void QwtPlotCanvas::setFocusIndicator (\fBFocusIndicator\fP focusIndicator)"
  319. Set the focus indicator
  320. .PP
  321. \fBSee also\fP
  322. .RS 4
  323. \fBFocusIndicator\fP, \fBfocusIndicator()\fP
  324. .RE
  325. .PP
  326. .SS "void QwtPlotCanvas::setPaintAttribute (\fBPaintAttribute\fP attribute, bool on = \fCtrue\fP)"
  327. .PP
  328. Changing the paint attributes\&.
  329. .PP
  330. \fBParameters\fP
  331. .RS 4
  332. \fIattribute\fP Paint attribute
  333. .br
  334. \fIon\fP On/Off
  335. .RE
  336. .PP
  337. \fBSee also\fP
  338. .RS 4
  339. \fBtestPaintAttribute()\fP, \fBbackingStore()\fP
  340. .RE
  341. .PP
  342. .SS "bool QwtPlotCanvas::testPaintAttribute (\fBPaintAttribute\fP attribute) const"
  343. Test whether a paint attribute is enabled
  344. .PP
  345. \fBParameters\fP
  346. .RS 4
  347. \fIattribute\fP Paint attribute
  348. .RE
  349. .PP
  350. \fBReturns\fP
  351. .RS 4
  352. true, when attribute is enabled
  353. .RE
  354. .PP
  355. \fBSee also\fP
  356. .RS 4
  357. \fBsetPaintAttribute()\fP
  358. .RE
  359. .PP
  360. .SH "Author"
  361. .PP
  362. Generated automatically by Doxygen for Qwt User's Guide from the source code\&.