[Qt-interest] QGraphicsTextItem Dotted rectangle.

manish.s.sharma at nokia.com manish.s.sharma at nokia.com
Sat Aug 29 15:31:28 CEST 2009


Hi Andre,

Thanks a lot! It worked :)
I have to set the state variable in the implemented paint function for the textItem.

Thanks a again!!
Manish 

>-----Original Message-----
>From: qt-interest-bounces at trolltech.com 
>[mailto:qt-interest-bounces at trolltech.com] On Behalf Of ext 
>André Somers
>Sent: Saturday, August 29, 2009 6:16 PM
>To: qt-interest at trolltech.com
>Subject: Re: [Qt-interest] QGraphicsTextItem Dotted rectangle.
>
>On Friday 28 August 2009 05:03:23 pm manish.s.sharma at nokia.com wrote:
>> Hi All,
>>
>> I am creating a QGraphicsTextItem. I am making it editable 
>by setting 
>> appropriate interaction flag. When I click on this textitem it gets 
>> highlighted and a dotted rectangle is drawn around the peripheral of 
>> the text item.
>>
>> Is it possible to remove this dotted rectangle? Please see 
>in below pic.
>
>It should be...
>The way I would go about this, is to subclass 
>QGraphicsTextItem. Reimplement the paint() method. In your 
>reimplementation, you can modify the style options to your 
>liking, and then simply call the base implementation. I am not 
>exactly sure what style option to modify, probably you need to 
>(un)set one of the flags set in the state variable.
>This way, you won't have to reimplement the actual drawing yourself :-)
>
>Still: while I have done similar things with item views in the 
>past, I have not tried this technique on QGraphicsView's. YMMV.
>
>I hope that helps?
>
>André
>
>
>
>
>_______________________________________________
>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