title: QML How to paint different to grabToImage()
body: <p>Is there any possible way to make <code>grabToImage()</code> buffer different from what's displayed in GUI? I'm using <code>ChartView</code> without legend in GUI and want to export it to <code>PNG</code> with legend. So I try: </p>
  
  <pre><code>chartView.legend.visible = true
  chartView.update()
  chartView.grabToImage(function(result) {
      console.log("grabbed")
  
      var path = filename.toString().replace(/^(file:\/{2})/,"");
      console.log(path + result.saveToFile(path));
      chartView.legend.visible = false
      update();
  });
  </code></pre>
  
  <p>But both those updates happen only after the control comes out of this function, so I don't get legend drawn in PNG. Also I would like the appearance of legend to be unnoticable to user. Are there any ways to do that in QML? </p>