[Interest] Double-buffering QGraphicsItem with QImage on retina display

Patrick Stinson patrickkidd at gmail.com
Fri Mar 17 04:01:18 CET 2017


Hi there!

I am implementing handwriting with the apple pencil and am double-buffering each stroke on a QImage before passing the resulting pixmap and bounding rect for the stroke to a QGraphicsItem. The problem is that painting to the QImage is not at retina resolution which is what you get when you paint directly to the scene via QGraphicsItem::paint.

Does anyone have a suggestion for how to handle this?

Should I just double the QImage size and then translate the coordinates appropriately? Then half the target rect in QPainter::drawPixmap(const Rect &target, const QPixmap &, const QSize &source)? Or is there a more elegant way to do it?

Thanks!
-P





More information about the Interest mailing list