You need to finish the painting before trying to read the buffer (or it will not be finished until the painter is destroyed, which is after you read).
Qt Code:
  1. QPainter painter( &svgGenerator );
  2. scene.render( &painter );
  3. painter.end();
To copy to clipboard, switch view to plain text mode