QPainter save() and restore()
-
When using QPainter::save(),
"A save() must be followed by a corresponding restore()"The safest way to ensure this would be to use the RAII idiom, much like in QMutexLocker and friends.
Does such a convenience class already exist for QPainter?
-
Yes it is. Took about 5 Minutes.
Still, it's so easy I thought someone would have already done it in Qt.
-
You could contribute it to Qt via http://www.qt-project.org/