Owner-draw QGraphicsItem Problem
General and Desktop
7
Posts
3
Posters
3.9k
Views
1
Watching
-
Hi,
I have to draw a custom graphics item on QGraphicsView, but the problem is APIs of QPainter are not sufficient for me to draw the item. So I create a QPixmap which is as large as the viewport, and draw my item on the QPixmap, then draw the QPixmap by calling QPainter::drawPixmap(). But this way is inefficient and need much more memory.
Is there any way to improve? Can I get the pixel buffer of the QGraphicsView and draw on it directly when QGraphicsItem::paint() is called?
BTW: I use raster graphics engine.
Thank you!