Details
-
Bug
-
Resolution: Done
-
P2: Important
-
None
-
4.8.4, 4.8.x
-
None
-
Kubuntu 12.10 x86_64
Description
I am using the graphics view framework and some of my custom items draw text using QPainter::drawStaticText and QStaticText.
Everything works fine if the view is not scaled. If I zoom in or out any text that is underlined is displayed incorrectly, more specifically the underline is not where it is supposed to be.
- Zoom in: the underline is rendered below and to the right of the text
- Zoom out: the underline is rendered above and the left of the text
Although the line appears at the wrong position, it is correctly scaled.
A more detailed explanation:
- The distance between the underline and the text is affected by scrolling the view. I have a big scene and only a smaller subset of it is visible at any one time. The closer the underlined text is to the top-left corner of the view, the closer the underline is to the text. It appears as if the underline's offset to the view's top-left corner is scaled:
- If I zoom in and the scale is say 2.0, an underline that should appear at an offset (x,y) from the view's top-left corner, actually appears at (2x,2y)
- If I zoom out and the scale is say 0.5, an unerline that should appear at an offset(x,y) from the view's top-left corner, actually appears at (0.5x,0.5y)