title: How to render text in QQuickFramebufferObject?
body: <p><strong>Motivation:</strong> I currently have 1000 simple items in my QML scene, and one of them animates at 60fps, so the entire scene repaints at 60fps. Cpu usage is on average 15% on each of my 4 virtual cores on my pc. On the target hardware the situation is even worse - 60% on each of the 4 physical cores, leading to overheating, leading to freeze. Note that I have implemented an optimization: via <code>Loader</code>s, unload all items that are outside the (scrolling) viewport (so, only ~18 items are loaded at any given time). The perf stats I report are <strong>with</strong> this optimization - without it it's worse.</p>
  
  <p>My solution is to start drawing all the 1000 items in a single QQuickFramebufferObject, and stop having them as actual QML Item's. That way I'll avoid Qt punishing me for just having 1000 (unloaded!) items.</p>
  
  <p><strong>Where I'm stuck though:</strong> How to draw the text parts of the items in OpenGL?</p>
  
  <p>Approach 1: I know QPainter can be used to directly render text into a QOpenGLWidget, but that option seems to be absent in QQFBO.</p>
  
  <p>Approach 2: Have a single, parentless <code>Text</code> item in QML with <code>layer.enabled: true</code>, set its <code>text</code> property, wait 1 frame (for it to render) then fetch the texture. Somewhat ugly and roundabout; also may be slow-ish.</p>
  
  <p>Approach 3: Look at the source of QQuickText to see what magic it does and  copy it. Might be difficult, and I'll have to comply with license restrictions.</p>
  
  <p>Approach 4: Do software rendering with a QPainter to a QImage, then upload that image to a texture. Elegant, but may be too slow.</p>
  
  <p>Any suggestions on a way to do it that doesn't have the problems in these approaches?</p>