[Qt-interest] Need a little help with QGraphicsTextItem

Jesús Fernández Prieto jsfdez at gmail.com
Wed Jun 17 14:08:48 CEST 2009


Thanks, I had this problem time ago, anyway I think it's an ugly way to
remove this selection rectangle.

Regards

On Wed, Jun 17, 2009 at 1:48 PM, Nuno Correia <nuno.correia at cnotinfor.pt>wrote:

> SOLVED, for remove  the rectangle it is necessary to deny the state in the
> paint
>
>
> -------------------CODE------
> ...
> class TextEditItem:: public QGraphicsTextItem
> ....
>
> void TextEditItem::paint( QPainter *painter, const
> QStyleOptionGraphicsItem *option, QWidget *widget )
> {
>
>
>        QStyleOptionGraphicsItem* style =
> const_cast<QStyleOptionGraphicsItem*>( option );
>        style->state &= ~( QStyle::State_Selected | QStyle::State_HasFocus
> );
>
>        QGraphicsTextItem::paint( painter, option, widget );
> }
>
> ...
> ------END CODE-----
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090617/d2eca993/attachment.html 


More information about the Qt-interest-old mailing list