Elegant way of getting if element is focused in function QGraphicsItem::shape()
hello,
i can learn if my object inherits from QGraphicsItem is focused in paint method:
Code:
{
if (option
->state
& QStyle::State_HasFocus) { //if focus some shape
} else {
//if no focus another shape
}
}
but i must click it and the shape must change whether it is focused or not.
how can i get if focused information in
method in an appropriate way?
I think to declare a global variable but i do not like this idea.
thanks
Re: Elegant way of getting if element is focused in function QGraphicsItem::shape()
strange: why you couldn't find: QGraphicsItem::hasFocus