[Qt-interest] ugly QGraphicsTexItem when it is zoomed
changwon lee
bosscq at nexgeo.com
Thu Sep 30 17:32:15 CEST 2010
Hello
I have struggled to solve it. my conclusion is as follows.
there are two option.
1. avoid to use small pointsize (< 1) by controlling scene coordinate.
(setUseDesignMetric is not helpful in very small pointsize)
2. use QPainterpath
the extent of my graphicsitem is about 6. and I have to add textItem
which has pointsize of 0.1~0.8.
in this case when I use QGraphicTextItem and zoom, it looks ugly and in
edit mode, textcursor is too thick and boundRect is too big.
I abandoned interactive editing of QGraphicsTextItem.
instead I draw text by QPainterPath and to edit text I have used some
text edit dialog by double-clicking item.
but if I magnify model coordinate by some factor, then maybe
QGraphicsTextItem can be used because of larger pointsize.
but I want to use model coordinate as it is.
regards
On 2010-09-23 오후 11:45, Sean Harmer wrote:
> Hi,
>
> On Thursday 23 September 2010 15:34:30 changwon lee wrote:
>> I don't know how to disable font hint.
> QTextOption option;
> option.setUseDesignMetrics( true );
> painter->drawText( myString, myBoundingRect, option );
>
> should do it I think (not tested).
>
> Cheers,
>
> Sean
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
More information about the Qt-interest-old
mailing list