What I'm trying to achieve is the following: I have a QGraphicsScene
with a QGraphicsPixmapItem
shown in it. The pixmap has multiple colors and I need to draw a line across the pixmap that must be visible and recognizable in every single point.
My idea is to draw a line where every pixel has the negative (complementary) color of the pixmap's relative pixel. So I thought about subclassing QGraphicsItem
and reimplement the paint()
method to draw a multi-colored line.
However I'm stuck because I don't know how I can retrieve the pixel information of the pixmap from the paint
function, and even if I found out, I can't think of a way to draw the line in this way.
Could you give me some advice on how to proceed?