What I needed was a way to create an image from SVG raw data generated in the fly. Here is possible solution:
<sxh c++>
QTextCursor mainCursor; // Should be initialised somehow QString figData( "<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\"> " "<circle cx=\"100\" cy=\"50\" r=\"40\" stroke=\"black\" " "stroke-width=\"2\" fill=\"red\"/> " "</svg>"); QXmlStreamReader figReader(figData); QSvgRenderer renderer; bool status = renderer.load(&figReader); if (!status) { std::cerr << "CANNOT LOAD IMAGE\n"; } QImage image = QImage(QSize(100,100),QImage::Format_RGB32); QPainter painter(&image); renderer.render(&painter); painter.end(); mainCursor.insertImage(image);
</sxh>