Quote Originally Posted by anda_skoa View Post
In C++ one of the core principles is to not prematurely pessimise, e.g. not cleary newly allocated memory by default, and it is always possible to add more convenience but almost never possible to remove default overhead.
Hm, that makes sense, better getting the constructs right the first time than getting them wrong and having to live with them forever.

Quote Originally Posted by anda_skoa View Post
Not sure developers would understand that something as apparently simple as creating a copy would increase the overhead of each draw call or would require extra code to make a copy "current".
Of course, that's a good point.

Quote Originally Posted by anda_skoa View Post
You could even consider contributing such a "QScopedPainterState" to Qt.
If I ever write such a wrapper, I will consider contributing with it.

Quote Originally Posted by anda_skoa View Post
Would be highly confusing if you passed a const painter and suddenly end up with different content in the thing you are painting on, wouldn't it?
Not at all – what should get modified is the thing you paint on, and I don't see why the thing you paint with should be modified?