And no API is perfect, sometimes less then ideal API is kept as changing it would otherwise have massive impact on existing code.
Your idea of using instance copying for keeping states is quite good IMHO from a readability point of view, though it might also require a different approach in savind/restoring state then
Excellent :-)
I've never actually considered that until you brought it up.
It is small improvements like this that allow a framework to evolve rather than to stagnate.
Theoretically true, the paint device is held by pointer and the pointer value doesn't change so the QPainter method could call non-const paint device methods.
Maybe there are even compilers which generated warnings for this or it was done for consistency (methods starting with an imperative verb usually do change the state of the object they are invoked on)
Cheers,
_
Bookmarks