hello,
i can learn if my object inherits from QGraphicsItem is focused in paint method:
{
if (option
->state
& QStyle::State_HasFocus) { //if focus some shape
} else {
//if no focus another shape
}
}
void MyQGraphicsItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *)
{
if (option->state & QStyle::State_HasFocus) {
//if focus some shape
} else {
//if no focus another shape
}
}
To copy to clipboard, switch view to plain text mode
but i must click it and the shape must change whether it is focused or not.
how can i get if focused information in
QPainterPath QGraphicsItem::shape() const
To copy to clipboard, switch view to plain text mode
method in an appropriate way?
I think to declare a global variable but i do not like this idea.
thanks
Bookmarks