I am not trying to argue, just understand. Wrapping or subclassing the text item doesn't help, because it still has an internal coordinate system in pixels.
So, I am almost at a solution. I turned off ItemIgnoresTransformations for the QGraphicsSimpleTextItem instance. So, now when I obtain the text width and call textItem->mapRectToParent( textItem->boundingRect() ), I get a rect in centimeters. I can center the text because I have apples + apples.
To prevent it from scaling, I set a scale transform on the text item that is the inverse of the centimeter item's scale (i.e. 1 / sx, 1 / sy). So now the text remains the same size regardless of the scale of the centimeter item.
A few more tweaks, and I think I will have something that behaves the way I want it to.
Thank you for the help.
Bookmarks