QPainter works on a QPaintDevice, and in the case of QWidget you can't paint from outside a paint event. I really don't see why you need to paint anything in 'deserialize', however.
The way I understand it, you save the file by serializing the objects to a file stream (in 'serialize'). So, deserialize should do the opposite – that is, parse whatever data you read from the file according to the same rules and add objects correspondingly to the 'objects' vector. Then you simply call update() to repaint the widget (or rather, post an event that will be processed when the program returns to the main event loop).
Hey!
I have done it!
Bookmarks