I have a QgraphicsScene where user can manually add items like reactangles, freehand lines etc (mouse drawing).

I use QGraphicsScene because I want to provide the following functionality:
After drawing an item, user can drag it around and apply some transforms before it is permanently added to the scene (no more editable)

Now, I want to provide a flood fill function also.
As you can see, this requires all of the scene to be somehow converted into a Qimage so that I can access the pixels
(Let me know if there is some way to do this in the Qgraphicscene itself !)

I was thinking it'd be convinient if I could draw each Qgraphicsitem onto a QImage once they are permanently added to the scene (after user does required transformations). So when the floodfill is invoked, I can simply access this QImage and do the processing!
Can this be done?

( As I have said, using Qgraphicscene is required for above mentioned reasons. Hoping to find a way in which I can draw a QgraphicsItem onto an image without implementing the whole (mouse) drawing logic for a QPainter too! )