QwtWidgetOverlay.3 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  1. .TH "QwtWidgetOverlay" 3 "Mon Dec 28 2020" "Version 6.1.6" "Qwt User's Guide" \" -*- nroff -*-
  2. .ad l
  3. .nh
  4. .SH NAME
  5. QwtWidgetOverlay \- An overlay for a widget\&.
  6. .SH SYNOPSIS
  7. .br
  8. .PP
  9. .PP
  10. \fC#include <qwt_widget_overlay\&.h>\fP
  11. .PP
  12. Inherits QWidget\&.
  13. .PP
  14. Inherited by QwtPickerRubberband, and QwtPickerTracker\&.
  15. .SS "Public Types"
  16. .in +1c
  17. .ti -1c
  18. .RI "enum \fBMaskMode\fP { \fBNoMask\fP, \fBMaskHint\fP, \fBAlphaMask\fP }"
  19. .br
  20. .RI "Mask mode\&. "
  21. .ti -1c
  22. .RI "enum \fBRenderMode\fP { \fBAutoRenderMode\fP, \fBCopyAlphaMask\fP, \fBDrawOverlay\fP }"
  23. .br
  24. .RI "Render mode\&. "
  25. .in -1c
  26. .SS "Public Member Functions"
  27. .in +1c
  28. .ti -1c
  29. .RI "\fBQwtWidgetOverlay\fP (QWidget *)"
  30. .br
  31. .RI "Constructor\&. "
  32. .ti -1c
  33. .RI "virtual \fB~QwtWidgetOverlay\fP ()"
  34. .br
  35. .RI "Destructor\&. "
  36. .ti -1c
  37. .RI "void \fBsetMaskMode\fP (\fBMaskMode\fP)"
  38. .br
  39. .RI "Specify how to find the mask for the overlay\&. "
  40. .ti -1c
  41. .RI "\fBMaskMode\fP \fBmaskMode\fP () const"
  42. .br
  43. .ti -1c
  44. .RI "void \fBsetRenderMode\fP (\fBRenderMode\fP)"
  45. .br
  46. .ti -1c
  47. .RI "\fBRenderMode\fP \fBrenderMode\fP () const"
  48. .br
  49. .ti -1c
  50. .RI "void \fBupdateOverlay\fP ()"
  51. .br
  52. .ti -1c
  53. .RI "virtual bool \fBeventFilter\fP (QObject *, QEvent *)"
  54. .br
  55. .RI "Event filter\&. "
  56. .in -1c
  57. .SS "Protected Member Functions"
  58. .in +1c
  59. .ti -1c
  60. .RI "virtual void \fBpaintEvent\fP (QPaintEvent *event)"
  61. .br
  62. .ti -1c
  63. .RI "virtual void \fBresizeEvent\fP (QResizeEvent *event)"
  64. .br
  65. .ti -1c
  66. .RI "virtual QRegion \fBmaskHint\fP () const"
  67. .br
  68. .RI "Calculate an approximation for the mask\&. "
  69. .ti -1c
  70. .RI "virtual void \fBdrawOverlay\fP (QPainter *painter) const =0"
  71. .br
  72. .in -1c
  73. .SH "Detailed Description"
  74. .PP
  75. An overlay for a widget\&.
  76. The main use case of an widget overlay is to avoid heavy repaint operation of the widget below\&.
  77. .PP
  78. F\&.e\&. in combination with the plot canvas an overlay avoid replots as the content of the canvas can be restored from its backing store\&.
  79. .PP
  80. \fBQwtWidgetOverlay\fP is an abstract base class\&. Deriving classes are supposed to reimplement the following methods:
  81. .PP
  82. .IP "\(bu" 2
  83. \fBdrawOverlay()\fP
  84. .IP "\(bu" 2
  85. \fBmaskHint()\fP
  86. .PP
  87. .PP
  88. Internally \fBQwtPlotPicker\fP uses overlays for displaying the rubber band and the tracker text\&.
  89. .PP
  90. \fBSee also\fP
  91. .RS 4
  92. \fBQwtPlotCanvas::BackingStore\fP
  93. .RE
  94. .PP
  95. .SH "Member Enumeration Documentation"
  96. .PP
  97. .SS "enum \fBQwtWidgetOverlay::MaskMode\fP"
  98. .PP
  99. Mask mode\&. When using masks the widget below gets paint events for the masked regions of the overlay only\&. Otherwise Qt triggers full repaints\&. On less powerful hardware ( f\&.e embedded systems ) - or when using the raster paint engine on a remote desktop - bit blitting is a noticeable operation, that needs to be avoided\&.
  100. .PP
  101. If and how to mask depends on how expensive the calculation of the mask is and how many pixels can be excluded by the mask\&.
  102. .PP
  103. The default setting is MaskHint\&.
  104. .PP
  105. \fBSee also\fP
  106. .RS 4
  107. \fBsetMaskMode()\fP, \fBmaskMode()\fP
  108. .RE
  109. .PP
  110. .PP
  111. \fBEnumerator\fP
  112. .in +1c
  113. .TP
  114. \fB\fINoMask \fP\fP
  115. Don't use a mask\&.
  116. .TP
  117. \fB\fIMaskHint \fP\fP
  118. Use \fBmaskHint()\fP as mask\&. For many situations a fast approximation is good enough and it is not necessary to build a more detailed mask ( f\&.e the bounding rectangle of a text )\&.
  119. .TP
  120. \fB\fIAlphaMask \fP\fP
  121. Calculate a mask by checking the alpha values\&. Sometimes it is not possible to give a fast approximation and the mask needs to be calculated by drawing the overlay and testing the result\&.
  122. .PP
  123. When a valid \fBmaskHint()\fP is available only pixels inside this approximation are checked\&.
  124. .SS "enum \fBQwtWidgetOverlay::RenderMode\fP"
  125. .PP
  126. Render mode\&. For calculating the alpha mask the overlay has already been painted to a temporary QImage\&. Instead of rendering the overlay twice this buffer can be copied for drawing the overlay\&.
  127. .PP
  128. On graphic systems using the raster paint engine ( QWS, Windows ) it means usually copying some memory only\&. On X11 it results in an expensive operation building a pixmap and for simple overlays it might not be recommended\&.
  129. .PP
  130. \fBNote\fP
  131. .RS 4
  132. The render mode has no effect, when \fBmaskMode()\fP != AlphaMask\&.
  133. .RE
  134. .PP
  135. .PP
  136. \fBEnumerator\fP
  137. .in +1c
  138. .TP
  139. \fB\fIAutoRenderMode \fP\fP
  140. Copy the buffer, when using the raster paint engine\&.
  141. .TP
  142. \fB\fICopyAlphaMask \fP\fP
  143. Always copy the buffer\&.
  144. .TP
  145. \fB\fIDrawOverlay \fP\fP
  146. Never copy the buffer\&.
  147. .SH "Constructor & Destructor Documentation"
  148. .PP
  149. .SS "QwtWidgetOverlay::QwtWidgetOverlay (QWidget * widget)"
  150. .PP
  151. Constructor\&.
  152. .PP
  153. \fBParameters\fP
  154. .RS 4
  155. \fIwidget\fP Parent widget, where the overlay is aligned to
  156. .RE
  157. .PP
  158. .SH "Member Function Documentation"
  159. .PP
  160. .SS "virtual void QwtWidgetOverlay::drawOverlay (QPainter * painter) const\fC [protected]\fP, \fC [pure virtual]\fP"
  161. Draw the widget overlay
  162. .PP
  163. \fBParameters\fP
  164. .RS 4
  165. \fIpainter\fP Painter
  166. .RE
  167. .PP
  168. .SS "bool QwtWidgetOverlay::eventFilter (QObject * object, QEvent * event)\fC [virtual]\fP"
  169. .PP
  170. Event filter\&. Resize the overlay according to the size of the parent widget\&.
  171. .PP
  172. \fBParameters\fP
  173. .RS 4
  174. \fIobject\fP Object to be filtered
  175. .br
  176. \fIevent\fP Event
  177. .RE
  178. .PP
  179. \fBReturns\fP
  180. .RS 4
  181. See QObject::eventFilter()
  182. .RE
  183. .PP
  184. .SS "QRegion QwtWidgetOverlay::maskHint () const\fC [protected]\fP, \fC [virtual]\fP"
  185. .PP
  186. Calculate an approximation for the mask\&.
  187. .IP "\(bu" 2
  188. MaskHint The hint is used as mask\&.
  189. .IP "\(bu" 2
  190. AlphaMask The hint is used to speed up the algorithm for calculating a mask from non transparent pixels
  191. .IP "\(bu" 2
  192. NoMask The hint is unused\&.
  193. .PP
  194. .PP
  195. The default implementation returns an invalid region indicating no hint\&.
  196. .PP
  197. \fBReturns\fP
  198. .RS 4
  199. Hint for the mask
  200. .RE
  201. .PP
  202. .SS "\fBQwtWidgetOverlay::MaskMode\fP QwtWidgetOverlay::maskMode () const"
  203. .PP
  204. \fBReturns\fP
  205. .RS 4
  206. Mode how to find the mask for the overlay
  207. .RE
  208. .PP
  209. \fBSee also\fP
  210. .RS 4
  211. \fBsetMaskMode()\fP
  212. .RE
  213. .PP
  214. .SS "void QwtWidgetOverlay::paintEvent (QPaintEvent * event)\fC [protected]\fP, \fC [virtual]\fP"
  215. Paint event
  216. .PP
  217. \fBParameters\fP
  218. .RS 4
  219. \fIevent\fP Paint event
  220. .RE
  221. .PP
  222. \fBSee also\fP
  223. .RS 4
  224. \fBdrawOverlay()\fP
  225. .RE
  226. .PP
  227. .SS "\fBQwtWidgetOverlay::RenderMode\fP QwtWidgetOverlay::renderMode () const"
  228. .PP
  229. \fBReturns\fP
  230. .RS 4
  231. Render mode
  232. .RE
  233. .PP
  234. \fBSee also\fP
  235. .RS 4
  236. \fBRenderMode\fP, \fBsetRenderMode()\fP
  237. .RE
  238. .PP
  239. .SS "void QwtWidgetOverlay::resizeEvent (QResizeEvent * event)\fC [protected]\fP, \fC [virtual]\fP"
  240. Resize event
  241. .PP
  242. \fBParameters\fP
  243. .RS 4
  244. \fIevent\fP Resize event
  245. .RE
  246. .PP
  247. .SS "void QwtWidgetOverlay::setMaskMode (\fBMaskMode\fP mode)"
  248. .PP
  249. Specify how to find the mask for the overlay\&.
  250. .PP
  251. \fBParameters\fP
  252. .RS 4
  253. \fImode\fP New mode
  254. .RE
  255. .PP
  256. \fBSee also\fP
  257. .RS 4
  258. \fBmaskMode()\fP
  259. .RE
  260. .PP
  261. .SS "void QwtWidgetOverlay::setRenderMode (\fBRenderMode\fP mode)"
  262. Set the render mode
  263. .PP
  264. \fBParameters\fP
  265. .RS 4
  266. \fImode\fP Render mode
  267. .RE
  268. .PP
  269. \fBSee also\fP
  270. .RS 4
  271. \fBRenderMode\fP, \fBrenderMode()\fP
  272. .RE
  273. .PP
  274. .SS "void QwtWidgetOverlay::updateOverlay ()"
  275. Recalculate the mask and repaint the overlay
  276. .SH "Author"
  277. .PP
  278. Generated automatically by Doxygen for Qwt User's Guide from the source code\&.