Saturday, January 29, 2011

PDF export finally works


Finally resolved the long postponed issue of PDF export. The solution involved changing the ConnectionGraphicsItem class from being a QGraphicsPathItem to a QGraphicsItemGroup. The group then contains path items with it. There are three path items -- one for the main connection itself, one for a white border around it (when lines overlap), and one for the red border when connections are selected. Why does this work? No idea. There is something about the way Qt renders graphics path items that I am unaware of, so its probably best to use their available classes (as in this new strategy).

The exported PDF (from "screenshot" button) is clearly using vector graphics and not pixels.



No comments: