PDA

View Full Version : Print QGraphicsView with QGraphicsSvgItem to postscript



kswietko
3rd September 2011, 20:44
Hello,
I need to print my QGraphicsView with QGraphicsSvgItem to a postscript/pdf file.
Everything look nice, but my QGraphicsSvgItem is rendering as a raster, not as a vector graphic. Is there any way to change this?


QPrinter printer(QPrinter::HighResolution);
printer.setOutputFormat(QPrinter::PdfFormat);
printer.setOutputFileName(fileName);
updatePrinter(&printer);



thx in advance
Kacper

kswietko
5th September 2011, 01:24
I can't edit my previous post. Something's wrong after site update.

The problem was in item settings.


item->setCacheMode(QGraphicsItem::DeviceCoordinateCache) ;
item->setCachingEnabled(true);

When it's cached it would render to file as a raster,
when i turrned off caching it gave me a vector file.

Is it a bug?