Results 1 to 2 of 2

Thread: Print QGraphicsView with QGraphicsSvgItem to postscript

  1. #1
    Join Date
    Sep 2011
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Print QGraphicsView with QGraphicsSvgItem to postscript

    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

  2. #2
    Join Date
    Sep 2011
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Print QGraphicsView with QGraphicsSvgItem to postscript

    I can't edit my previous post. Something's wrong after site update.

    The problem was in item settings.

    Qt Code:
    1. item->setCacheMode(QGraphicsItem::DeviceCoordinateCache);
    2. item->setCachingEnabled(true);
    To copy to clipboard, switch view to plain text mode 

    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?
    Last edited by kswietko; 5th September 2011 at 00:30.

Similar Threads

  1. Replies: 2
    Last Post: 24th July 2011, 23:58
  2. Postscript gereration with QT
    By dexli in forum Newbie
    Replies: 4
    Last Post: 7th April 2011, 10:46
  3. Problem in opening postscript image
    By deck99 in forum Qt Programming
    Replies: 1
    Last Post: 19th March 2011, 10:09
  4. Cancelling Long-running Print/Print Preview
    By ChrisW67 in forum Newbie
    Replies: 4
    Last Post: 16th June 2009, 23:05
  5. QStackedWidget fill Postscript image And scroll problem
    By patrik08 in forum Qt Programming
    Replies: 11
    Last Post: 22nd April 2007, 09:30

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.