title: Can't properly save QChartView as image when using QLineSeries with openGL on
body: <p>i am trying to create an application which can plot large data sets (so using of OpenGl is important to me). I use <code>QChartView</code>, <code>QChart</code> and <code>QLineSeries</code>. Also for <code>QLineSeries</code> i turn using openGL on. But when i'm trying to save chart as an image i get plot without data. I know that when <code>QLineSeries</code> using openGL it creates a <code>QOpenGLWidget</code> on top of the chart plot area, but i don't know ho to access it.</p>
  
  <p><strong>So a question is</strong>: how to save a chart as an image with drawn lines?</p>
  
  <p>Some images:</p>
  
  <p>What i want (Plot without using openGL):</p>
  
  <p><a href="https://i.stack.imgur.com/TZTKq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TZTKq.png" alt="Plot without using openGL"></a></p>
  
  <p>What i get (Plot with openGL):</p>
  
  <p><a href="https://i.stack.imgur.com/nBTuH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nBTuH.png" alt="Plot with openGL"></a></p>
  
  <p>Here is an example of code:</p>
  
  <p>MainWindow constructor:</p>
  
  <pre><code>chartView = new QChartView(generate_sin_chart(), ui-&gt;centralWidget);
  ui-&gt;centralWidget-&gt;layout()-&gt;addWidget(chartView);
  </code></pre>
  
  <p>generate_sin_chart():</p>
  
  <pre><code>QLineSeries *series = new QLineSeries();
  series-&gt;setUseOpenGL(true); //this line cause a problem
  
  constexpr double PI = 3.14159265359;
  for(int i = 0; i &lt; 100; ++i)
  {
      double temp = i*PI/6;
      series-&gt;append(temp, sin(temp));
  }
  
  QChart *chart = new QChart();
  chart-&gt;legend()-&gt;hide();
  chart-&gt;addSeries(series);
  chart-&gt;createDefaultAxes();
  chart-&gt;setTitle("Simple line chart example");
  
  return chart;
  </code></pre>
  
  <p>Function for saving:</p>
  
  <pre><code>QString filename = QFileDialog::getSaveFileName(this, tr("Save file"), "", tr("Images (*.png)"));
  QPixmap p = chartView-&gt;grab();
  p.save(filename, "PNG");
  </code></pre>