Wouldn't it be enough to transform the painter matrix to do it all?

Hmm... Looks like QMatrix is just 2x2 in size...