hello, I overrided the paint() in the class QGraphicsTextItem
the Code
Code:
{ item->drawRect(rect); }
but the rect only display the top and left frame lines
the bottom and right frame lines disappear
thanks
Printable View
hello, I overrided the paint() in the class QGraphicsTextItem
the Code
Code:
{ item->drawRect(rect); }
but the rect only display the top and left frame lines
the bottom and right frame lines disappear
thanks
That's perfectly normal. Read QRect docs about the right() and bottom() members.
Why is it perfeclty normal? The painter cannot draw it correctly?
Isn't it a question of antialiasing?
That's OK
thanks a lot!
I have another problem, how to change the line space?
A box of height and width of 40 at 0,0 takes pixels 0-39 to draw. Now, if you draw a box that fits in that, and you measure, you'll get pixels 1-38 as the difference between the lines. This creates a problem, because your drawn with is no where near the 40 width your rect indicated. What you have to do is pic the next-highest pixel. So you end up drawing on 0 and 40. But the 40th pixel is clipped. I've seen this done in many different packages and it is "right".