Add PainterSaver and use it to avoid problems with missing QPainter::restore()

Authored by staniek on Oct 18 2016, 7:50 PM.