Sophie

Sophie

distrib > Mageia > 7 > i586 > media > core-updates > by-pkgid > 6e2327ca1c896c6d674ae53117299f21 > files > 1230

qtdeclarative5-doc-5.12.6-1.mga7.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qquickframebufferobject.cpp -->
  <title>QQuickFramebufferObject Class | Qt Quick 5.12.6</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td >Qt 5.12</td><td ><a href="qtquick-index.html">Qt Quick</a></td><td ><a href="qtquick-module.html">C++ Classes</a></td><td >QQuickFramebufferObject</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qtquick-index.html">Qt 5.12.6 Reference Documentation</a></td>
        </tr></table>
      </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="#static-public-members">Static Public Members</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">QQuickFramebufferObject Class</h1>
<!-- $$$QQuickFramebufferObject-brief -->
<p>The <a href="qquickframebufferobject.html">QQuickFramebufferObject</a> class is a convenience class for integrating OpenGL rendering using a framebuffer object (FBO) with Qt Quick. <a href="#details">More...</a></p>
<!-- @@@QQuickFramebufferObject -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QQuickFramebufferObject&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"> Since:</td><td class="memItemRight bottomAlign">  Qt 5.2</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <a href="qquickitem.html">QQuickItem</a></td></tr></table></div><ul>
<li><a href="qquickframebufferobject-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"> class </td><td class="memItemRight bottomAlign"><b><a href="qquickframebufferobject-renderer.html">Renderer</a></b></td></tr>
</table></div>
<a name="properties"></a>
<h2 id="properties">Properties</h2>
<ul>
<li class="fn"><b><a href="qquickframebufferobject.html#mirrorVertically-prop">mirrorVertically</a></b> : bool</li>
<li class="fn"><b><a href="qquickframebufferobject.html#textureFollowsItemSize-prop">textureFollowsItemSize</a></b> : bool</li>
</ul>
<ul>
<li class="fn">24 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="qquickframebufferobject.html#QQuickFramebufferObject">QQuickFramebufferObject</a></b>(QQuickItem *<i>parent</i> = nullptr)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QQuickFramebufferObject::Renderer *</td><td class="memItemRight bottomAlign"><b><a href="qquickframebufferobject.html#createRenderer">createRenderer</a></b>() const = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qquickframebufferobject.html#mirrorVertically-prop">mirrorVertically</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qquickframebufferobject.html#mirrorVertically-prop">setMirrorVertically</a></b>(bool <i>enable</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qquickframebufferobject.html#textureFollowsItemSize-prop">setTextureFollowsItemSize</a></b>(bool <i>follows</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qquickframebufferobject.html#textureFollowsItemSize-prop">textureFollowsItemSize</a></b>() const</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="qquickframebufferobject.html#isTextureProvider">isTextureProvider</a></b>() const override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qquickframebufferobject.html#releaseResources">releaseResources</a></b>() override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QSGTextureProvider *</td><td class="memItemRight bottomAlign"><b><a href="qquickframebufferobject.html#textureProvider">textureProvider</a></b>() const override</td></tr>
</table></div>
<ul>
<li class="fn">101 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="qquickframebufferobject.html#mirrorVertically-prop">mirrorVerticallyChanged</a></b>(<i>bool</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qquickframebufferobject.html#textureFollowsItemSize-prop">textureFollowsItemSizeChanged</a></b>(<i>bool</i>)</td></tr>
</table></div>
<ul>
<li class="fn">2 signals inherited from <a href="qquickitem.html#signals">QQuickItem</a></li>
</ul>
<a name="static-public-members"></a>
<h2 id="static-public-members">Static Public Members</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> const QMetaObject </td><td class="memItemRight bottomAlign"><b><a href="qquickframebufferobject.html#staticMetaObject-var">staticMetaObject</a></b></td></tr>
</table></div>
<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>
<!-- $$$QQuickFramebufferObject-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qquickframebufferobject.html">QQuickFramebufferObject</a> class is a convenience class for integrating OpenGL rendering using a framebuffer object (FBO) with Qt Quick.</p>
<p>On most platforms, the rendering will occur on a <a href="qtquick-visualcanvas-scenegraph.html#scene-graph-and-rendering">dedicated thread</a>. For this reason, the <a href="qquickframebufferobject.html">QQuickFramebufferObject</a> class enforces a strict separation between the item implementation and the FBO rendering. All item logic, such as properties and UI-related helper functions needed by QML should be located in a <a href="qquickframebufferobject.html">QQuickFramebufferObject</a> class subclass. Everything that relates to rendering must be located in the <a href="qquickframebufferobject-renderer.html">QQuickFramebufferObject::Renderer</a> class.</p>
<p>To avoid race conditions and read/write issues from two threads it is important that the renderer and the item never read or write shared variables. Communication between the item and the renderer should primarily happen via the <a href="qquickframebufferobject-renderer.html#synchronize">QQuickFramebufferObject::Renderer::synchronize</a>() function. This function will be called on the render thread while the GUI thread is blocked.</p>
<p>Using queued connections or events for communication between item and renderer is also possible.</p>
<p>Both the Renderer and the FBO are memory managed internally.</p>
<p>To render into the FBO, the user should subclass the Renderer class and reimplement its <a href="qquickframebufferobject-renderer.html#render">Renderer::render</a>() function. The Renderer subclass is returned from <a href="qquickframebufferobject.html#createRenderer">createRenderer</a>().</p>
<p>The size of the FBO will by default adapt to the size of the item. If a fixed size is preferred, set <a href="qquickframebufferobject.html#textureFollowsItemSize-prop">textureFollowsItemSize</a> to <code>false</code> and return a texture of your choosing from <a href="qquickframebufferobject-renderer.html#createFramebufferObject">QQuickFramebufferObject::Renderer::createFramebufferObject</a>().</p>
<p>Starting Qt 5.4, the <a href="qquickframebufferobject.html">QQuickFramebufferObject</a> class 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>
<p><b>See also </b><a href="qtquick-scenegraph-textureinsgnode-example.html">Scene Graph - Rendering FBOs</a> and <a href="qtquick-visualcanvas-scenegraph.html#scene-graph-and-rendering">Scene Graph and Rendering</a>.</p>
<!-- @@@QQuickFramebufferObject -->
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$mirrorVertically-prop$$$mirrorVertically$$$setMirrorVerticallybool$$$mirrorVerticallyChangedbool -->
<h3 class="fn" id="mirrorVertically-prop"><a name="mirrorVertically-prop"></a><span class="name">mirrorVertically</span> : <span class="type">bool</span></h3>
<p>This property controls if the size of the FBO's contents should be mirrored vertically when drawing. This allows easy integration of third-party rendering code that does not follow the standard expectations.</p>
<p>The default value is <code>false</code>.</p>
<p>This property was introduced in  Qt 5.6.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>mirrorVertically</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setMirrorVertically</b></span>(bool <i>enable</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>mirrorVerticallyChanged</b></span>(<i>bool</i>)</td></tr>
</table></div>
<!-- @@@mirrorVertically -->
<!-- $$$textureFollowsItemSize-prop$$$textureFollowsItemSize$$$setTextureFollowsItemSizebool$$$textureFollowsItemSizeChangedbool -->
<h3 class="fn" id="textureFollowsItemSize-prop"><a name="textureFollowsItemSize-prop"></a><span class="name">textureFollowsItemSize</span> : <span class="type">bool</span></h3>
<p>This property controls if the size of the FBO's texture should follow the dimensions of the <a href="qquickframebufferobject.html">QQuickFramebufferObject</a> item. When this property is false, the FBO will be created once the first time it is displayed. If it is set to true, the FBO will be recreated every time the dimensions of the item change.</p>
<p>The default value is <code>true</code>.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>textureFollowsItemSize</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setTextureFollowsItemSize</b></span>(bool <i>follows</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>textureFollowsItemSizeChanged</b></span>(<i>bool</i>)</td></tr>
</table></div>
<!-- @@@textureFollowsItemSize -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QQuickFramebufferObject[overload1]$$$QQuickFramebufferObjectQQuickItem* -->
<h3 class="fn" id="QQuickFramebufferObject"><a name="QQuickFramebufferObject"></a>QQuickFramebufferObject::<span class="name">QQuickFramebufferObject</span>(<span class="type"><a href="qquickitem.html#QQuickItem">QQuickItem</a></span> *<i>parent</i> = nullptr)</h3>
<p>Constructs a new <a href="qquickframebufferobject.html">QQuickFramebufferObject</a> with parent <i>parent</i>.</p>
<!-- @@@QQuickFramebufferObject -->
<!-- $$$createRenderer[overload1]$$$createRenderer -->
<h3 class="fn" id="createRenderer"><a name="createRenderer"></a><code>[pure virtual] </code><span class="type"><a href="qquickframebufferobject-renderer.html">QQuickFramebufferObject::Renderer</a></span> *QQuickFramebufferObject::<span class="name">createRenderer</span>() const</h3>
<p>Reimplement this function to create a renderer used to render into the FBO.</p>
<p>This function will be called on the rendering thread while the GUI thread is blocked.</p>
<!-- @@@createRenderer -->
<!-- $$$isTextureProvider[overload1]$$$isTextureProvider -->
<h3 class="fn" id="isTextureProvider"><a name="isTextureProvider"></a><code>[override virtual] </code><span class="type">bool</span> QQuickFramebufferObject::<span class="name">isTextureProvider</span>() const</h3>
<p>Reimplemented from <a href="qquickitem.html#isTextureProvider">QQuickItem::isTextureProvider</a>().</p>
<!-- @@@isTextureProvider -->
<!-- $$$releaseResources[overload1]$$$releaseResources -->
<h3 class="fn" id="releaseResources"><a name="releaseResources"></a><code>[override virtual] </code><span class="type">void</span> QQuickFramebufferObject::<span class="name">releaseResources</span>()</h3>
<p>Reimplemented from <a href="qquickitem.html#releaseResources">QQuickItem::releaseResources</a>().</p>
<!-- @@@releaseResources -->
<!-- $$$textureProvider[overload1]$$$textureProvider -->
<h3 class="fn" id="textureProvider"><a name="textureProvider"></a><code>[override virtual] </code><span class="type"><a href="qsgtextureprovider.html">QSGTextureProvider</a></span> *QQuickFramebufferObject::<span class="name">textureProvider</span>() const</h3>
<p>Reimplemented from <a href="qquickitem.html#textureProvider">QQuickItem::textureProvider</a>().</p>
<!-- @@@textureProvider -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2019 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>