[Qt-interest] Need a little help with QGraphicsTextItem

Nuno Correia nuno.correia at cnotinfor.pt
Wed Jun 17 13:48:52 CEST 2009


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-----



More information about the Qt-interest-old mailing list