I am trying to get the output of QSvgGenerator into a string for use in-line in HTML. I can use the .setFileName(...) method, and get output as a file, but .setOutputDevice(&qbuffer) doesn't add anything to the qbuffer (and I can use qbuffer.write(...); to write strings into the buffer before and after the scene.render( &painter ); rendering operation gets called on the QSvgGenerator.
I've attached a complete stand-alone command-line app (.cpp, .h and .pro) to demonstrate the problem, though I'm experiencing this in a full GUI app. Running this application with no arguments should dump an SVG containing a rectangle to the console. Running the application with an argument writes the SVG file to the first argument (this works).
Bookmarks