title: How to size the texture to occupy only a portion of a QQuickItem UI
body: <p>I have overriden <code>updatePaintNode</code> in the following way to draw an OpenGL texture on a <code>QQuickItem</code> derived class called <code>MyQQuickItem</code> here.</p>
  
  <pre><code>QSGNode *MyQQuickItem::updatePaintNode(QSGNode * oldNode, QQuickItem::UpdatePaintNodeData * /*updatePaintNodeData*/) 
  {
    QSGSimpleTextureNode * textureNode = static_cast&lt;QSGSimpleTextureNode *&gt;(oldNode);
  
    if (!textureNode) {
      textureNode = new QSGSimpleTextureNode();
    }
  
    QSize size(800, 800);
    // myTextureId is a GLuint here
    textureNode.reset(window()-&gt;createTextureFromId(myTextureId, size));
    textureNode-&gt;setTexture(my_texture);
    textureNode-&gt;markDirty(QSGBasicGeometryNode::DirtyMaterial);
  
    QSizeF myiewport = boundingRect().size();
  
    qreal xOffset = 0;
    qreal yOffset = 10;
  
    textureNode-&gt;setRect(xOffset, yOffset, myViewport.width(), myViewport.height());
    return textureNode;
  }
  </code></pre>
  
  <p>This renders the texture content well but covers the whole of my <code>MyQQuickItem</code> UI. </p>
  
  <p><strong>How can reduce the bottom margin of the texture to say fit 80% of the height</strong> of <code>MyQQuickItem</code>.
  I want to <strong>render the texture to a portion of</strong> <code>MyQQuickItem</code> &amp; leave the rest blank or black? Is that possible within <code>updatePaintNode</code>.</p>
  
  <p><strong>Note</strong> that the texture size is not the UI window size here. My texture size is <em>800 by 800</em>. Whereas the UI window size is different and depends on the screen.</p>