Obviously you don't understand the restore function. It doesn't clear the sets. It restores the settings as they were when save() was called.
p.save(); // = save point 1
// do fancy stuff with p
p.save(); // = save point 2
// do fancy stuff with p
p.restore(); // now p is like save point 2
// do fancy stuff with p
p.restore(); // now p is like save point 1
QPainter p;
p.save(); // = save point 1
// do fancy stuff with p
p.save(); // = save point 2
// do fancy stuff with p
p.restore(); // now p is like save point 2
// do fancy stuff with p
p.restore(); // now p is like save point 1
To copy to clipboard, switch view to plain text mode
Bookmarks