This file is indexed.

/usr/share/qt5/doc/qtquick/qquickpainteditem.html is in qtdeclarative5-doc-html 5.5.1-2ubuntu6.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qquickpainteditem.cpp -->
  <title>QQuickPaintedItem Class | Qt Quick 5.5</title>
  <link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
    <div class="main">
    <div class="main-rounded">
        <div class="navigationbar">
        <ul>
<li>Qt 5.5</li>
<li><a href="qtquick-index.html">Qt Quick</a></li>
<li><a href="qtquick-module.html">C++ Classes</a></li>
<li>QQuickPaintedItem</li>
<li id="buildversion">Qt 5.5.1 Reference Documentation</li>
    </ul>
    </div>
</div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#properties">Properties</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#reimplemented-public-functions">Reimplemented Public Functions</a></li>
<li class="level1"><a href="#signals">Signals</a></li>
<li class="level1"><a href="#reimplemented-protected-functions">Reimplemented Protected Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QQuickPaintedItem Class</h1>
<!-- $$$QQuickPaintedItem-brief -->
<p>The <a href="qquickpainteditem.html">QQuickPaintedItem</a> class provides a way to use the QPainter API in the QML Scene Graph. <a href="#details">More...</a></p>
<!-- @@@QQuickPaintedItem -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign"> <span class="preprocessor">#include &lt;QQuickPaintedItem&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += quick</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <a href="qquickitem.html">QQuickItem</a></td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherited By:</td><td class="memItemRight bottomAlign"> <p></p>
</td></tr></table></div><ul>
<li><a href="qquickpainteditem-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h2 id="public-types">Public Types</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qquickpainteditem.html#PerformanceHint-enum">PerformanceHint</a></b> { FastFBOResizing }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> flags </td><td class="memItemRight bottomAlign"><b><a href="qquickpainteditem.html#PerformanceHint-enum">PerformanceHints</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qquickpainteditem.html#RenderTarget-enum">RenderTarget</a></b> { Image, FramebufferObject, InvertedYFramebufferObject }</td></tr>
</table></div>
<a name="properties"></a>
<h2 id="properties">Properties</h2>
<ul>
<li class="fn"><b><a href="qquickpainteditem.html#contentsScale-prop">contentsScale</a></b> : qreal</li>
<li class="fn"><b><a href="qquickpainteditem.html#contentsSize-prop">contentsSize</a></b> : QSize</li>
<li class="fn"><b><a href="qquickpainteditem.html#fillColor-prop">fillColor</a></b> : QColor</li>
<li class="fn"><b><a href="qquickpainteditem.html#renderTarget-prop">renderTarget</a></b> : RenderTarget</li>
</ul>
<ul>
<li class="fn">23 properties inherited from <a href="qquickitem.html#properties">QQuickItem</a></li>
</ul>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qquickpainteditem.html#QQuickPaintedItem">QQuickPaintedItem</a></b>(QQuickItem *<i> parent</i> = 0)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qquickpainteditem.html#dtor.QQuickPaintedItem">~QQuickPaintedItem</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qquickpainteditem.html#antialiasing">antialiasing</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRectF </td><td class="memItemRight bottomAlign"><b><a href="qquickpainteditem.html#contentsBoundingRect">contentsBoundingRect</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qquickpainteditem.html#contentsScale-prop">contentsScale</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QSize </td><td class="memItemRight bottomAlign"><b><a href="qquickpainteditem.html#contentsSize-prop">contentsSize</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QColor </td><td class="memItemRight bottomAlign"><b><a href="qquickpainteditem.html#fillColor-prop">fillColor</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qquickpainteditem.html#mipmap">mipmap</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qquickpainteditem.html#opaquePainting">opaquePainting</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qquickpainteditem.html#paint">paint</a></b>(QPainter *<i> painter</i>) = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> PerformanceHints </td><td class="memItemRight bottomAlign"><b><a href="qquickpainteditem.html#performanceHints">performanceHints</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> RenderTarget </td><td class="memItemRight bottomAlign"><b><a href="qquickpainteditem.html#renderTarget-prop">renderTarget</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qquickpainteditem.html#resetContentsSize">resetContentsSize</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qquickpainteditem.html#setAntialiasing">setAntialiasing</a></b>(bool<i> enable</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qquickpainteditem.html#contentsScale-prop">setContentsScale</a></b>(qreal)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qquickpainteditem.html#contentsSize-prop">setContentsSize</a></b>(const QSize &amp;)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qquickpainteditem.html#fillColor-prop">setFillColor</a></b>(const QColor &amp;)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qquickpainteditem.html#setMipmap">setMipmap</a></b>(bool<i> enable</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qquickpainteditem.html#setOpaquePainting">setOpaquePainting</a></b>(bool<i> opaque</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qquickpainteditem.html#setPerformanceHint">setPerformanceHint</a></b>(PerformanceHint<i> hint</i>, bool<i> enabled</i> = true)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qquickpainteditem.html#setPerformanceHints">setPerformanceHints</a></b>(PerformanceHints<i> hints</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qquickpainteditem.html#renderTarget-prop">setRenderTarget</a></b>(RenderTarget<i> target</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qquickpainteditem.html#update">update</a></b>(const QRect &amp;<i> rect</i> = QRect())</td></tr>
</table></div>
<a name="reimplemented-public-functions"></a>
<h2 id="reimplemented-public-functions">Reimplemented Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qquickpainteditem.html#isTextureProvider">isTextureProvider</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QSGTextureProvider * </td><td class="memItemRight bottomAlign"><b><a href="qquickpainteditem.html#textureProvider">textureProvider</a></b>() const</td></tr>
</table></div>
<ul>
<li class="fn">92 public functions inherited from <a href="qquickitem.html#public-functions">QQuickItem</a></li>
</ul>
<a name="signals"></a>
<h2 id="signals">Signals</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qquickpainteditem.html#contentsScale-prop">contentsScaleChanged</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qquickpainteditem.html#contentsSize-prop">contentsSizeChanged</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qquickpainteditem.html#fillColor-prop">fillColorChanged</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qquickpainteditem.html#renderTarget-prop">renderTargetChanged</a></b>()</td></tr>
</table></div>
<ul>
<li class="fn">1 signal inherited from <a href="qquickitem.html#signals">QQuickItem</a></li>
</ul>
<a name="reimplemented-protected-functions"></a>
<h2 id="reimplemented-protected-functions">Reimplemented Protected Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qquickpainteditem.html#releaseResources">releaseResources</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QSGNode * </td><td class="memItemRight bottomAlign"><b><a href="qquickpainteditem.html#updatePaintNode">updatePaintNode</a></b>(QSGNode *<i> oldNode</i>, UpdatePaintNodeData *<i> data</i>)</td></tr>
</table></div>
<ul>
<li class="fn">33 protected functions inherited from <a href="qquickitem.html#protected-functions">QQuickItem</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">1 public slot inherited from <a href="qquickitem.html#public-slots">QQuickItem</a></li>
<li class="fn">33 protected functions inherited from <a href="qquickitem.html#protected-functions">QQuickItem</a></li>
</ul>
<a name="details"></a>
<!-- $$$QQuickPaintedItem-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qquickpainteditem.html">QQuickPaintedItem</a> class provides a way to use the QPainter API in the QML Scene Graph.</p>
<p>The <a href="qquickpainteditem.html">QQuickPaintedItem</a> makes it possible to use the QPainter API with the QML Scene Graph. It sets up a textured rectangle in the Scene Graph and uses a QPainter to paint onto the texture. The render target can be either a QImage or a QOpenGLFramebufferObject. When the render target is a QImage, QPainter first renders into the image then the content is uploaded to the texture. When a QOpenGLFramebufferObject is used, QPainter paints directly onto the texture. Call <a href="qquickpainteditem.html#update">update</a>() to trigger a repaint.</p>
<p>To enable QPainter to do anti-aliased rendering, use <a href="qquickpainteditem.html#setAntialiasing">setAntialiasing</a>().</p>
<p>To write your own painted item, you first create a subclass of <a href="qquickpainteditem.html">QQuickPaintedItem</a>, and then start by implementing its only pure virtual public function: <a href="qquickpainteditem.html#paint">paint</a>(), which implements the actual painting. To get the size of the area painted by the item, use <a href="qquickpainteditem.html#contentsBoundingRect">contentsBoundingRect</a>().</p>
<p>Starting Qt 5.4, the <a href="qquickpainteditem.html">QQuickPaintedItem</a> is a <a href="qsgtextureprovider.html">texture provider</a> and can be used directly in <a href="qml-qtquick-shadereffect.html">ShaderEffects</a> and other classes that consume texture providers.</p>
</div>
<!-- @@@QQuickPaintedItem -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$PerformanceHint$$$FastFBOResizing -->
<h3 class="flags" id="PerformanceHint-enum"><a name="PerformanceHint-enum"></a>enum QQuickPaintedItem::<span class="name">PerformanceHint</span><br/>flags QQuickPaintedItem::<span class="name">PerformanceHints</span></h3>
<p>This enum describes flags that you can enable to improve rendering performance in <a href="qquickpainteditem.html">QQuickPaintedItem</a>. By default, none of these flags are set.</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QQuickPaintedItem::FastFBOResizing</code></td><td class="topAlign"><code>0x1</code></td><td class="topAlign">If your item gets resized often and you are using the <a href="qquickpainteditem.html#RenderTarget-enum">QQuickPaintedItem::FramebufferObject</a> render target, set this flag to true to reduce the item resizing time at the cost of using more graphics memory. Resizing a Framebuffer object is a costly operation, by enabling this property the Framebuffer Object will use a texture larger than the actual size of the item to avoid as much as possible resizing it.</td></tr>
</table></div>
<p>The PerformanceHints type is a typedef for <a href="">QFlags</a>&lt;PerformanceHint&gt;. It stores an OR combination of PerformanceHint values.</p>
<!-- @@@PerformanceHint -->
<!-- $$$RenderTarget$$$Image$$$FramebufferObject$$$InvertedYFramebufferObject -->
<h3 class="fn" id="RenderTarget-enum"><a name="RenderTarget-enum"></a>enum QQuickPaintedItem::<span class="name">RenderTarget</span></h3>
<p>This enum describes <a href="qquickpainteditem.html">QQuickPaintedItem</a>'s render targets. The render target is the surface QPainter paints onto before the item is rendered on screen.</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QQuickPaintedItem::Image</code></td><td class="topAlign"><code>0</code></td><td class="topAlign">The default; QPainter paints into a QImage using the raster paint engine. The image's content needs to be uploaded to graphics memory afterward, this operation can potentially be slow if the item is large. This render target allows high quality anti-aliasing and fast item resizing.</td></tr>
<tr><td class="topAlign"><code>QQuickPaintedItem::FramebufferObject</code></td><td class="topAlign"><code>1</code></td><td class="topAlign">QPainter paints into a QOpenGLFramebufferObject using the GL paint engine. Painting can be faster as no texture upload is required, but anti-aliasing quality is not as good as if using an image. This render target allows faster rendering in some cases, but you should avoid using it if the item is resized often.</td></tr>
<tr><td class="topAlign"><code>QQuickPaintedItem::InvertedYFramebufferObject</code></td><td class="topAlign"><code>2</code></td><td class="topAlign">Exactly as for FramebufferObject above, except once the painting is done, prior to rendering the painted image is flipped about the x-axis so that the top-most pixels are now at the bottom. Since this is done with the OpenGL texture coordinates it is a much faster way to achieve this effect than using a painter transform.</td></tr>
</table></div>
<p><b>See also </b><a href="qquickpainteditem.html#renderTarget-prop">setRenderTarget</a>().</p>
<!-- @@@RenderTarget -->
</div>
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$contentsScale-prop$$$contentsScale$$$setContentsScaleqreal$$$contentsScaleChanged -->
<h3 class="fn" id="contentsScale-prop"><a name="contentsScale-prop"></a><span class="name">contentsScale</span> : <span class="type">qreal</span></h3>
<p>This property holds the scale of the contents.</p>
<p>All painting happening in <a href="qquickpainteditem.html#paint">paint</a>() is scaled by the contents scale. This is distinct from the scale of the item in regards to <a href="qquickitem.html#scale-prop">scale</a>().</p>
<p>The default value is 1.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> qreal </td><td class="memItemRight bottomAlign"><span class="name"><b>contentsScale</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setContentsScale</b></span>(qreal)</td></tr>
</table></div>
<p><b>Notifier signal:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>contentsScaleChanged</b></span>()</td></tr>
</table></div>
<!-- @@@contentsScale -->
<!-- $$$contentsSize-prop$$$contentsSize$$$setContentsSizeconstQSize&$$$contentsSizeChanged -->
<h3 class="fn" id="contentsSize-prop"><a name="contentsSize-prop"></a><span class="name">contentsSize</span> : <span class="type">QSize</span></h3>
<p>This property holds the size of the contents.</p>
<p>The contents size is the size of the item in regards to how it is painted using the <a href="qquickpainteditem.html#paint">paint</a>() function. This is distinct from the size of the item in regards to <a href="qquickitem.html#height-prop">height</a>() and <a href="qquickitem.html#width-prop">width</a>().</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QSize </td><td class="memItemRight bottomAlign"><span class="name"><b>contentsSize</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setContentsSize</b></span>(const QSize &amp;)</td></tr>
</table></div>
<p><b>Notifier signal:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>contentsSizeChanged</b></span>()</td></tr>
</table></div>
<!-- @@@contentsSize -->
<!-- $$$fillColor-prop$$$fillColor$$$setFillColorconstQColor&$$$fillColorChanged -->
<h3 class="fn" id="fillColor-prop"><a name="fillColor-prop"></a><span class="name">fillColor</span> : <span class="type">QColor</span></h3>
<p>This property holds the item's background fill color.</p>
<p>By default, the fill color is set to Qt::transparent.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QColor </td><td class="memItemRight bottomAlign"><span class="name"><b>fillColor</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setFillColor</b></span>(const QColor &amp;)</td></tr>
</table></div>
<p><b>Notifier signal:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>fillColorChanged</b></span>()</td></tr>
</table></div>
<!-- @@@fillColor -->
<!-- $$$renderTarget-prop$$$renderTarget$$$setRenderTargetRenderTarget$$$renderTargetChanged -->
<h3 class="fn" id="renderTarget-prop"><a name="renderTarget-prop"></a><span class="name">renderTarget</span> : <span class="type"><a href="qquickpainteditem.html#RenderTarget-enum">RenderTarget</a></span></h3>
<p>This property holds the item's render target.</p>
<p>This property defines which render target the QPainter renders into, it can be either QSGPaintedItem::Image, QSGPaintedItem::FramebufferObject or QSGPaintedItem::InvertedYFramebufferObject.</p>
<p>Each has certain benefits, typically performance versus quality. Using a framebuffer object avoids a costly upload of the image contents to the texture in graphics memory, while using an image enables high quality anti-aliasing.</p>
<p><b>Warning:</b> Resizing a framebuffer object is a costly operation, avoid using the <a href="qquickpainteditem.html#RenderTarget-enum">QQuickPaintedItem::FramebufferObject</a> render target if the item gets resized often.</p>
<p>By default, the render target is <a href="qquickpainteditem.html#RenderTarget-enum">QQuickPaintedItem::Image</a>.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> RenderTarget </td><td class="memItemRight bottomAlign"><span class="name"><b>renderTarget</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setRenderTarget</b></span>(RenderTarget<i> target</i>)</td></tr>
</table></div>
<p><b>Notifier signal:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>renderTargetChanged</b></span>()</td></tr>
</table></div>
<!-- @@@renderTarget -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QQuickPaintedItem[overload1]$$$QQuickPaintedItemQQuickItem* -->
<h3 class="fn" id="QQuickPaintedItem"><a name="QQuickPaintedItem"></a>QQuickPaintedItem::<span class="name">QQuickPaintedItem</span>(<span class="type"><a href="qquickitem.html#QQuickItem">QQuickItem</a></span> *<i> parent</i> = 0)</h3>
<p>Constructs a <a href="qquickpainteditem.html">QQuickPaintedItem</a> with the given <i>parent</i> item.</p>
<!-- @@@QQuickPaintedItem -->
<!-- $$$~QQuickPaintedItem[overload1]$$$~QQuickPaintedItem -->
<h3 class="fn" id="dtor.QQuickPaintedItem"><a name="dtor.QQuickPaintedItem"></a><code>[virtual] </code>QQuickPaintedItem::<span class="name">~QQuickPaintedItem</span>()</h3>
<p>Destroys the <a href="qquickpainteditem.html">QQuickPaintedItem</a>.</p>
<!-- @@@~QQuickPaintedItem -->
<!-- $$$antialiasing[overload1]$$$antialiasing -->
<h3 class="fn" id="antialiasing"><a name="antialiasing"></a><span class="type">bool</span> QQuickPaintedItem::<span class="name">antialiasing</span>() const</h3>
<p>Returns true if antialiased painting is enabled; otherwise, false is returned.</p>
<p>By default, antialiasing is not enabled.</p>
<p><b>See also </b><a href="qquickpainteditem.html#setAntialiasing">setAntialiasing</a>().</p>
<!-- @@@antialiasing -->
<!-- $$$contentsBoundingRect[overload1]$$$contentsBoundingRect -->
<h3 class="fn" id="contentsBoundingRect"><a name="contentsBoundingRect"></a><span class="type">QRectF</span> QQuickPaintedItem::<span class="name">contentsBoundingRect</span>() const</h3>
<p>This function returns the outer bounds of the item as a rectangle; all painting must be restricted to inside an item's bounding rect.</p>
<p>If the contents size has not been set it reflects the size of the item; otherwise it reflects the contents size scaled by the contents scale.</p>
<p>Use this function to know the area painted by the item.</p>
<p><b>See also </b><a href="qquickitem.html#width-prop">QQuickItem::width</a>(), <a href="qquickitem.html#height-prop">QQuickItem::height</a>(), <a href="qquickpainteditem.html#contentsSize-prop">contentsSize</a>(), and <a href="qquickpainteditem.html#contentsScale-prop">contentsScale</a>().</p>
<!-- @@@contentsBoundingRect -->
<!-- $$$isTextureProvider[overload1]$$$isTextureProvider -->
<h3 class="fn" id="isTextureProvider"><a name="isTextureProvider"></a><code>[virtual] </code><span class="type">bool</span> QQuickPaintedItem::<span class="name">isTextureProvider</span>() const</h3>
<p>Reimplemented from <a href="qquickitem.html#isTextureProvider">QQuickItem::isTextureProvider</a>().</p>
<!-- @@@isTextureProvider -->
<!-- $$$mipmap[overload1]$$$mipmap -->
<h3 class="fn" id="mipmap"><a name="mipmap"></a><span class="type">bool</span> QQuickPaintedItem::<span class="name">mipmap</span>() const</h3>
<p>Returns true if mipmaps are enabled; otherwise, false is returned.</p>
<p>By default, mipmapping is not enabled.</p>
<p><b>See also </b><a href="qquickpainteditem.html#setMipmap">setMipmap</a>().</p>
<!-- @@@mipmap -->
<!-- $$$opaquePainting[overload1]$$$opaquePainting -->
<h3 class="fn" id="opaquePainting"><a name="opaquePainting"></a><span class="type">bool</span> QQuickPaintedItem::<span class="name">opaquePainting</span>() const</h3>
<p>Returns true if this item is opaque; otherwise, false is returned.</p>
<p>By default, painted items are not opaque.</p>
<p><b>See also </b><a href="qquickpainteditem.html#setOpaquePainting">setOpaquePainting</a>().</p>
<!-- @@@opaquePainting -->
<!-- $$$paint[overload1]$$$paintQPainter* -->
<h3 class="fn" id="paint"><a name="paint"></a><code>[pure virtual] </code><span class="type">void</span> QQuickPaintedItem::<span class="name">paint</span>(<span class="type">QPainter</span> *<i> painter</i>)</h3>
<p>This function, which is usually called by the QML Scene Graph, paints the contents of an item in local coordinates.</p>
<p>The function is called after the item has been filled with the <a href="qquickpainteditem.html#fillColor-prop">fillColor</a>.</p>
<p>Reimplement this function in a <a href="qquickpainteditem.html">QQuickPaintedItem</a> subclass to provide the item's painting implementation, using <i>painter</i>.</p>
<p><b>Note: </b>The QML Scene Graph uses two separate threads, the main thread does things such as processing events or updating animations while a second thread does the actual OpenGL rendering. As a consequence, paint() is not called from the main GUI thread but from the GL enabled renderer thread. At the moment paint() is called, the GUI thread is blocked and this is therefore thread-safe.</p><p><b>Warning:</b> Extreme caution must be used when creating QObjects, emitting signals, starting timers and similar inside this function as these will have affinity to the rendering thread.</p>
<!-- @@@paint -->
<!-- $$$performanceHints[overload1]$$$performanceHints -->
<h3 class="fn" id="performanceHints"><a name="performanceHints"></a><span class="type"><a href="qquickpainteditem.html#PerformanceHint-enum">PerformanceHints</a></span> QQuickPaintedItem::<span class="name">performanceHints</span>() const</h3>
<p>Returns the performance hints.</p>
<p>By default, no performance hint is enabled.</p>
<p><b>See also </b><a href="qquickpainteditem.html#setPerformanceHint">setPerformanceHint</a>() and <a href="qquickpainteditem.html#setPerformanceHints">setPerformanceHints</a>().</p>
<!-- @@@performanceHints -->
<!-- $$$releaseResources[overload1]$$$releaseResources -->
<h3 class="fn" id="releaseResources"><a name="releaseResources"></a><code>[virtual protected] </code><span class="type">void</span> QQuickPaintedItem::<span class="name">releaseResources</span>()</h3>
<p>Reimplemented from <a href="qquickitem.html#releaseResources">QQuickItem::releaseResources</a>().</p>
<!-- @@@releaseResources -->
<!-- $$$resetContentsSize[overload1]$$$resetContentsSize -->
<h3 class="fn" id="resetContentsSize"><a name="resetContentsSize"></a><span class="type">void</span> QQuickPaintedItem::<span class="name">resetContentsSize</span>()</h3>
<p>This convenience function is equivalent to calling <a href="qquickpainteditem.html#contentsSize-prop">setContentsSize</a>(QSize()).</p>
<!-- @@@resetContentsSize -->
<!-- $$$setAntialiasing[overload1]$$$setAntialiasingbool -->
<h3 class="fn" id="setAntialiasing"><a name="setAntialiasing"></a><span class="type">void</span> QQuickPaintedItem::<span class="name">setAntialiasing</span>(<span class="type">bool</span><i> enable</i>)</h3>
<p>If <i>enable</i> is true, antialiased painting is enabled.</p>
<p>By default, antialiasing is not enabled.</p>
<p><b>See also </b><a href="qquickpainteditem.html#antialiasing">antialiasing</a>().</p>
<!-- @@@setAntialiasing -->
<!-- $$$setMipmap[overload1]$$$setMipmapbool -->
<h3 class="fn" id="setMipmap"><a name="setMipmap"></a><span class="type">void</span> QQuickPaintedItem::<span class="name">setMipmap</span>(<span class="type">bool</span><i> enable</i>)</h3>
<p>If <i>enable</i> is true, mipmapping is enabled on the associated texture.</p>
<p>Mipmapping increases rendering speed and reduces aliasing artifacts when the item is scaled down.</p>
<p>By default, mipmapping is not enabled.</p>
<p><b>See also </b><a href="qquickpainteditem.html#mipmap">mipmap</a>().</p>
<!-- @@@setMipmap -->
<!-- $$$setOpaquePainting[overload1]$$$setOpaquePaintingbool -->
<h3 class="fn" id="setOpaquePainting"><a name="setOpaquePainting"></a><span class="type">void</span> QQuickPaintedItem::<span class="name">setOpaquePainting</span>(<span class="type">bool</span><i> opaque</i>)</h3>
<p>If <i>opaque</i> is true, the item is opaque; otherwise, it is considered as translucent.</p>
<p>Opaque items are not blended with the rest of the scene, you should set this to true if the content of the item is opaque to speed up rendering.</p>
<p>By default, painted items are not opaque.</p>
<p><b>See also </b><a href="qquickpainteditem.html#opaquePainting">opaquePainting</a>().</p>
<!-- @@@setOpaquePainting -->
<!-- $$$setPerformanceHint[overload1]$$$setPerformanceHintPerformanceHintbool -->
<h3 class="fn" id="setPerformanceHint"><a name="setPerformanceHint"></a><span class="type">void</span> QQuickPaintedItem::<span class="name">setPerformanceHint</span>(<span class="type"><a href="qquickpainteditem.html#PerformanceHint-enum">PerformanceHint</a></span><i> hint</i>, <span class="type">bool</span><i> enabled</i> = true)</h3>
<p>Sets the given performance <i>hint</i> on the item if <i>enabled</i> is true; otherwise clears the performance hint.</p>
<p>By default, no performance hint is enabled/</p>
<p><b>See also </b><a href="qquickpainteditem.html#setPerformanceHints">setPerformanceHints</a>() and <a href="qquickpainteditem.html#performanceHints">performanceHints</a>().</p>
<!-- @@@setPerformanceHint -->
<!-- $$$setPerformanceHints[overload1]$$$setPerformanceHintsPerformanceHints -->
<h3 class="fn" id="setPerformanceHints"><a name="setPerformanceHints"></a><span class="type">void</span> QQuickPaintedItem::<span class="name">setPerformanceHints</span>(<span class="type"><a href="qquickpainteditem.html#PerformanceHint-enum">PerformanceHints</a></span><i> hints</i>)</h3>
<p>Sets the performance hints to <i>hints</i></p>
<p>By default, no performance hint is enabled/</p>
<p><b>See also </b><a href="qquickpainteditem.html#setPerformanceHint">setPerformanceHint</a>() and <a href="qquickpainteditem.html#performanceHints">performanceHints</a>().</p>
<!-- @@@setPerformanceHints -->
<!-- $$$textureProvider[overload1]$$$textureProvider -->
<h3 class="fn" id="textureProvider"><a name="textureProvider"></a><code>[virtual] </code><span class="type"><a href="qsgtextureprovider.html">QSGTextureProvider</a></span> * QQuickPaintedItem::<span class="name">textureProvider</span>() const</h3>
<p>Reimplemented from <a href="qquickitem.html#textureProvider">QQuickItem::textureProvider</a>().</p>
<!-- @@@textureProvider -->
<!-- $$$update[overload1]$$$updateconstQRect& -->
<h3 class="fn" id="update"><a name="update"></a><span class="type">void</span> QQuickPaintedItem::<span class="name">update</span>(const <span class="type">QRect</span> &amp;<i> rect</i> = QRect())</h3>
<p>Schedules a redraw of the area covered by <i>rect</i> in this item. You can call this function whenever your item needs to be redrawn, such as if it changes appearance or size.</p>
<p>This function does not cause an immediate paint; instead it schedules a paint request that is processed by the QML Scene Graph when the next frame is rendered. The item will only be redrawn if it is visible.</p>
<p>Note that calling this function will trigger a repaint of the whole scene.</p>
<p><b>See also </b><a href="qquickpainteditem.html#paint">paint</a>().</p>
<!-- @@@update -->
<!-- $$$updatePaintNode[overload1]$$$updatePaintNodeQSGNode*UpdatePaintNodeData* -->
<h3 class="fn" id="updatePaintNode"><a name="updatePaintNode"></a><code>[virtual protected] </code><span class="type"><a href="qsgnode.html">QSGNode</a></span> * QQuickPaintedItem::<span class="name">updatePaintNode</span>(<span class="type"><a href="qsgnode.html">QSGNode</a></span> *<i> oldNode</i>, <span class="type"><a href="qquickitem-updatepaintnodedata.html">UpdatePaintNodeData</a></span> *<i> data</i>)</h3>
<p>Reimplemented from <a href="qquickitem.html#updatePaintNode">QQuickItem::updatePaintNode</a>().</p>
<!-- @@@updatePaintNode -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2015 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>